Geeklog
[ class tree: Geeklog ] [ index: Geeklog ] [ all elements ]

Procedural File: lib-comment.php

Source Location: /system/lib-comment.php



Page Details:



Includes:

require_once($_CONF['path_system'].'lib-user.php') [line 45]
only needed for the USER_getPhoto function







CMT_approveModeration [line 1716]

string CMT_approveModeration( int $cid)

Moves comment from submission table to comments table



Tags:

return:  of story id
author:  Jared Wenerd, wenerd87 AT gmail DOT com
copyright:  Jared Wenerd 2008


Parameters

int   $cid   cid comment id
[ Top ]



CMT_commentBar [line 63]

string CMT_commentBar( string $sid, string $title, string $type, string $order, string $mode, [int $ccode = 0])

This function displays the comment control bar

Prints the control that allows the user to interact with Geeklog Comments




Tags:

return:  HTML Formated comment bar
see:  CMT_userComments()


Parameters

string   $sid   ID of item in question
string   $title   Title of item
string   $type   Type of item (i.e. article, photo, etc)
string   $order   Order that comments are displayed in
string   $mode   Mode (nested, flat, etc.)
int   $ccode   Comment code: -1=no comments, 0=allowed, 1=closed
[ Top ]



CMT_commentForm [line 745]

string CMT_commentForm( string $title, string $comment, string $sid, [int $pid = '0'], string $type, string $mode, string $postmode)

Displays the comment form



Tags:

return:  HTML for comment form


Parameters

string   $title   Title of comment
string   $comment   Text of comment
string   $sid   ID of object comment belongs to
int   $pid   ID of parent comment
string   $type   Type of object comment is posted to
string   $mode   Mode, e.g. 'preview'
string   $postmode   Indicates if comment is plain text or HTML
[ Top ]



CMT_deleteComment [line 1314]

string CMT_deleteComment( int $cid, string $sid, string $type)

Deletes a given comment

The function expects the calling function to check to make sure the requesting user has the correct permissions and that the comment exits for the specified $type and $sid.




Tags:

return:  0 indicates success, >0 identifies problem
author:  Vincent Furia, vinny01 AT users DOT sourceforge DOT net


Parameters

string   $type   article, or plugin identifier
string   $sid   id of object comment belongs to
int   $cid   Comment ID
[ Top ]



CMT_getComment [line 216]

string CMT_getComment( array &$comments, string $mode, string $type, string $order, [boolean $delete_option = false], [boolean $preview = false], [int $ccode = 0])

This function prints &$comments (db results set of comments) in comment format -For previews, &$comments is assumed to be an associative array containing data for a single comment.



Tags:

return:  HTML Formated Comment


Parameters

array   &$comments   Database result set of comments to be printed
string   $mode   'flat', 'threaded', etc
string   $type   Type of item (article, polls, etc.)
string   $order   How to order the comments 'ASC' or 'DESC'
boolean   $delete_option   if current user can delete comments
boolean   $preview   Preview display (for edit) or not
int   $ccode   Comment code: -1=no comments, 0=allowed, 1=closed
[ Top ]



CMT_handleEditSubmit [line 1514]

string CMT_handleEditSubmit( [string $mode = null])

Handles a comment edit submission



Tags:

return:  HTML (possibly a refresh)
author:  Jared Wenerd, wenerd87 AT gmail DOT com
copyright:  Jared Wenerd 2008


Parameters

string   $mode   whether to store edited comment in the queue
[ Top ]



CMT_prepareText [line 1596]

string CMT_prepareText( string $comment, string $postmode, string $type, [boolean $edit = false], [int $cid = null])

Filters comment text and appends necessary tags (sig and/or edit)



Tags:

return:  of comment text
author:  Jared Wenerd, wenerd87 AT gmail DOT com
copyright:  Jared Wenerd 2008


Parameters

string   $comment   comment text
string   $postmode   ('html', 'plaintext', ...)
string   $type   Type of item (article, polls, etc.)
boolean   $edit   if true append edit tag
int   $cid   commentid if editing comment (for proper sig)
[ Top ]



CMT_rebuildTree [line 1690]

