b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 2.4) [ 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::$delete_cascades
DataObject::$delete_restrictions
DataObject::$ID

Inherited From DataObject

DataObject::DataObject()
Constructor
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::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::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.

[ 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).
integer   $author_ID   The ID of the author's user. NULL for anonymous visitors.
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).
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  
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   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   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_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_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
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 ]
integer   $author_ID [line 63]

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


[ 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 ]
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 ]
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 119]

  Comment Comment( [ $db_row = NULL]  )

Constructor

Parameters:
   $db_row: 


[ Top ]
anchor  [line 283]

  void anchor( )

Template function: display anchor for permalinks to refer to



[ Top ]
author  [line 353]

  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 430]

  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 405]

  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 495]

  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 ]
content  [line 944]

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

Template function: display content of comment

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


[ Top ]
date  [line 956]

  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 1314]

  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 1272]

  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 1252]

  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 ]
delete_link  [line 591]

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

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
   $glue: 
   $save_context: 


[ Top ]
deprecate_link  [line 707]

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

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?


[ Top ]
edit_link  [line 545]

  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 201]

  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 274]

  string get_anchor( )

Get the anchor-ID of the comment



[ Top ]
get_author_email  [line 312]

  string get_author_email( )

Get the EMail of the comment's author.



[ Top ]
get_author_name  [line 294]

  string get_author_name( )

Get the comment author's name.



[ Top ]
get_author_url  [line 330]

  string get_author_url( )

Get the URL of the comment's author.



[ Top ]
get_author_url_link  [line 454]

  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 166]

  User &get_author_User( )

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



[ Top ]
get_content  [line 926]

  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 663]

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

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?


[ Top ]
get_Item  [line 183]

  Item &get_Item( )

Get the Item this comment relates to



[ Top ]
get_permanent_link  [line 864]

  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 831]

  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 724]

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

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?


[ Top ]
msgform_link  [line 784]

  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 902]

  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 849]

  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 768]

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

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?


[ Top ]
rating  [line 983]

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

Template tag: display rating

Parameters:
   $params: 


[ Top ]
rating_input  [line 1016]

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

Rating input

Parameters:
   $params: 


[ Top ]
rating_none_input  [line 1048]

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

Rating reset input

Parameters:
   $params: 


[ Top ]
send_email_notifications  [line 1108]

  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 223]

  boolean set( string $parname, mixed $parvalue  )

Set param value

Parameters:
string   $parname:  parameter name
mixed   $parvalue:  parameter 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 251]

  void set_author_User( &$author_User  )

Set author User of this comment

Parameters:
   &$author_User: 


[ Top ]
set_Item  [line 240]

  void set_Item( Item &$Item  )

Set Item this comment relates to

Parameters:
Item   &$Item: 


[ Top ]
set_spam_karma  [line 263]

  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 515]

  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 1083]

  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 971]

  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 03:30:26 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).