b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: Comment

Source Location: /blogs/inc/comments/model/_comment.class.php

Class Comment

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From DataObject

DataObject::$allow_ID_insert
DataObject::$delete_cascades
DataObject::$delete_restrictions
DataObject::$ID

Inherited From DataObject

DataObject::DataObject()
Constructor
DataObject::action_icon()
Generate requested action icon depending on perm
DataObject::action_link()
Generate requested action link depending on perm
DataObject::check_delete()
Check relations for restrictions before deleting
DataObject::check_relations()
Check relations for restrictions or cascades.
DataObject::confirm_delete()
Displays form to confirm deletion of this object
DataObject::dbchange()
Records a change that will need to be updated in the db
DataObject::dbdelete()
Delete object from DB.
DataObject::dbexists()
Check existence of specified value in unique field.
DataObject::dbinsert()
Insert object into DB based on previously recorded changes.
DataObject::dbsave()
Inserts or Updates depending on object state.
DataObject::dbupdate()
Update the DB based on previously recorded changes
DataObject::dget()
Get a ready-to-display member param by its name
DataObject::disp()
Display a member param by its name
DataObject::get()
Get a member param by its name
DataObject::get_action_title()
Generate help title text for action
DataObject::history_info_icon()
Create icon with dataobject history
DataObject::ID()
Template function: Displays object ID.
DataObject::set()
Set param value
DataObject::set_from_Request()
Set a parameter from a Request form value.
DataObject::set_param()
Set param value.
DataObject::set_string_from_param()
Set a string parameter from a Request form value.

[ Top ]
Property Summary
boolean   $allow_msgform   Does an anonymous commentator allow to send messages through a message form?
string   $author   Name of the (anonymous) visitor (if any).
string   $author_email   Email address of the (anonymous) visitor (if any).
string   $author_IP   IP address of the comment's author (while posting).
string   $author_url   URL/Homepage of the (anonymous) visitor (if any).
User   $author_User   The comment's user, this is NULL for (anonymous) visitors (lazy-filled).
integer   $author_user_ID   The ID of the author's user. NULL for anonymous visitors.
string   $content  
string   $date   Date of the comment (MySQL DATETIME - use e.g. mysql2timestamp()); local time ($localtimenow)
Item   $Item   The item (parent) of this Comment (lazy-filled).
integer   $item_ID   The ID of the comment's Item.
mixed   $nofollow  
string   $secret  
integer   $spam_karma   Spam karma of the comment (0-100), 0 being "probably no spam at all"
string   $status   Comment visibility status: 'published', 'deprecated', 'redirected', 'protected', 'private' or 'draft'
string   $type   Comment type: 'comment', 'linkback', 'trackback' or 'pingback'

