Update of /cvsroot/comoblog/modules/mod_comment_notify
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv24684/mod_comment_notify
Modified Files:
mod_comment_notify_comment_filter.php
Added Files:
quickcomment.php
Log Message:
Extended to approve or bar users from making live comments to comoblog
--- NEW FILE: quickcomment.php ---
<?php
require_once(dirname(__FILE__).'/include/mod_comment_notify.inc.php');
require_once(dirname(__FILE__).'../../include/config.inc.php');
/* we have four vars
$_GET['setLive'] -> the state to set the comment to
$_GET['qp'] -> the quick password so that we know its valid
$_GET['preAuth'] -> preauth or prebar this user
$_GET['comment_id'] -> which comment id.
*/
/*
first off check the password - if thats wrong or empty or not passed,
then get out of dodge - but dont say anything so that naughty people wont know
that its failed (of course they're bound to have read this comment any way so its
pretty futile ;-(
*/
if (!$_GET['qp'] || $_GET['qp']=="" || $_GET['qp'] != CFG_COMMENTS_QUICK_PASS ){
exit;
}
/*
*
*work out who we are going to be dealing with.
we dont use the email address in the link as there will be encoding issues,
plus we're using a get request which means the email would be in the log files
which may appear else where on the site'
*/
$commenter_author_email = get_email_address_for_this_comment($_GET['comment_id']);
if ($_GET['setLive'] && $_GET['setLive']!="" ){
$retval = set_comment_state($_GET['setLive']);
echo "Comment set to " . $_GET['setLive'] ."\n";
}
if ($_GET['preAuth'] && $_GET['preAuth']!="" ){
$retval = set_commenter_approval_state($commenter_author_email,$_GET['preAuth']);
echo "commenter preauth was set to " . $_GET['preAuth'] ."\n";
}
?>
Index: mod_comment_notify_comment_filter.php
===================================================================
RCS file: /cvsroot/comoblog/modules/mod_comment_notify/mod_comment_notify_comment_filter.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mod_comment_notify_comment_filter.php 16 Dec 2005 00:57:25 -0000 1.7
+++ mod_comment_notify_comment_filter.php 15 Aug 2006 17:06:04 -0000 1.8
@@ -7,7 +7,36 @@
$body .= "Post ID:" . $comment['post_id'] ."\n";
$body .= "Link: " .CFG_SITE_URL. "post.php?/". $comment['post_id'] ."\n";
$body .= "From: " . $comment['comment_author'] . " - " . $comment['comment_author_email'] ."\n";
+$body .="\n\n";
+$body .="This comment was added with a state of " . $comment['comment_live'] ."\n";
+$body .="This commenters pre approved state is " . get_commenter_approval_state($comment['comment_author_email']) ."\n";
+
+
+
+// if the comment is LIVE - give option to hide it.
+if ($comment['comment_live'] =="Y"){
+ $body .="Click here to HIDE this comment " .
+ CFG_SITE_URL. "/modules/mod_comment_notify/quickcomment.php?qp=CFG_COMMENTS_QUICK_PASS&setLive=N&comment_id=".$comment['comment_id']."\n";
+ }
+
+ // if the comment is NOT LIVE - give option to hide it.
+if ($comment['comment_live'] =="N"){
+ $body .="Click here to SHOW this comment " .
+ CFG_SITE_URL. "/modules/mod_comment_notify/quickcomment.php?qp=CFG_COMMENTS_QUICK_PASS&setLive=Y&comment_id=".$comment['comment_id']."\n";
+ }
+
+ $body .="Click here to HIDE this AND ALL FUTURE comments from this commenters " .
+ CFG_SITE_URL. "/modules/mod_comment_notify/quickcomment.php?qp=CFG_COMMENTS_QUICK_PASS&setLive=N&preAuth=N&comment_id=".$comment['comment_id']."\n";
+
+
+ $body .="Click here to SHOW this AND ALL FUTURE comments from this commenters " .
+ CFG_SITE_URL. "/modules/mod_comment_notify/quickcomment.php?qp=CFG_COMMENTS_QUICK_PASS&setLive=Y&preAuth=Y&comment_id=".$comment['comment_id']."\n";
+
+$body .="\n\nFor Clarity - This will not affect comments posted before these links are clicked,\n\n";
+
+$body .="\n\n\n";
$body .= "Comment:\n\n" . filter_html($comment['comment_text']) ."\n";
+$body .="\n\n\n";
$headerstring = "MIME-Version: 1.0\r\n".
|