Approve Link for Comments

One of the ‘last-straw’ ways to deal with spam in ExpressionEngine is enabling Comment Moderation, wherein each comment submitted to the site has to be approved by an administrator before appearing.  Admins are notified of new comments via email - and that email can contain a “Delete Comment” link using a built-in EE variable.  There is, however, no matching variable for “Approve Comment”.

 

This makes the process for approving a new comment harder than deleting - which just shouldn’t be the case.  We’re going to be positive here, right?

Turns out this is pretty easy to get around with the following code snippet.  This would go in your Admin Notification of Comments template which is found under: Admin ›  Specialty Templates ›  Email Notification Templates.

Approve?
PATH TO YOUR CP HERE?S=0&C=edit&M=change_status&comment_id={comment_id}&status=open 

or:

Approve?
http://www.yoursite.com/system/index.php?S=0&C=edit&M=change_status&comment_id={comment_id}&status=open 

When you or your Admin clicks the Approve link they will be taken to the EE Control Panel view of the list of comments for this particular entry.  The nice thing is if the “Approve” link was clicked by mistake the option to close or delete the comment is right there as well.

 

Category Navigation

<< Previous Entry   

 

Previous Comments

Picture of Erik Reagan

by Erik Reagan

Date: Tuesday, November 3rd, 2009
Comment: #1

Thanks for the tip Mike! I was wondering about this while planning out a current project and just hadn’t made it far enough to look into it. Now you’ve provided the answer (no surprise there).

The only downside is that you have to be logged in for this link to work. It would be nice if EE had a way of remembering what CP page was clicked to and redirected after a successful log in. As far as I know this does not occur by default. Any thoughts?

Thanks again! :)

Mike Boyink

by Mike Boyink (Author)

Date: Tuesday, November 3rd, 2009
Comment: #2

Set the site to use all cookies and stay logged in..;)

Not sure whether This Redirect After Login extension could be made to work.

Picture of Erik Reagan

by Erik Reagan

Date: Tuesday, November 3rd, 2009
Comment: #3

Haha I suppose staying logged in is one way to do it. Personally I prefer logging out of every session in every site I visit :)

That extension looks like it works from a member login form as opposed to the default CP login form which is where you get kicked if you don’t have access to the CP. It’s worth considering though so I’ll take a look.

Mike Boyink

by Mike Boyink (Author)

Date: Tuesday, November 3rd, 2009
Comment: #4

Eh - wait till you are old like me…the fewer times I need to login through the day the better…;)

Picture of Terry Evans

by Terry Evans

Date: Wednesday, November 25th, 2009
Comment: #5

Thanks for this great tip Mike.  Now here’s a good challenger for you: how can one do this via the front end?  Here’s my question in a bit more detail: http://expressionengine.com/forums/viewthread/98601/#670864

Picture of Carpets

by Carpets

Date: Tuesday, May 17th, 2011
Comment: #6

Thank you very much for great tips Mike Boyink

Add Your Comment

Commenting is not available in this channel entry.

Unless otherwise stated all content is © Michael Boyink of Train-ee.com & Boyink Interactive. Please don't steal - I've got kids to feed...

dy>