Public Member Functions | Static Public Member Functions

Comments Class Reference

List of all members.

Public Member Functions

 only ($what= 'approved')
 __get ($name)
 delete ()

Static Public Member Functions

static get ($paramarray=array())
static delete_these ($comments)
static moderate_these ($comments, $status=Comment::STATUS_UNAPPROVED)
static by_email ($email= '')
static by_name ($name= '')
static by_ip ($ip= '')
static by_url ($url= '')
static by_post_id ($post_id)
static by_slug ($slug= '')
static by_status ($status=0)
static count_total ($status=Comment::STATUS_APPROVED, $type=Comment::COMMENT)
static count_by_name ($name= '', $status=Comment::STATUS_APPROVED)
static count_by_email ($email= '', $status=Comment::STATUS_APPROVED)
static count_by_url ($url= '', $status=Comment::STATUS_APPROVED)
static count_by_ip ($ip= '', $status=Comment::STATUS_APPROVED)
static count_by_slug ($slug= '', $status=Comment::STATUS_APPROVED)
static count_by_id ($id=0, $status=Comment::STATUS_APPROVED)
static count_by_author ($id=0, $status=Comment::STATUS_APPROVED)
static set ($params)
static delete_by_status ($status)
static search_to_get ($search_string)

Detailed Description

Habari Comments Class

Definition at line 11 of file comments.php.


Member Function Documentation

Comments::__get ( name  ) 

function __get Implements custom object properties

Parameters:
string Name of property to return
Returns:
mixed The requested field value

Definition at line 616 of file comments.php.

static Comments::by_email ( email = ''  )  [static]

function by_email selects all comments from a given email address

Parameters:
string an email address
Returns:
array an array of Comment objects written by that email address

Definition at line 460 of file comments.php.

static Comments::by_ip ( ip = ''  )  [static]

function by_ip selects all comments from a given IP address

Parameters:
string an IP address
Returns:
array an array of Comment objects written from the given IP

Definition at line 488 of file comments.php.

static Comments::by_name ( name = ''  )  [static]

function by_name selects all comments from a given name

Parameters:
string a name
Returns:
array an array of Comment objects written by the given name

Definition at line 474 of file comments.php.

static Comments::by_post_id ( post_id  )  [static]

Returns all comments for a supplied post ID

Parameters:
post_id ID of the post
Returns:
array an array of Comment objects for the given post

Definition at line 515 of file comments.php.

static Comments::by_slug ( slug = ''  )  [static]

function by_slug select all comments for a given post slug

Parameters:
string a post slug
Returns:
array array an array of Comment objects for the given post

Definition at line 526 of file comments.php.

static Comments::by_status ( status = 0  )  [static]

function by_status select all comments of a given status

Parameters:
int a status value
Returns:
array an array of Comment objects with the same status

Definition at line 540 of file comments.php.

static Comments::by_url ( url = ''  )  [static]

function by_url select all comments from an author's URL

Parameters:
string a URL
Returns:
array array an array of Comment objects with the same URL

Definition at line 502 of file comments.php.

static Comments::count_by_author ( id = 0,
status = Comment::STATUS_APPROVED 
) [static]

static count_by_author returns the number of comments attached to posts by the specified author

Parameters:
int a user ID
mixed A comment status value, or false to not filter on status(default: Comment::STATUS_APPROVED)
Returns:
int a count of the comments attached to the specified post

Definition at line 762 of file comments.php.

Referenced by AdminDashboardHandler::get_dashboard().

static Comments::count_by_email ( email = '',
status = Comment::STATUS_APPROVED 
) [static]

static count_by_email returns the number of comments attributed ot the specified email

Parameters:
string an email address
mixed A comment status value, or false to not filter on status (default: Comment::STATUS_APPROVED)
Returns:
int a count of the comments from the specified email

Definition at line 683 of file comments.php.

static Comments::count_by_id ( id = 0,
status = Comment::STATUS_APPROVED 
) [static]

static count_by_id returns the number of comments attached to the specified post

Parameters:
int a post ID
mixed A comment status value, or false to not filter on status(default: Comment::STATUS_APPROVED)
Returns:
int a count of the comments attached to the specified post

Definition at line 746 of file comments.php.

Referenced by Post::__get().

static Comments::count_by_ip ( ip = '',
status = Comment::STATUS_APPROVED 
) [static]

static count_by_ip returns the number of comments from the specified IP address

