phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Class: Comment

Source Location: /qp_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
mixed   $allow_msgform  
mixed   $author  
mixed   $author_email  
mixed   $author_IP  
mixed   $author_url  
User   $author_User   The comment's user, this is NULL for (anonymous) visitors (lazy-filled).
mixed   $author_user_ID  
mixed   $content  
mixed   $date  
Item   $Item   The item (parent) of this Comment (lazy-filled).
mixed   $item_ID  
mixed   $nofollow  
mixed   $spam_karma  
mixed   $status  
mixed   $type  

[ Top ]
Method Summary
Comment   Comment()   Constructor
void   anchor()   T-Tag: Display an anchor for permalinks to refer to
void   author()   T-Tag: Displays author of comment
void   author_email()   T-Tag: Display a link to comment author's provided email
void   author_ip()   T-Tag: Display the comment's author's IP address
boolean   author_url()   T-Tag: Display a link to the comment author's provided URL
void   content()   T-Tag: Display the contents of a comment
void   date()   T-Tag: Display the date (datetime) of a 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()   T-Tag: Displays a link to delete a comment if user has proper rights
void   deprecate_link()   T-Tag: Display a link to deprecate a comment if user has edit rights
void   edit_link()   T-Tag: Display a link to edit a comment if user has edit rights
mixed   get()   Get a member param by its name
string   get_anchor()   T-Tag: Return the comment's ID for an anchor
string   get_author()   T-Tag: Return the 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.
void   get_author_url_link()   T-Tag: Return a 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()   T-Tag: Return the contents of a comment
void   get_deprecate_link()   T-Tag: Return a link to deprecate a comment if user has edit rights
Item   &get_Item()   Get the Item this comment relates to
void   get_permanent_link()   T-tag: Returns a permalink link to the Comment
void   get_permanent_url()   Generate permalink to this comment.
void   get_publish_link()   T-Tag: Provide a 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()   T-Tag: Displays a link to message form for this comment's author
void   permanent_link()   T-tag: Displays a permalink link to the Comment
void   permanent_url()   Template function: display permalink to this comment
void   publish_link()   T-Tag: Display a link to publish a comment if user has edit rights
void   rating()   T-Tag: Display a comment's rating
void   rating_input()   T-Tag: Display options to rate a comment
void   rating_none_input()   T-Tag: Display option to reset a comment's rating
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()   T-Tag: Displays the time (datetime) of a comment

[ Top ]
Properties
mixed   $allow_msgform [line 65]

[ Top ]
mixed   $author [line 58]

[ Top ]
mixed   $author_email [line 59]

[ Top ]
mixed   $author_IP [line 61]

[ Top ]
mixed   $author_url [line 60]

[ Top ]
User   $author_User [line 52]

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 ]
mixed   $author_user_ID [line 55]

[ Top ]
mixed   $content [line 63]

[ Top ]
mixed   $date [line 62]

[ Top ]
Item   $Item [line 44]

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

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


[ Top ]
mixed   $item_ID [line 54]

[ Top ]
mixed   $nofollow [line 66]

[ Top ]
mixed   $spam_karma [line 64]

[ Top ]
mixed   $status [line 57]

[ Top ]
mixed   $type [line 56]

[ Top ]
Methods
Constructor Comment  [line 71]

  Comment Comment( [ $db_row = NULL]  )

Constructor

Parameters:
   $db_row: 


[ Top ]
anchor  [line 151]

  void anchor( )

T-Tag: Display an anchor for permalinks to refer to


API Tags:
Uses:  Comment::get_anchor()


[ Top ]
author  [line 162]

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

T-Tag: Displays author of comment

Parameters:
   $params: 

API Tags:
Uses:  Comment::get_author()


[ Top ]
author_email  [line 180]

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

T-Tag: Display a link to comment author's provided email

  1.  $params array_mergearray(
  2.    'before'    => '',
  3.    'after'     => '',
  4.    'text'      => '',
  5.    'make_link' => true,
  6.  )$params );

Parameters:
   $params: 


[ Top ]
author_ip  [line 219]

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

T-Tag: Display the comment's author's IP address

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => '',
  4.  )$params );

Parameters:
   $params: 