[ Top ]
Method Summary
Comment   Comment()   Constructor
void   anchor()   Template function: display anchor for permalinks to refer to
void   author()   Template function: display author of comment
void   author_email()   Template function: display link to comment author's provided email
void   author_ip()   Template function: display comment's author's IP
boolean   author_url()   Template function: display link to comment author's provided URL
void   avatar()   Template function: display the avatar of the comment's author.
void   content()   Template function: display content of comment
void   date()   Template function: display date (datetime) of comment
boolean   dbdelete()   Trigger event AfterCommentDelete after calling parent method.
boolean   dbinsert()   Get karma and set it before adding the Comment to DB.
boolean   dbupdate()   Trigger event AfterCommentUpdate after calling parent method.
void   deleteurl_link()   Display delete icon for deleting author_url if user has proper rights
void   delete_link()   Displays button for deleeing the Comment if user has proper rights
void   deprecate_link()   Display link to deprecate a comment if user has edit rights
boolean   edit_link()   Provide link to edit a comment if user has edit rights
mixed   get()   Get a member param by its name
string   get_anchor()   Get the anchor-ID of the comment
string   get_author()   Get author of comment
string   get_author_email()   Get the EMail of the comment's author.
string   get_author_name()   Get the comment author's name.
string   get_author_url()   Get the URL of the comment's author.
boolean   get_author_url_link()   Get link to comment author's provided URL
User   &get_author_User()   Get the author User of the comment. This is NULL for anonymous visitors.
string   get_avatar()   Get the avatar of the comment's author.
string   get_content()   Template function: get content of comment
void   get_deprecate_link()   Provide link to deprecate a comment if user has edit rights
Item   &get_Item()   Get the Item this comment relates to
void   get_permanent_link()   Returns a permalink link to the Comment
void   get_permanent_url()   Generate permalink to this comment.
void   get_publish_link()   Provide link to publish a comment if user has edit rights
string   get_title()   Get title of comment, e.g. "Comment from: Foo Bar"
void   msgform_link()   Provide link to message form for this comment's author
void   permanent_link()   Displays a permalink link to the Comment
void   permanent_url()   Template function: display permalink to this comment
void   publish_link()   Display link to publish a comment if user has edit rights
void   rating()   Template tag: display rating
void   rating_input()   Rating input
void   rating_none_input()   Rating reset input
void   send_email_notifications()   Send email notifications to subscribed users:
boolean   set()   Set param value
void   set_author_User()   Set author User of this comment
void   set_Item()   Set Item this comment relates to
void   set_spam_karma()   Set the spam karma, as a number.
void   spam_karma()   Template function: display spam karma of the comment (in percent)
void   status()   Template function: display status of comment
void   time()   Template function: display time (datetime) of comment

[ Top ]
Properties
boolean   $allow_msgform [line 112]

Does an anonymous commentator allow to send messages through a message form?


[ Top ]
string   $author [line 78]

Name of the (anonymous) visitor (if any).


[ Top ]
string   $author_email [line 83]

Email address of the (anonymous) visitor (if any).


[ Top ]
string   $author_IP [line 93]

IP address of the comment's author (while posting).


[ Top ]
string   $author_url [line 88]

URL/Homepage of the (anonymous) visitor (if any).


[ Top ]
User   $author_User [line 58]

The comment's user, this is NULL for (anonymous) visitors (lazy-filled).

API Tags:
See:  Comment::get_author_User()
See:  Comment::set_author_User()
Access:  protected


[ Top ]
integer   $author_user_ID [line 63]

The ID of the author's user. NULL for anonymous visitors.


[ Top ]
string   $content [line 102]

[ Top ]
string   $date [line 98]

Date of the comment (MySQL DATETIME - use e.g. mysql2timestamp()); local time ($localtimenow)


[ Top ]
Item   $Item [line 45]

The item (parent) of this Comment (lazy-filled).

API Tags:
See:  Comment::get_Item()
See:  Comment::set_Item()
Access:  protected


[ Top ]
integer   $item_ID [line 50]

The ID of the comment's Item.


[ Top ]
mixed   $nofollow [line 114]

[ Top ]
string   $secret [line 118]

[ Top ]
integer   $spam_karma [line 107]

Spam karma of the comment (0-100), 0 being "probably no spam at all"


[ Top ]
string   $status [line 73]

Comment visibility status: 'published', 'deprecated', 'redirected', 'protected', 'private' or 'draft'


[ Top ]
string   $type [line 68]

Comment type: 'comment', 'linkback', 'trackback' or 'pingback'


[ Top ]
Methods
Constructor Comment  [line 123]

  Comment Comment( [ $db_row = NULL]  )

Constructor

Parameters:
   $db_row: 


[ Top ]
anchor  [line 289]

  void anchor( )

Template function: display anchor for permalinks to refer to



[ Top ]
author  [line 429]

  void author( [string $before = ''], [string $after = '#'], [string $before_user = ''], [string $after_user = '#'], [string $format = 'htmlbody'], [boolean $makelink = false]  )

Template function: display author of comment