int CMT_rebuildTree( string $sid, [int $pid = 0], [int $left = 0])

Rebuilds hierarchical data of comments after moderation using recursion.



Tags:

return:  id of right-hand successor
author:  Jared Wenerd, wenerd87 AT gmail DOT com
copyright:  Jared Wenerd 2008
see:  CMT_deleteComment()


Parameters

string   $sid   id of object comment belongs to
int   $pid   id of parent comment
int   $left   id of left-hand successor
[ Top ]



CMT_reportAbusiveComment [line 1365]

string CMT_reportAbusiveComment( string $cid, string $type)

Display form to report abusive comment.



Tags:

return:  HTML for the form (or error message)


Parameters

string   $cid   comment id
string   $type   type of comment ('article', 'polls', ...)
[ Top ]



CMT_saveComment [line 1049]

int CMT_saveComment( string $title, string $comment, string $sid, int $pid, string $type, string $postmode)

Save a comment



Tags:

return:  -1 == queued, 0 == comment saved, > 0 indicates error
author:  Vincent Furia, vinny01 AT users DOT sourceforge DOT net


Parameters

string   $title   Title of comment
string   $comment   Text of comment
string   $sid   ID of object receiving comment
int   $pid   ID of parent comment
string   $type   Type of comment this is (article, polls, etc)
string   $postmode   Indicates if text is HTML or plain text
[ Top ]



CMT_sendNotification [line 1235]

boolean CMT_sendNotification( $title $title, $comment $comment, $uid $uid, $username $username, $ipaddress $ipaddress, $type $type, $cid $cid)

Send an email notification for a new comment submission.



Tags:

return:  true if successfully sent, otherwise false


Parameters

$title   $title   string comment title
$comment   $comment   string text of the comment
$uid   $uid   int user id
$username   $username   string optional name of anonymous user
$ipaddress   $ipaddress   string poster's IP address
$type   $type   string type of comment ('article', 'polls', ...)
$cid   $cid   int comment id (or 0 when in submission queue)
[ Top ]



CMT_sendReplyNotification [line 1772]

void CMT_sendReplyNotification( array $A, [boolean $send_self = false])

Sends a notification of new comment reply



Tags:

author:  Jared Wenerd, wenerd87 AT gmail DOT com
copyright:  Jared Wenerd 2008


Parameters

array   $A   contains cid, uid, and deletekey
boolean   $send_self   send notification when replying to self?
[ Top ]



CMT_sendReport [line 1434]

string CMT_sendReport( string $cid, string $type)

Send report about abusive comment



Tags:

return:  Meta refresh or HTML for error message


Parameters

string   $cid   comment id
string   $type   type of comment ('article', 'polls', ...)
[ Top ]



CMT_updateCommentcodes [line 1654]

void CMT_updateCommentcodes( )

Disables comments for all stories where current time is past comment expire time and enables comments for certain number of most recent stories.



Tags:

author:  Jared Wenerd, wenerd87 AT gmail DOT com
copyright:  Jared Wenerd 2008


[ Top ]



CMT_userComments [line 577]

string CMT_userComments( string $sid, string $title, [string $type = 'article'], [string $order = ''], [string $mode = ''], [int $pid = 0], [int $page = 1], [boolean $cid = false], [boolean $delete_option = false], [int $ccode = 0])

This function displays the comments in a high level format.

Begins displaying user comments for an item




Tags:

return:  HTML Formated Comments
see:  CMT_commentBar()


Parameters

string   $sid   ID for item to show comments for
string   $title   Title of item
string   $type   Type of item (article, polls, etc.)
string   $order   How to order the comments 'ASC' or 'DESC'
string   $mode   comment mode (nested, flat, etc.)
int   $pid   id of parent comment
int   $page   page number of comments to display
boolean   $cid   true if $pid should be interpreted as a cid instead
boolean   $delete_option   if current user can delete comments
int   $ccode   Comment code: -1=no comments, 0=allowed, 1=closed
[ Top ]



Documentation generated on Fri, 12 Mar 2010 02:07:33 -0500 by phpDocumentor 1.4.3