[ Top ]
author_url  [line 248]

  boolean author_url( [ $params = array()]  )

T-Tag: Display a link to the comment author's provided URL

Parameters:
   $params: 

API Tags:
Return:  true if URL has been displayed
Uses:  Comment::get_author_url_link()


[ Top ]
content  [line 266]

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

T-Tag: Display the contents of a comment

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

API Tags:
Uses:  Comment::get_content()


[ Top ]
date  [line 284]

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

T-Tag: Display the date (datetime) of a comment

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => '',
  4.    'format' => locale_datefmt(),
  5.    'useGM'  => false,
  6.  )$params );

Parameters:
   $params: 


[ Top ]
dbdelete  [line 305]

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

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

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

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

T-Tag: Displays a link to delete a comment if user has proper rights

  1.  $params array_mergearray(
  2.    'before'       => '',
  3.    'after'        => ' ',
  4.    'text'         => '#'// '#' = get_icon( 'delete', 'imgtag' ).' '.T_('Delete!')
  5.    'title'        => T_('Delete this comment'),
  6.    'class'        => '',
  7.    'button'       => false,
  8.    'glue'         => '&',
  9.    'save_context' => true,
  10.  )$params );

Parameters:
   $params: 


[ Top ]
deprecate_link  [line 481]

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

T-Tag: Display a link to deprecate a comment if user has edit rights

Parameters:
   $params: 

API Tags:
Uses:  Comment::get_deprecate_link()


[ Top ]
edit_link  [line 502]

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

T-Tag: Display a link to edit a comment if user has edit rights

  1.  $params array_mergearray(
  2.    'before'       => '',
  3.    'after'        => ' ',
  4.    'text'         => get_icon'edit' ).' '.T_('Edit...'),
  5.    'title'        => T_('Edit this comment'),
  6.    'class'        => '',
  7.    'glue'         => '&',
  8.    'save_context' => true,
  9.  )$params );

Parameters:
   $params: 


[ Top ]
get  [line 555]

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

  string get_anchor( )

T-Tag: Return the comment's ID for an anchor


API Tags:
Usedby:  Comment::anchor()


[ Top ]
get_author  [line 597]

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

T-Tag: Return the author of comment

  1.  $params array_mergearray(
  2.    'before_visitor' => '',
  3.    'after_visitor'  => ' ['.T_('Visitor').']',
  4.    'before_user'    => '',
  5.    'after_user'     => ' ['.T_('Member').']',
  6.    'format'         => 'htmlbody',
  7.    'make_link' => false,
  8.  )$params );

Parameters:
   $params: 

API Tags:
Usedby:  Comment::author()


[ Top ]
get_author_email  [line 658]

  string get_author_email( )

Get the EMail of the comment's author.



[ Top ]
get_author_name  [line 676]

  string get_author_name( )

Get the comment author's name.



[ Top ]
get_author_url  [line 694]

  string get_author_url( )

Get the URL of the comment's author.



[ Top ]
get_author_url_link  [line 719]

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

T-Tag: Return a link to comment author's provided URL

  1.  $params array_mergearray(
  2.    'before'    => '',
  3.    'after'     => '',
  4.    'text'      => '',
  5.    'make_link' => true,
  6.  )$params );

Parameters:
   $params: 

API Tags:
Usedby:  Comment::author_url()


[ Top ]
get_author_User  [line 117]

  User &get_author_User( )

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



[ Top ]
get_content  [line 765]

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

T-Tag: Return the contents of a comment

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

API Tags:
Usedby:  Comment::content()


[ Top ]
get_deprecate_link  [line 792]

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

T-Tag: Return a link to deprecate a comment if user has edit rights

  1.  $params array_mergearray(
  2.    'before'       => '',
  3.    'after'        => ' ',
  4.    'text'         => get_icon'deprecate''imgtag' ).' '.T_('Deprecate!'),
  5.    'title'        => T_('Deprecate this comment!'),
  6.    'class'        => '',
  7.    'glue'         => '&',
  8.    'save_context' => true,
  9.  )$params );

Parameters:
   $params: 

API Tags:
Usedby:  Comment::deprecate_link()


