* @author: Robert Bienert ',
' … wird moderiert ',
$form);
}
// Vor dem Speichern eines neuen Kommentars
function hook_newComment($form) {
// Idee vom AkismetPlugin: neuer Typ 'inModeration':
$form['type'] = COMMENT_MOD_KEY;
// Session-ID zwischenspeichern fuer die Anzeige
$this->commSid = $form['sid'];
return $form;
}
// Kommentare in der Warteschlange werden nicht angezeigt.
function hook_showComment($comment, $data, $nr) {
if (COMMENT_MOD_KEY == $data['type']) {
++$this->nWaiting;
if ($this->commSid != $data['sid'])
return NULL;
$comment .= ' Dein Kommentar wird moderiert. Kommentar #' .
htmlspecialchars($_GET['allow']) .
' genehmigt.\n";
echo $comments->getError();
echo "
\n";
die();
}
$com = array();
while($c = $q->fetch())
$com[$c['reference']] = $c['count'];
return $com;
}
/* Biete in der Mail an den Admin einen Direktlink zum Genehmigen
* des Kommentars an.
*/
function hook_adminMail($mail, $blogentry, $id) {
$mail->appendText("\n\nKommentar genehmigen\n" .
JLOG_PATH .
'/admin/plugin.php?jplug=CommentModeration&allow=' .
$id);
return $mail;
}
/*
function hook_commentorMail($mail, $blog) {
if ($this->commSid)
$mail['nomail'] = TRUE;
return $mail;
}
*/
// Anzeige aller Kommentare im Admin-Center:
function hook_commentAdminList($comment, $data) {
global $l;
if (COMMENT_MOD_KEY == $data['type'])
return str_replace('/img/JLOG_edit.png\' alt=\'' .
$l['admin']['change'] . '\' />',
'/img/JLOG_edit.png\' alt=\'' .
$l['admin']['change'] .
'\' /> Genehmigen',
$comment);
return $comment;
}
function hook_adminContent($html) {
if (isset($_GET['allow'])) {
$id = mysql_real_escape_string($_GET['allow']);
$q = new Query('UPDATE ' . JLOG_DB_COMMENTS .
' SET type=\'\' WHERE id=\''. $id . '\'');
global $categories;
global $bbcode;
global $plugins;
include(JLOG_BASEPATH . 'scripts' .
DIRECTORY_SEPARATOR . 'update.php');
return '
Copyright © 2008, 2009 Robert Bienert, Jlog-Plugin CommentModeration
Mit diesem Plugin werden alle neuen Kommentare in die Moderation eingestellt und nicht angezeigt. Aus dem Admin-Center heraus können die Kommentare dann genehmigt oder gelöscht werden.
EOF; } }