commentform
Table of Contents
Classes
- Comment
- Comment Class
- comment_form
Constants
- COMMENT_BODY_REQUIRED = 16
- COMMENT_DATACONFIRMATION = 64
- COMMENT_EMAIL_REQUIRED = 1
- COMMENT_MATHQUIZ = 256
- COMMENT_NAME_REQUIRED = 2
- COMMENT_SEND_EMAIL = 32
- COMMENT_TEXTQUIZ = 128
- COMMENT_WEB_REQUIRED = 4
- COMMENTS_PER_PAGE = \max(1, \getOption('comment_form_comments_per_page'))
- OFFSET_PATH = 1
- provides the Comments tab of admin
- USE_CAPTCHA = 8
Functions
- comment_form_PaginationJS() : mixed
- comment_form_visualEditor() : mixed
- comment_form_print10Most() : mixed
- Admin overview summary
- getCommentAddress() : array<string|int, mixed>
- Processes the post of an address
- getCommentErrors() : string
- Returns an error message if a comment posting was not accepted
- printCommentErrors() : mixed
- Tool to output an error message if a comment posting was not accepted
- comment_form_addComment() : object
- Generic comment adding routine. Called by album objects or image objects to add comments.
- commentFormUseCaptcha() : bool
- Use see if a captcha should be displayed
- comment_form_postcomment() : mixed
- checks if comments are allowed and then processes them if so
- comment_form_handle_comment() : null|bool
- Handles the POSTing of a comment
- getCommentAuthorName() : string
- Returns the comment author's name
- getCommentAuthorEmail() : string
- Returns the comment author's email
- getCommentAuthorSite() : string
- Returns the comment author's website
- getCommentAuthorLink() : mixed
- Prints a link to the author
- printCommentAuthorLink() : mixed
- Prints a link to the author
- getCommentDateTime() : string
- Returns a formatted date and time for the comment.
- getCommentBody() : string
- Returns the body of the current comment
- printEditCommentLink() : mixed
- Creates a link to the admin comment edit page for the current comment
- getLatestComments() : mixed
- Gets latest comments for images, albums, news and pages
- printLatestComments() : mixed
- Prints latest comments for images, albums, news and pages
- getCommentCount() : int
- Retuns the count of comments on the current image
- next_comment() : bool
- Iterate through comments; use the ZP_COMMENT context.
- getCommentStored() : array<string|int, mixed>
- Returns the data from the last comment posted
- commentReply() : string
- Takes a comment and makes the body of an email.
- commentsAllowed() : bool
- Returns true if all the right conditions are set to allow comments for the $type
- getComments() : array<string|int, mixed>
- Gets an array of comments for the current admin
- fetchComments() : array<string|int, mixed>
- Gets an array of comments for the current admin
- isCommentFormRequiredField() : bool
- Checks if a field is required
- getCommentFormRequiredFieldMark() : string
- Gets the star to mark required field names
- getCommentFormRequiredFieldAttr() : string
- Returns the required attribute if the field is required
- isCommentFormReadonlyField() : mixed
- Checks if the field should be set to readonly
- getCommentFormReadonlyFieldAttr() : string
- Gets the readonly attribute for disabled fields
- printCommentFormFieldAttributes() : mixed
- Prints the combined required and readonly attributes as needed
- getCommentformFormAutocompleteAttr() : string
- Returns the autocomplete attribute for the form depending if autocomplete is enabled
- getCommentformAutocompleteAttr() : string
- Gets the autocomplete attribute with the value passed if autocomplete is enabled Note that the value is not validated. See See e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for valid values and tokens
- printCommentformAutocompleteAttr() : mixed
- Prints the autocomplete attribute with the value passed if autocomplete is enabled Note that the value is not validated. See See e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for valid values and tokens
- getQuizFieldQuestion() : string|bool
- Gets the the question to a quiz field if the field is enabled and setup correctly
- printCommentForm() : mixed
- Prints a form for posting comments
Constants
COMMENT_BODY_REQUIRED
public
mixed
COMMENT_BODY_REQUIRED
= 16
COMMENT_DATACONFIRMATION
public
mixed
COMMENT_DATACONFIRMATION
= 64
COMMENT_EMAIL_REQUIRED
public
mixed
COMMENT_EMAIL_REQUIRED
= 1
COMMENT_MATHQUIZ
public
mixed
COMMENT_MATHQUIZ
= 256
COMMENT_NAME_REQUIRED
public
mixed
COMMENT_NAME_REQUIRED
= 2
COMMENT_SEND_EMAIL
public
mixed
COMMENT_SEND_EMAIL
= 32
COMMENT_TEXTQUIZ
public
mixed
COMMENT_TEXTQUIZ
= 128
COMMENT_WEB_REQUIRED
public
mixed
COMMENT_WEB_REQUIRED
= 4
COMMENTS_PER_PAGE
public
mixed
COMMENTS_PER_PAGE
= \max(1, \getOption('comment_form_comments_per_page'))
OFFSET_PATH
provides the Comments tab of admin
public
mixed
OFFSET_PATH
= 1
USE_CAPTCHA
public
mixed
USE_CAPTCHA
= 8
Functions
comment_form_PaginationJS()
comment_form_PaginationJS() : mixed
comment_form_visualEditor()
comment_form_visualEditor() : mixed
comment_form_print10Most()
Admin overview summary
comment_form_print10Most() : mixed
getCommentAddress()
Processes the post of an address
getCommentAddress(int $i) : array<string|int, mixed>
Parameters
- $i : int
-
sequence number of the comment
Return values
array<string|int, mixed>getCommentErrors()
Returns an error message if a comment posting was not accepted
getCommentErrors() : string
Return values
stringprintCommentErrors()
Tool to output an error message if a comment posting was not accepted
printCommentErrors() : mixed
comment_form_addComment()
Generic comment adding routine. Called by album objects or image objects to add comments.
comment_form_addComment(string $name, string $email, string $website, string $comment, string $code, string $code_ok, object $receiver, string $ip, bool $private, bool $anon, string $customdata[, bit $check = false ][, bool $dataconfirmation = null ][, string $textquiz_answer_user = '' ][, string $mathquiz_answer_user = '' ]) : object
Returns a comment object
Parameters
- $name : string
-
Comment author name
- $email : string
-
Comment author email
- $website : string
-
Comment author website
- $comment : string
-
body of the comment
- $code : string
-
CAPTCHA code entered
- $code_ok : string
-
CAPTCHA hash expected
- $receiver : object
-
the object (image or album) to which to post the comment
- $ip : string
-
the IP address of the comment poster
- $private : bool
-
set to true if the comment is for the admin only
- $anon : bool
-
set to true if the poster wishes to remain anonymous
- $customdata : string
- $check : bit = false
-
bitmask of which fields must be checked. If set overrides the options
- $dataconfirmation : bool = null
-
True if data privacy confirmation required
- $textquiz_answer_user : string = ''
- $mathquiz_answer_user : string = ''
Return values
objectcommentFormUseCaptcha()
Use see if a captcha should be displayed
commentFormUseCaptcha() : bool
Return values
boolcomment_form_postcomment()
checks if comments are allowed and then processes them if so
comment_form_postcomment(string $error) : mixed
Parameters
- $error : string
comment_form_handle_comment()
Handles the POSTing of a comment
comment_form_handle_comment() : null|bool
Return values
null|boolgetCommentAuthorName()
Returns the comment author's name
getCommentAuthorName() : string
Return values
stringgetCommentAuthorEmail()
Returns the comment author's email
getCommentAuthorEmail() : string
Return values
stringgetCommentAuthorSite()
Returns the comment author's website
getCommentAuthorSite() : string
Return values
stringgetCommentAuthorLink()
Prints a link to the author
getCommentAuthorLink([string $title = NULL ][, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
- $title : string = NULL
-
URL title tag
- $class : string = NULL
-
optional class tag
- $id : string = NULL
-
optional id tag
printCommentAuthorLink()
Prints a link to the author
printCommentAuthorLink([string $title = NULL ][, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
- $title : string = NULL
-
URL title tag
- $class : string = NULL
-
optional class tag
- $id : string = NULL
-
optional id tag
getCommentDateTime()
Returns a formatted date and time for the comment.
getCommentDateTime([string $format = NULL ]) : string
Uses the "date_format" option for the formatting unless a format string is passed.
Parameters
- $format : string = NULL
-
A datetime format, if using localized dates an ICU dateformat
Return values
stringgetCommentBody()
Returns the body of the current comment
getCommentBody() : string
Return values
stringprintEditCommentLink()
Creates a link to the admin comment edit page for the current comment
printEditCommentLink(string $text[, string $before = '' ][, string $after = '' ][, string $title = NULL ][, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
- $text : string
-
Link text
- $before : string = ''
-
text to go before the link
- $after : string = ''
-
text to go after the link
- $title : string = NULL
-
title text
- $class : string = NULL
-
optional css clasee
- $id : string = NULL
-
optional css id
getLatestComments()
Gets latest comments for images, albums, news and pages
getLatestComments(int $number[, string|array<string|int, mixed> $type = "all" ][, int $id = NULL ]) : mixed
Parameters
- $number : int
-
how many comments you want.
- $type : string|array<string|int, mixed> = "all"
-
"all" for all latest comments of all images, albums, news and pages an array of table items e.g. array('images','albums') for all images, albums, news and pages "image" for the lastest comments of one specific image "album" for the latest comments of one specific album "news" for the latest comments of one specific news article "page" for the latest comments of one specific Page
- $id : int = NULL
-
the record id of element to get the comments for if $type != "all"
printLatestComments()
Prints latest comments for images, albums, news and pages
printLatestComments(int $number[, int $shorten = '123' ][, string $type = "all" ][, int $item = NULL ][, string $ulid = 'showlatestcomments' ][, string $shortenindicator = '...' ]) : mixed
Parameters
- $number : int
-
how many comments you want.
- $shorten : int = '123'
-
how many characters you want to show in the excerpt.
- $type : string = "all"
-
"all" for all latest comments of all images, albums, news and pages an array of table items e.g. array('images','albums', 'news', 'pages') for all images, albums, news and pages "image" for the lastest comments of one specific image "album" for the latest comments of one specific album "news" for the latest comments of one specific news article "page" for the latest comments of one specific Page
- $item : int = NULL
-
the record id of element to get the comments for if $type != "all".
- $ulid : string = 'showlatestcomments'
-
id for the
- element.
- $shortenindicator : string = '...'
-
indicator to show that the string is truncated.
getCommentCount()
Retuns the count of comments on the current image
getCommentCount() : int
Return values
intnext_comment()
Iterate through comments; use the ZP_COMMENT context.
next_comment([bool $desc = false ]) : bool
Return true if there are more comments
Parameters
- $desc : bool = false
-
set true for desecnding order
Return values
boolgetCommentStored()
Returns the data from the last comment posted
getCommentStored([bool $numeric = false ]) : array<string|int, mixed>
Parameters
- $numeric : bool = false
-
Set to true for old themes to get 0->6 indices rather than descriptive ones
Return values
array<string|int, mixed>commentReply()
Takes a comment and makes the body of an email.
commentReply(obj $obj, string $author, string $fullcomment) : string
Parameters
- $obj : obj
-
Object of the item commented on
- $author : string
-
Comment author
- $fullcomment : string
-
The comment itself
Return values
stringcommentsAllowed()
Returns true if all the right conditions are set to allow comments for the $type
commentsAllowed(string $type) : bool
Parameters
- $type : string
-
Which comments
Return values
boolgetComments()
Gets an array of comments for the current admin
getComments(int $number) : array<string|int, mixed>
Parameters
- $number : int
-
how many comments desired
Tags
Return values
array<string|int, mixed>fetchComments()
Gets an array of comments for the current admin
fetchComments(int $number) : array<string|int, mixed>
Parameters
- $number : int
-
how many comments desired
Tags
Return values
array<string|int, mixed>isCommentFormRequiredField()
Checks if a field is required
isCommentFormRequiredField(string $option) : bool
Parameters
- $option : string
-
The field option name
Tags
Return values
boolgetCommentFormRequiredFieldMark()
Gets the star to mark required field names
getCommentFormRequiredFieldMark(string $option) : string
Parameters
- $option : string
-
The field option name
Tags
Return values
stringgetCommentFormRequiredFieldAttr()
Returns the required attribute if the field is required
getCommentFormRequiredFieldAttr(string $option) : string
Parameters
- $option : string
-
The field option name
Tags
Return values
stringisCommentFormReadonlyField()
Checks if the field should be set to readonly
isCommentFormReadonlyField(bool $disabled) : mixed
Parameters
- $disabled : bool
-
return bool
Tags
getCommentFormReadonlyFieldAttr()
Gets the readonly attribute for disabled fields
getCommentFormReadonlyFieldAttr(bool $disabled) : string
Parameters
- $disabled : bool
Tags
Return values
stringprintCommentFormFieldAttributes()
Prints the combined required and readonly attributes as needed
printCommentFormFieldAttributes(string $option, bool $disabled[, string $autocomplete_value = 'on' ]) : mixed
Parameters
- $option : string
-
The field option name
- $disabled : bool
- $autocomplete_value : string = 'on'
-
Default "on" if autocomplete is ebabled
Tags
getCommentformFormAutocompleteAttr()
Returns the autocomplete attribute for the form depending if autocomplete is enabled
getCommentformFormAutocompleteAttr() : string
Tags
Return values
stringgetCommentformAutocompleteAttr()
Gets the autocomplete attribute with the value passed if autocomplete is enabled Note that the value is not validated. See See e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for valid values and tokens
getCommentformAutocompleteAttr([string $value = "on" ][, bool $skip_off = false ]) : string
Parameters
- $value : string = "on"
-
Default "on" if autocomplete is ebabled
- $skip_off : bool = false
-
Set to true to skip returing autocomplete="off"
Tags
Return values
stringprintCommentformAutocompleteAttr()
Prints the autocomplete attribute with the value passed if autocomplete is enabled Note that the value is not validated. See See e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete for valid values and tokens
printCommentformAutocompleteAttr([string $value = "on" ][, bool $skip_off = false ]) : mixed
Parameters
- $value : string = "on"
-
Default "on" if autocomplete is ebabled
- $skip_off : bool = false
-
Set to true to skip printing autocomplete="off"
Tags
getQuizFieldQuestion()
Gets the the question to a quiz field if the field is enabled and setup correctly
getQuizFieldQuestion([string $which = '' ]) : string|bool
Parameters
- $which : string = ''
Tags
Return values
string|boolprintCommentForm()
Prints a form for posting comments
printCommentForm([bool $showcomments = true ][, string $addcommenttext = NULL ][, bool $addheader = true ][, string $comment_commententry_mod = '' ][, bool $desc_order = false ]) : mixed
Parameters
- $showcomments : bool = true
-
defaults to true for showing list of comments
- $addcommenttext : string = NULL
-
alternate text for "Add a comment:"
- $addheader : bool = true
-
set true to display comment count header
- $comment_commententry_mod : string = ''
-
use to add styles, classes to the comment form div
- $desc_order : bool = false
-
default false, set to true to change the comment order to descending ( = newst to oldest)