[ Top ]
get_Item  [line 134]

  Item &get_Item( )

Get the Item this comment relates to



[ Top ]
get_permanent_link  [line 851]

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

T-tag: Returns a permalink link to the Comment

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

  1.  $params array_mergearray(
  2.    'text'     => '#'// '#' = see below
  3.    'title'    => T_('Permanent link to this comment'),
  4.    'class'    => '',
  5.    'nofollow' => true,
  6.  )$params );

'text' => '#' = get_icon( 'permalink' ).T_('Permalink')
'text' => '#icon#' = get_icon( 'permalink' )
'text' => '#text#' = T_('Permalink')

Parameters:
   $params: 

API Tags:
Usedby:  Comment::permanent_link()


[ Top ]
get_permanent_url  [line 901]

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

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

T-Tag: Provide a link to publish a comment if user has edit rights

  1.  $params array_mergearray(
  2.    'before'       => '',
  3.    'after'        => ' ',
  4.    'text'         => get_icon'publish''imgtag' ).' '.T_('Publish!'),
  5.    'title'        => T_('Publish this comment!'),
  6.    'class'        => '',
  7.    'glue'         => '&',
  8.    'save_context' => true,
  9.  )$params );

Parameters:
   $params: 

API Tags:
Usedby:  Comment::publish_link()


[ Top ]
get_title  [line 978]

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

  void msgform_link( string $form_url, [ $params = array()]  )

T-Tag: Displays a link to message form for this comment's author

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => ' ',
  4.    'text'   => '#'// '#' = get_icon( 'email', 'imgtag', array( 'class' => 'middle', 'title' => $params['title'] ) )
  5.    'title'  => T_('Send email to comment author'),
  6.    'class'  => '',
  7.  )$params );

Parameters:
string   $form_url:  url of the message form
   $params: 


[ Top ]
permanent_link  [line 1093]

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

T-tag: Displays a permalink link to the Comment

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

  1.  $params array_mergearray(
  2.    'before'   => '',
  3.    'after'    => ' ',
  4.    'text'     => '#'// '#' = see below
  5.    'title'    => T_('Permanent link to this comment'),
  6.    'class'    => '',
  7.    'nofollow' => true,
  8.  )$params );

'text' => '#' = get_icon( 'permalink' ).T_('Permalink')
'text' => '#icon#' = get_icon( 'permalink' )
'text' => '#text#' = T_('Permalink')

Parameters:
   $params: 

API Tags:
Uses:  Comment::get_permanent_link()


[ Top ]
permanent_url  [line 1119]

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

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

T-Tag: Display a link to publish a comment if user has edit rights

Parameters:
   $params: 

API Tags:
Uses:  Comment::get_publish_link()


[ Top ]
rating  [line 1147]

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

T-Tag: Display a comment's rating

  1.  $params array_mergearray(
  2.    'before'     => '<div class="comment_rating">',
  3.    'after'      => '</div>',
  4.    'star_class' => 'middle',
  5.  )$params );

Parameters:
   $params: 


[ Top ]
rating_input  [line 1179]

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

T-Tag: Display options to rate a comment

  1.  $params array_mergearray(
  2.    'before'     => '',
  3.    'after'      => '',
  4.    'label_low'  => T_('Poor'),
  5.    'label_high' => T_('Excellent'),
  6.  )$params );

Parameters:
   $params: 


[ Top ]
rating_none_input  [line 1218]

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

T-Tag: Display option to reset a comment's rating

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => '',
  4.    'label'  => T_('No rating'),
  5.  )$params );

Parameters:
   $params: 


[ Top ]
send_email_notifications  [line 1249]

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

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

  void set_author_User( &$author_User  )

Set author User of this comment

Parameters:
   &$author_User: 


[ Top ]
set_Item  [line 1432]

  void set_Item( Item &$Item  )

Set Item this comment relates to

Parameters:
Item   &$Item: 


[ Top ]
set_spam_karma  [line 1473]

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

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

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

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

T-Tag: Displays the time (datetime) of a comment

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => '',
  4.    'format' => locale_datefmt(),
  5.    'useGM'  => false,
  6.  )$params );

Parameters:
   $params: 


[ Top ]