Parameters:
string an IP address
mixed A comment status value, or false to not filter on status (default: Comment::STATUS_APPROVED)
Returns:
int a count of the comments from the specified IP address

Definition at line 714 of file comments.php.

static Comments::count_by_name ( name = '',
status = Comment::STATUS_APPROVED 
) [static]

static count_by_name returns the number of comments attributed to the specified name

Parameters:
string a commenter's name
mixed A comment status value, or false to not filter on status (default: Comment::STATUS_APPROVED)
Returns:
int a count of the comments from the specified name

Definition at line 667 of file comments.php.

static Comments::count_by_slug ( slug = '',
status = Comment::STATUS_APPROVED 
) [static]

static count_by_slug returns the number of comments attached to the specified post

Parameters:
string a post slug
mixed A comment status value, or false to not filter on status (default: Comment::STATUS_APPROVED)
Returns:
int a count of the comments attached to the specified post

Definition at line 730 of file comments.php.

static Comments::count_by_url ( url = '',
status = Comment::STATUS_APPROVED 
) [static]

static count_by_url returns the number of comments attributed to the specified URL

Parameters:
string a URL
mixed a comment status value, or false to not filter on status (default: Comment::STATUS_APPROVED)
Returns:
int a count of the comments from the specified URL

Definition at line 699 of file comments.php.

static Comments::count_total ( status = Comment::STATUS_APPROVED,
type = Comment::COMMENT 
) [static]

static count_total returns the number of comments based on the specified status and type

Parameters:
mixed A comment status value, or false to not filter on status (default: Comment::STATUS_APPROVED)
mixed A comment type value, or false to not filter on type (default: Comment::COMMENT)
Returns:
int a count of the comments based on the specified status and type

Definition at line 654 of file comments.php.

Referenced by AtomHandler::get_comments(), and AdminDashboardHandler::get_dashboard().

Comments::delete (  ) 

function delete Deletes all comments in this object

Definition at line 635 of file comments.php.

static Comments::delete_by_status ( status  )  [static]

static delete_by_status delete all the comments and commentinfo for comments with this status

Parameters:
mixed a comment status ID or name

Definition at line 797 of file comments.php.

Referenced by AdminCommentsHandler::ajax_update_comment().

static Comments::delete_these ( comments  )  [static]

Deletes comments from the database

Parameters:
mixed Comments to delete. An array of or a single ID/Comment object

Definition at line 371 of file comments.php.

Referenced by AdminCommentsHandler::ajax_update_comment().

static Comments::get ( paramarray = array()  )  [static]

function get Returns requested comments

Parameters:
array An associated array of parameters, or a querystring
Returns:
array An array of Comment objects, one for each query result

$comments = comments::get( array ( "author" => "skippy" ) ); $comments = comments::get( array ( "slug" => "first-post", "status" => "1", "orderby" => "date ASC" ) );

Definition at line 27 of file comments.php.

Referenced by CoreBlocks::action_block_content_recent_comments(), AdminCommentsHandler::ajax_update_comment(), by_email(), by_ip(), by_name(), by_post_id(), by_slug(), by_status(), by_url(), count_by_author(), count_by_email(), count_by_id(), count_by_ip(), count_by_name(), count_by_slug(), count_by_url(), count_total(), delete_these(), AtomHandler::get_comments(), and Pingback::xmlrpc_pingback__ping().

static Comments::moderate_these ( comments,
status = Comment::STATUS_UNAPPROVED 
) [static]

Changes the status of comments

Parameters:
mixed Comment IDs to moderate. May be a single ID, or an array of IDs

Definition at line 423 of file comments.php.

Referenced by AdminCommentsHandler::ajax_update_comment().

Comments::only ( what = 'approved'  ) 

function only returns all of the comments from the current Comments object of the specified type $tb = $comments->only( 'trackbacks' )

Returns:
array an array of Comment objects of the specified type

Definition at line 599 of file comments.php.

Referenced by __get().

static Comments::search_to_get ( search_string  )  [static]

Parses a search string for status, type, author, and tag keywords. Returns an associative array which can be passed to Comments::get(). If multiple authors, statuses, or types are specified, we assume an implicit OR such that (e.g.) any author that matches would be returned.

Parameters:
string $search_string The search string
Returns:
array An associative array which can be passed to Comments::get()

Definition at line 817 of file comments.php.

static Comments::set ( params  )  [static]

static set returns the number of document

Parameters:
array of params
Returns:
int the number of document or null

Definition at line 777 of file comments.php.


The documentation for this class was generated from the following file: