ZenphotoCMS 1.6.3

functions.php

Table of Contents

Constants

COMMENT_BODY_REQUIRED  = 16
COMMENT_DATACONFIRMATION  = 64
COMMENT_EMAIL_REQUIRED  = 1
COMMENT_NAME_REQUIRED  = 2
COMMENT_SEND_EMAIL  = 32
COMMENT_WEB_REQUIRED  = 4
COMMENTS_PER_PAGE  = \max(1, \getOption('comment_form_comments_per_page'))
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

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_NAME_REQUIRED

public mixed COMMENT_NAME_REQUIRED = 2

COMMENT_SEND_EMAIL

public mixed COMMENT_SEND_EMAIL = 32

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'))

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
string

printCommentErrors()

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 ]) : 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

Return values
object

commentFormUseCaptcha()

Use see if a captcha should be displayed

commentFormUseCaptcha() : bool
Return values
bool

comment_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|bool

getCommentAuthorName()

Returns the comment author's name

getCommentAuthorName() : string
Return values
string

getCommentAuthorEmail()

Returns the comment author's email

getCommentAuthorEmail() : string
Return values
string

getCommentAuthorSite()

Returns the comment author's website

getCommentAuthorSite() : string
Return values
string

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

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
string

getCommentBody()

Returns the body of the current comment

getCommentBody() : string
Return values
string

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 $type = "all" ][, int $id = NULL ]) : mixed
Parameters
$number : int

how many comments you want.

$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') 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
int

next_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
bool

getCommentStored()

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
string

commentsAllowed()

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
bool

getComments()

Gets an array of comments for the current admin

getComments(int $number) : array<string|int, mixed>
Parameters
$number : int

how many comments desired

Tags
since
1.6
  • Renamed from fetchComments()
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
deprecated
2.0
  • Use getComments() instead
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
since
1.6.3
Return values
bool

getCommentFormRequiredFieldMark()

Gets the star to mark required field names

getCommentFormRequiredFieldMark(string $option) : string
Parameters
$option : string

The field option name

Tags
since
1.6.3
Return values
string

getCommentFormRequiredFieldAttr()

Returns the required attribute if the field is required

getCommentFormRequiredFieldAttr(string $option) : string
Parameters
$option : string

The field option name

Tags
since
1.6.3
Return values
string

isCommentFormReadonlyField()

Checks if the field should be set to readonly

isCommentFormReadonlyField(bool $disabled) : mixed
Parameters
$disabled : bool

return bool

Tags
since
1.6.3

getCommentFormReadonlyFieldAttr()

Gets the readonly attribute for disabled fields

getCommentFormReadonlyFieldAttr(bool $disabled) : string
Parameters
$disabled : bool
Tags
since
1.6.3
Return values
string

printCommentFormFieldAttributes()

Prints the combined required and readonly attributes as needed

printCommentFormFieldAttributes(string $option, bool $disabled) : mixed
Parameters
$option : string

The field option name

$disabled : bool
Tags
since
1.6.3

getCommentformFormAutocompleteAttr()

Returns the autocomplete attribute for the form depending if autocomplete is enabled

getCommentformFormAutocompleteAttr() : string
Tags
since
1.6.3
Return values
string

getCommentformAutocompleteAttr()

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) : string
Parameters
$value : string
Tags
since
1.6.3
Return values
string

printCommentformAutocompleteAttr()

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) : mixed
Parameters
$value : string
Tags
since
1.6.3

        
On this page

Search results