Parameters:
string   $before:  String to display before author name if not a user
string   $after:  String to display after author name if not a user
string   $before_user:  String to display before author name if he's a user
string   $after_user:  String to display after author name if he's a user
string   $format:  Output format, see format_to_output()
boolean   $makelink:  true for link, false if you want NO html link


[ Top ]
author_email  [line 524]

  void author_email( [string $linktext = ''], [string $before = ''], [string $after = ''], [boolean $makelink = true]  )

Template function: display link to comment author's provided email

Parameters:
string   $linktext:  String to display for link: leave empty to display email
string   $before:  String to display before email, if email exists
string   $after:  String to display after email, if email exists
boolean   $makelink:  false if you want NO html link


[ Top ]
author_ip  [line 499]

  void author_ip( [string $before = ''], [string $after = '']  )

Template function: display comment's author's IP

Parameters:
string   $before:  String to display before IP, if IP exists
string   $after:  String to display after IP, if IP exists


[ Top ]
author_url  [line 589]

  boolean author_url( [string $linktext = ''], [string $before = ''], [string $after = ''], [boolean $makelink = true]  )

Template function: display link to comment author's provided URL

Parameters:
string   $linktext:  String to display for link: leave empty to display URL
string   $before:  String to display before link, if link exists
string   $after:  String to display after link, if link exists
boolean   $makelink:  false if you want NO html link

API Tags:
Return:  true if URL has been displayed


[ Top ]
avatar  [line 353]

  void avatar( [ $size = 'crop-64x64'], [ $class = 'bCommentAvatar'], [ $params = array()]  )

Template function: display the avatar of the comment's author.

Parameters:
   $size: 
   $class: 
   $params: 


[ Top ]
content  [line 1104]

  void content( [string $format = 'htmlbody']  )

Template function: display content of comment

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
date  [line 1150]

  void date( [string $format = ''], [boolean $useGM = false]  )

Template function: display date (datetime) of comment

Parameters:
string   $format:  date/time format: leave empty to use locale default date format
boolean   $useGM:  true if you want GMT


[ Top ]
dbdelete  [line 1527]

  boolean dbdelete( )

Trigger event AfterCommentDelete after calling parent method.


API Tags:
Return:  true on success


Redefinition of:
DataObject::dbdelete()
Delete object from DB.

[ Top ]
dbinsert  [line 1480]

  boolean dbinsert( )

Get karma and set it before adding the Comment to DB.


API Tags:
Return:  true on success, false if it did not get inserted


Redefinition of:
DataObject::dbinsert()
Insert object into DB based on previously recorded changes.

[ Top ]
dbupdate  [line 1455]

  boolean dbupdate( )

Trigger event AfterCommentUpdate after calling parent method.


API Tags:
Return:  true on success


Redefinition of:
DataObject::dbupdate()
Update the DB based on previously recorded changes

[ Top ]
deleteurl_link  [line 680]

  void deleteurl_link( [boolean $ajax_button = true], [glue $glue = '&']  )

Display delete icon for deleting author_url if user has proper rights

Parameters:
boolean   $ajax_button:  true if create ajax button
glue   $glue:  between url params


[ Top ]
delete_link  [line 717]

  void delete_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [boolean $button = false], [string $glue = '&'], [boolean $save_context = true], [boolean $ajax_button = false]  )

Displays button for deleeing the Comment if user has proper rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
boolean   $button:  true to make this a button instead of a link
string   $glue:  glue between url params
boolean   $save_context:  save context?
boolean   $ajax_button:  true if create AJAX button


[ Top ]
deprecate_link  [line 855]

  void deprecate_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&'], [boolean $save_context = true], [boolean $ajax_button = false]  )

Display link to deprecate a comment if user has edit rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
string   $glue:  glue between url params
boolean   $save_context:  save context?
boolean   $ajax_button:  true if create AJAX button


[ Top ]
edit_link  [line 639]

  boolean edit_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [ $glue = '&'], [ $save_context = true]  )

Provide link to edit a comment if user has edit rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
   $glue: 
   $save_context: 


[ Top ]
get  [line 206]

  mixed get( mixed $parname  )

Get a member param by its name

Parameters:
mixed   $parname:  Name of parameter

API Tags:
Return:  Value of parameter


Redefinition of:
DataObject::get()
Get a member param by its name

[ Top ]
get_anchor  [line 280]

  string get_anchor( )

Get the anchor-ID of the comment



[ Top ]
get_author  [line 447]

  string get_author( [string $before = ''], [string $after = '#'], [string $before_user = ''], [string $after_user = '#'], [string $format = 'htmlbody'], [boolean $makelink = false]  )

Get author of comment

Parameters:
string   $before:  String to display before author name if not a user
string   $after:  String to display after author name if not a user
string   $before_user:  String to display before author name if he's a user
string   $after_user:  String to display after author name if he's a user
string   $format:  Output format, see format_to_output()
boolean   $makelink:  true for link, false if you want NO html link


[ Top ]
get_author_email  [line 318]

  string get_author_email( )

Get the EMail of the comment's author.



[ Top ]
get_author_name  [line 300]

  string get_author_name( )

Get the comment author's name.



[ Top ]
get_author_url  [line 336]

  string get_author_url( )

Get the URL of the comment's author.



[ Top ]
get_author_url_link  [line 548]

  boolean get_author_url_link( [string $linktext = ''], [string $before = ''], [string $after = ''], [boolean $makelink = true]  )

Get link to comment author's provided URL

Parameters:
string   $linktext:  String to display for link: leave empty to display URL
string   $before:  String to display before link, if link exists
string   $after:  String to display after link, if link exists
boolean   $makelink:  false if you want NO html link

API Tags:
Return:  true if URL has been displayed


[ Top ]
get_author_User  [line 171]

  User &get_author_User( )

Get the author User of the comment. This is NULL for anonymous visitors.



[ Top ]
get_avatar  [line 367]

  string get_avatar( [ $size = 'crop-64x64'], [ $class = 'bCommentAvatar'], [ $params = array()]  )

Get the avatar of the comment's author.

Parameters:
   $size: 
   $class: 
   $params: 


[ Top ]
get_content  [line 1086]

  string get_content( [string $format = 'htmlbody']  )

Template function: get content of comment

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
get_deprecate_link  [line 801]

  void get_deprecate_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&'], [boolean $save_context = true], [boolean $ajax_button = false]  )

Provide link to deprecate a comment if user has edit rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
string   $glue:  glue between url params
boolean   $save_context:  save context?
boolean   $ajax_button:  true if create AJAX button


[ Top ]
get_Item  [line 188]

  Item &get_Item( )

Get the Item this comment relates to



[ Top ]
get_permanent_link  [line 1024]

  void get_permanent_link( [string $text = '#'], [string $title = '#'], [string $class = ''], [ $nofollow = false]  )

Returns a permalink link to the Comment

Note: If you only want the permalink URL, use Comment::get_permanent_url()

Parameters:
string   $text:  link text or special value: '#', '#icon#', '#text#'
string   $title:  link title
string   $class:  class name
   $nofollow: 


[ Top ]
get_permanent_url  [line 991]

  void get_permanent_url( )

Generate permalink to this comment.

Note: This actually only returns the URL, to get a real link, use Comment::get_permanent_link()



[ Top ]
get_publish_link  [line 873]

  void get_publish_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&'], [boolean $save_context = true], [boolean $ajax_button = false]  )

Provide link to publish a comment if user has edit rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
string   $glue:  glue between url params
boolean   $save_context:  save context?
boolean   $ajax_button:  true if create AJAX button


[ Top ]
get_title  [line 1118]

  string get_title( [array $params = array()]  )

Get title of comment, e.g. "Comment from: Foo Bar"

Parameters:
array   $params:  Params 'author_format': Formatting of the author (%s gets replaced with the author string)


[ Top ]
msgform_link  [line 942]

  void msgform_link( string $form_url, [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = '']  )

Provide link to message form for this comment's author

Parameters:
string   $form_url:  url of the message form
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name


[ Top ]
permanent_link  [line 1062]

  void permanent_link( [ $params = array()]  )

Displays a permalink link to the Comment

Note: If you only want the permalink URL, use Comment::permanent_url()

Parameters:
   $params: 


[ Top ]
permanent_url  [line 1009]

  void permanent_url( [string $mode = ''], [string $blogurl = '']  )

Template function: display permalink to this comment

Note: This actually only returns the URL, to get a real link, use Comment::permanent_link()

Parameters:
string   $mode:  'urltitle', 'pid', 'archive#id' or 'archive#title'
string   $blogurl:  url to use


[ Top ]
publish_link  [line 926]

  void publish_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&'], [boolean $save_context = true], [boolean $ajax_button = false]  )

Display link to publish a comment if user has edit rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
string   $glue:  glue between url params
boolean   $save_context:  save context?
boolean   $ajax_button:  true if create AJAX button


[ Top ]
rating  [line 1177]

  void rating( [ $params = array()]  )

Template tag: display rating

Parameters:
   $params: 


[ Top ]
rating_input  [line 1201]

  void rating_input( [ $params = array()]  )

Rating input

Parameters:
   $params: 


[ Top ]
rating_none_input  [line 1233]

  void rating_none_input( [ $params = array()]  )

Rating reset input

Parameters:
   $params: 


[ Top ]
send_email_notifications  [line 1293]

  void send_email_notifications( )

Send email notifications to subscribed users:


Information Tags:
Todo:  shall we notify suscribers of blog were this is in extra-cat?
Todo:  fp> SEPARATE MODERATION notifications from SUBSCRIPTION notifications
Todo:  cache message by locale like Item::send_email_notifications()
Todo:  dh> Indicator in url to see where the user came from (&from=subnote ["subscription notification"]) - Problem: too long urls.
Todo:  dh> "Beautify" like Item::send_email_notifications() ? fp > sure
Todo:  Should include "visibility status" in the mail to the Item's Author

[ Top ]
set  [line 229]

  boolean set( string $parname, mixed $parvalue, [boolean $make_null = false]  )

Set param value

Parameters:
string   $parname:  parameter name
mixed   $parvalue:  parameter value
boolean   $make_null:  true to set to NULL if empty value

API Tags:
Return:  true, if a value has been set; false if it has not changed


Redefinition of:
DataObject::set()
Set param value

[ Top ]
set_author_User  [line 257]

  void set_author_User( &$author_User  )

Set author User of this comment

Parameters:
   &$author_User: 


[ Top ]
set_Item  [line 246]

  void set_Item( Item &$Item  )

Set Item this comment relates to

Parameters:
Item   &$Item: 


[ Top ]
set_spam_karma  [line 269]

  void set_spam_karma( integer $spam_karma  )

Set the spam karma, as a number.

Parameters:
integer   $spam_karma:  Spam karma (-100 - 100)

API Tags:
Access:  protected


[ Top ]
spam_karma  [line 609]

  void spam_karma( [string $template = '%s%'], [string $template_unknown = NULL]  )

Template function: display spam karma of the comment (in percent)

"%s" gets replaced by the karma value

Parameters:
string   $template:  Template string to display, if we have a karma value
string   $template_unknown:  Template string to display, if we have no karma value (pre-Phoenix)


[ Top ]
status  [line 1268]

  void status( [string $format = 'htmlbody']  )

Template function: display status of comment

Statuses:

  • published
  • deprecated
  • protected
  • private
  • draft

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
time  [line 1165]

  void time( [string $format = ''], [boolean $useGM = false]  )

Template function: display time (datetime) of comment

Parameters:
string   $format:  date/time format: leave empty to use locale default time format
boolean   $useGM:  true if you want GMT


[ Top ]

Documentation generated on Sat, 06 Mar 2010 04:06:29 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).