Source for file comment_review.php
Documentation is available at comment_review.php
* This is file implements the comments quick edit operations after mail notification.
require_once dirname(dirname(__FILE__
)).
'/conf/_config.php';
require_once dirname(dirname(__FILE__
)).
'/inc/_main.inc.php';
param('cmt_ID', 'integer', '' );
param('secret', 'string', '' );
$to_dashboard =
$admin_url.
'?ctrl=dashboard';
$to_comment_edit =
$admin_url.
'?ctrl=comments&action=edit&comment_ID='.
$cmt_ID;
$Messages->add( 'Requested comment does not exist!' );
// Check the secret paramater (This doubles as a CRUMB)
if( $secret !=
$posted_Comment->get('secret') )
{ // Invalid secret, no moderation allowed here, go to regular form with regular login requirements:
$antispam_url =
$admin_url.
'?ctrl=antispam&action=ban&keyword='.
$posted_Comment->author_url.
'&'.
url_crumb( 'antispam' );
// perform action if action is not null
$posted_Comment->set('status', 'published' );
$posted_Comment->dbupdate(); // Commit update to the DB
$Messages->add( T_('Comment has been published.'), 'success' );
$posted_Comment->set('status', 'deprecated' );
$posted_Comment->dbupdate(); // Commit update to the DB
$Messages->add( T_('Comment has been deprecated.'), 'success' );
$posted_Comment->dbdelete();
$Messages->add( T_('Comment has been deleted.'), 'success' );
$posted_Comment->set( 'author_url', null );
$posted_Comment->dbupdate(); // Commit update to the DB
$Messages->add( T_('Comment url has been deleted.'), 'success' );
// Redirect to the Antispam ban screen
// No action => display the form
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="
<?php locale_lang() ?>" lang="
<?php locale_lang() ?>">
<title>
<?php echo
' '.
T_('Comment review').
' '; ?></title>
<form method="post" name="review">
if ($secret ==
$posted_Comment->get('secret') &&
($secret !=
NULL) )
echo
'<input type="submit" name="actionArray[delete]"';
echo
' value="'.
T_('Delete').
'" title="'.
T_('Delete this comment').
'"/>';
if( $posted_Comment->status !=
'deprecated')
echo
'<input type="submit" name="actionArray[deprecate]"';
echo
' value="'.
T_('Deprecate').
'" title="'.
T_('Deprecate this comment').
'"/>';
if( $posted_Comment->status !=
'published' )
echo
'<input type="submit" name="actionArray[publish]"';
echo
' value="'.
T_('Publish').
'" title="'.
T_('Publish this comment').
'"/>';
if( $posted_Comment->author_url !=
null )
echo
'<input type="submit" name="actionArray[deleteurl]"';
echo
' value="'.
T_('Delete URL').
'" title="'.
T_('Delete comment URL').
'"/>';
echo
'<input type="submit" name="actionArray[antispamtool]"';
echo
' value="'.
T_('Antispam tool').
'" title="'.
T_('Antispam tool').
'"/>';
echo
'<input type="hidden" name="secret" value="'.
$secret.
'"';
echo
'<input type="hidden" name="cmt_ID" value="'.
$cmt_ID.
'"';
die( T_('Invalid link!') );
<legend>
<?php echo
T_('Posted comment')?></legend>
<span class="bDate">
<?php $posted_Comment->date(); ?></span>
<span class="bTime">
<?php $posted_Comment->time( 'H:i' ); ?></span>
$posted_Comment->author_url( '', ' · Url: <span class="bUrl">', '</span>' );
if( $posted_Comment->author_url !=
null )
echo
' '.
action_icon( T_('Delete comment url'), 'delete', regenerate_url( '', array( 'action=deleteurl', 'cmt_ID='.
$cmt_ID, 'secret='.
$secret ) ) ).
' ';
echo
' '.
action_icon( T_('Antispam tool'), 'ban', $antispam_url );
$posted_Comment->author_email( '', ' · Email: <span class="bEmail">', '</span>' );
$posted_Comment->author_ip( ' · IP: <span class="bIP">', '</span>' );
echo
' · <span class="bKarma">';
$posted_Comment->spam_karma( T_('Spam Karma').
': %s%', T_('No Spam Karma') );
<?php echo
$posted_Comment->get_title(); ?>
<?php $posted_Comment->rating(); ?>
<?php $posted_Comment->avatar(); ?>
<fieldset class="bCommentText">
<legend>
<?php echo
T_('Content')?></legend>
<?php $posted_Comment->content() ?>