[support] Automatically Approve Comment For Return Visitors
Steve Kessler
skessler at denverdataman.com
Mon Nov 23 17:41:27 UTC 2009
Sorry for the wrong email...eeek!
::embarrassed::
Thanks,
Steve
Steve Kessler
Denver DataMan
303-587-4428
Sign up for the Denver DataMan Free eNewsletter
-----Original Message-----
From: Steve Kessler [mailto:skessler at denverdataman.com]
Sent: Monday, November 23, 2009 10:41 AM
To: 'support at drupal.org'
Subject: RE: [support] Automatically Approve Comment For Return Visitors
OK, I hope to have the check from Treepople today.
Thanks,
Steve
Steve Kessler
Denver DataMan
303-587-4428
Sign up for the Denver DataMan Free eNewsletter
-----Original Message-----
From: Jamie Holly [mailto:hovercrafter at earthlink.net]
Sent: Monday, November 23, 2009 10:34 AM
To: support at drupal.org
Subject: Re: [support] Automatically Approve Comment For Return Visitors
I'm not sure if there is a module for this, but it would be really
simple to do in a small module:
function mymodule_comment(&$comment, $op) {
if ($op=='insert' && !$comment['uid']){ //only perform on operating
insert for new comments and if the user is anonymous
$has_published=db_result(db_query("SELECT cid FROM {comments}
WHERE status=%d AND mail='%s', COMMENT_NOT_PUBLISHED, $comment['mail']);
// query database for a previously approved comment by this email
if (!$has_published){
db_query("UPDATE {comments} SET status=%d WHERE
cid=%d",COMMENT_NOT_PUBLISHED,$comment['cid']); //set the current
comment to unpublished
$comment['status']=COMMENT_NOT_PUBLISHED; //return with a
status of not published so the user is notified that their comment is
awaiting approval
}
}
}
I would suggest adding an index on mail in the comments table (even
better - status,mail).
Jamie Holly
http://www.intoxination.net
http://www.hollyit.net
Steve Kessler wrote:
>
> Dear Drupal Community,
>
>
>
>
>
> I have a project that wants to be able to have return visitors put
> their email into comments and be authenticated for comment approval.
> The client does not want the user to need to create an account but if
> an account was created for the person in the Drupal system this would
> not be a problem.
>
>
>
> Evidently this is done with Wordpress and I am hoping someone can
> recommend a module or recipe for making this happen with Drupal.
>
>
>
> Thanks,
>
> Steve
>
>
>
> Steve Kessler
>
> *Denver DataMan *
>
> 303-587-4428
>
> Sign up for the Denver DataMan Free eNewsletter
> <http://www.denverdataman.com/content/enewsletter-signup>
>
>
>
--
[ Drupal support list | http://lists.drupal.org/ ]
More information about the support
mailing list