Class: Comment
Source Location: /qp_inc/comments/model/_comment.class.php
Class Comment
Inherited Properties, Constants, and Methods
Property Summary
| User |
$author_User |
The comment's user, this is NULL for (anonymous) visitors (lazy-filled). |
| Item |
$Item |
The item (parent) of this Comment (lazy-filled). |
Method Summary
| 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_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_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_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 |
| boolean |
set() |
Set param value |
| void |
set_Item() |
Set Item this comment relates to |
| 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 |
Properties
The comment's user, this is NULL for (anonymous) visitors (lazy-filled).
API Tags:
The item (parent) of this Comment (lazy-filled).
API Tags:
Methods
Comment Comment(
[
$db_row = NULL]
)
|
|
Constructor
Parameters:
T-Tag: Display an anchor for permalinks to refer to
API Tags:
void author(
[
$params = array()]
)
|
|
T-Tag: Displays author of comment
Parameters:
API Tags:
void author_email(
[
$params = array()]
)
|
|
T-Tag: Display a link to comment author's provided email
'before' => '',
'after' => '',
'text' => '',
'make_link' => true,
), $params );
Parameters:
void author_ip(
[
$params = array()]
)
|
|
T-Tag: Display the comment's author's IP address
'before' => '',
'after' => '',
), $params );
Parameters:
boolean author_url(
[
$params = array()]
)
|
|
T-Tag: Display a link to the comment author's provided URL
Parameters:
API Tags:
void content(
[string
$format = 'htmlbody']
)
|
|
T-Tag: Display the contents of a comment
Parameters:
API Tags:
void date(
[
$params = array()]
)
|
|
T-Tag: Display the date (datetime) of a comment
'before' => '',
'after' => '',
'useGM' => false,
), $params );
Parameters:
Trigger event AfterCommentDelete after calling parent method.
API Tags:
Redefinition of:
- DataObject::dbdelete()
- Delete object from DB.
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.
Trigger event AfterCommentUpdate after calling parent method.
API Tags:
Redefinition of:
- DataObject::dbupdate()
- Update the DB based on previously recorded changes
void delete_link(
[
$params = array()]
)
|
|
T-Tag: Displays a link to delete a comment if user has proper rights
'before' => '',
'after' => ' ',
'text' => '#', // '#' = get_icon( 'delete', 'imgtag' ).' '.T_('Delete!')
'title' => T_('Delete this comment'),
'class' => '',
'button' => false,
'glue' => '&',
'save_context' => true,
), $params );
Parameters:
void deprecate_link(
[
$params = array()]
)
|
|
T-Tag: Display a link to deprecate a comment if user has edit rights
Parameters:
API Tags:
void edit_link(
[
$params = array()]
)
|
|
T-Tag: Display a link to edit a comment if user has edit rights
'before' => '',
'after' => ' ',
'title' => T_('Edit this comment'),
'class' => '',
'glue' => '&',
'save_context' => true,
), $params );
Parameters:
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
T-Tag: Return the comment's ID for an anchor
API Tags:
string get_author(
[
$params = array()]
)
|
|
T-Tag: Return the author of comment
'before_visitor' => '',
'after_visitor' => ' ['. T_('Visitor'). ']',
'before_user' => '',
'after_user' => ' ['. T_('Member'). ']',
'format' => 'htmlbody',
'make_link' => false,
), $params );
Parameters:
API Tags:
string get_author_email(
)
|
|
Get the EMail of the comment's author.
string get_author_name(
)
|
|
Get the comment author's name.
Get the URL of the comment's author.
void get_author_url_link(
[
$params = array()]
)
|
|
T-Tag: Return a link to comment author's provided URL
'before' => '',
'after' => '',
'text' => '',
'make_link' => true,
), $params );
Parameters:
API Tags:
Get the author User of the comment. This is NULL for anonymous visitors.
string get_content(
[string
$format = 'htmlbody']
)
|
|
T-Tag: Return the contents of a comment
Parameters:
API Tags:
void get_deprecate_link(
[
$params = array()]
)
|
|
T-Tag: Return a link to deprecate a comment if user has edit rights
'before' => '',
'after' => ' ',
'text' => get_icon( 'deprecate', 'imgtag' ). ' '. T_('Deprecate!'),
'title' => T_('Deprecate this comment!'),
'class' => '',
'glue' => '&',
'save_context' => true,
), $params );
Parameters:
API Tags:
Get the Item this comment relates to
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()
'text' => '#', // '#' = see below
'title' => T_('Permanent link to this comment'),
'class' => '',
'nofollow' => true,
), $params );
'text' => '#' = get_icon( 'permalink' ).T_('Permalink') 'text' => '#icon#' = get_icon( 'permalink' ) 'text' => '#text#' = T_('Permalink')
Parameters:
API Tags:
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()
void get_publish_link(
[
$params = array()]
)
|
|
T-Tag: Provide a link to publish a comment if user has edit rights
'before' => '',
'after' => ' ',
'text' => get_icon( 'publish', 'imgtag' ). ' '. T_('Publish!'),
'title' => T_('Publish this comment!'),
'class' => '',
'glue' => '&',
'save_context' => true,
), $params );
Parameters:
API Tags:
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) |
void msgform_link(
string
$form_url, [
$params = array()]
)
|
|
T-Tag: Displays a link to message form for this comment's author
'before' => '',
'after' => ' ',
'text' => '#', // '#' = get_icon( 'email', 'imgtag', array( 'class' => 'middle', 'title' => $params['title'] ) )
'title' => T_('Send email to comment author'),
'class' => '',
), $params );
Parameters:
|
string |
$form_url: |
url of the message form |
|
|
$params: |
|
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()
'before' => '',
'after' => ' ',
'text' => '#', // '#' = see below
'title' => T_('Permanent link to this comment'),
'class' => '',
'nofollow' => true,
), $params );
'text' => '#' = get_icon( 'permalink' ).T_('Permalink') 'text' => '#icon#' = get_icon( 'permalink' ) 'text' => '#text#' = T_('Permalink')
Parameters:
API Tags:
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 |
void publish_link(
[
$params = array()]
)
|
|
T-Tag: Display a link to publish a comment if user has edit rights
Parameters:
API Tags:
void rating(
[
$params = array()]
)
|
|
T-Tag: Display a comment's rating
'before' => '<div class="comment_rating">',
'after' => '</div>',
'star_class' => 'middle',
), $params );
Parameters:
void rating_input(
[
$params = array()]
)
|
|
T-Tag: Display options to rate a comment
'before' => '',
'after' => '',
'label_low' => T_('Poor'),
'label_high' => T_('Excellent'),
), $params );
Parameters:
void rating_none_input(
[
$params = array()]
)
|
|
T-Tag: Display option to reset a comment's rating
'before' => '',
'after' => '',
'label' => T_('No rating'),
), $params );
Parameters:
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 |
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
void set_author_User(
&$author_User
)
|
|
Set author User of this comment
Parameters:
void set_Item(
Item
&$Item
)
|
|
Set Item this comment relates to
Parameters:
void set_spam_karma(
integer
$spam_karma
)
|
|
Set the spam karma, as a number.
Parameters:
|
integer |
$spam_karma: |
Spam karma (-100 - 100) |
API Tags:
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) |
void status(
[string
$format = 'htmlbody']
)
|
|
Template function: display status of comment
Statuses: - published
- deprecated
- protected
- private
- draft
Parameters:
void time(
[
$params = array()]
)
|
|
T-Tag: Displays the time (datetime) of a comment
'before' => '',
'after' => '',
'useGM' => false,
), $params );
Parameters:
|
|