b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.9) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: Comment

Source Location: /blogs/inc/MODEL/comments/_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  
string   $author  
string   $author_email  
integer|NULL   $author_ID  
string   $author_IP  
string   $author_url  
User   $author_User   The comment's user, this is NULL for (anonymous) visitors (lazy-filled).
string   $content  
string   $date  
Item   $Item   The item (parent) of this Comment (lazy-filled).
integer   $item_ID  
integer   $spam_karma  
string   $status  
string   $type  

[ 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.
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   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 104]

[ Top ]
string   $author [line 76]

[ Top ]
string   $author_email [line 80]

[ Top ]
integer|NULL   $author_ID [line 64]

[ Top ]
string   $author_IP [line 88]

[ Top ]
string   $author_url [line 84]

[ Top ]
User   $author_User [line 60]

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

[ Top ]
string   $date [line 92]

[ Top ]
Item   $Item [line 48]

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

[ Top ]
integer   $spam_karma [line 100]

[ Top ]
string   $status [line 72]

[ Top ]
string   $type [line 68]

[ Top ]
Methods
Constructor Comment  [line 110]

  Comment Comment( [ $db_row = NULL]  )

Constructor

Parameters:
   $db_row: 


[ Top ]
anchor  [line 266]

  void anchor( )

Template function: display anchor for permalinks to refer to



[ Top ]
author  [line 336]

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

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

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

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

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

Template function: display content of comment

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


[ Top ]
date  [line 889]

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

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

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

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

  void delete_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [boolean $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


[ Top ]
deprecate_link  [line 632]

  void deprecate_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&'], [boolean $save_context = 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?


[ Top ]
edit_link  [line 486]

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

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


[ Top ]
get  [line 187]

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

  string get_anchor( )

Get the anchor-ID of the comment



[ Top ]
get_author_email  [line 295]

  string get_author_email( )

Get the EMail of the comment's author.



[ Top ]
get_author_name  [line 277]

  string get_author_name( )

Get the comment author's name.



[ Top ]
get_author_url  [line 313]

  string get_author_url( )

Get the URL of the comment's author.



[ Top ]
get_author_User  [line 151]

  User &get_author_User( )

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



[ Top ]
get_content  [line 858]

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

  void get_deprecate_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&'], [boolean $save_context = 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?


[ Top ]
get_Item  [line 168]

  Item &get_Item( )

Get the Item this comment relates to



[ Top ]
get_permanent_link  [line 805]

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

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


[ Top ]
get_permanent_url  [line 761]

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

Generate permalink to this comment.

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

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


[ Top ]
get_publish_link  [line 649]

  void get_publish_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&'], [boolean $save_context = 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?


[ Top ]
msgform_link  [line 711]

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

  void permanent_link( [string $text = '#'], [string $title = '#'], [string $class = '']  )

Displays a permalink link to the Comment

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

Parameters:
string   $text:  link text
string   $title:  link title
string   $class:  class name


[ Top ]
permanent_url  [line 790]

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

  void publish_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&'], [boolean $save_context = 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?


[ Top ]
send_email_notifications  [line 949]

  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:  cache message by locale like Item::send_email_notifications()
Todo:  Indicator in url to see where the user came from (&from=subnote ["subscription notification"]) - Problem: too long urls.
Todo:  "Beautify" like Item::send_email_notifications() ?
Todo:  Should include "visibility status" in the mail to the Item's Author

[ Top ]
set  [line 209]

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

  void set_author_User( &$author_User  )

Set author User of this comment

Parameters:
   &$author_User: 


[ Top ]
set_Item  [line 223]

  void set_Item( Item &$Item  )

Set Item this comment relates to

Parameters:
Item   &$Item: 


[ Top ]
set_spam_karma  [line 246]

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

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

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

  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 Tue, 18 Dec 2007 19:13:07 +0100 by phpDocumentor 1.4.0