ZenphotoCMS 1.6.2

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

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>

        
On this page

Search results