CodeIgniter Forums
Moderated comments handling in codeigniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Moderated comments handling in codeigniter (/showthread.php?tid=16521)



Moderated comments handling in codeigniter - El Forum - 03-09-2009

[eluser]Unknown[/eluser]
Hi, I am new to codeigniter and need to add moderated comments per page on a site I am developing. Is there any plugin to make it easy to provide moderated comments in codeigniter?

Any help or pointers on best practices regarding this will be appreciated.

Thanks,


Moderated comments handling in codeigniter - El Forum - 03-09-2009

[eluser]pistolPete[/eluser]
There is probably no "plugin" for that task, but it's easy to implement.
Add a column "hidden" (ENUM: yes, no; default: yes) to your comments table; a new comment is then saved with hidden="yes".
On the public pages, only display comments where hidden="no".
In your admin area add a controller / method to change the value of the hidden column from "yes" to "no" to approve the comments.


Moderated comments handling in codeigniter - El Forum - 03-09-2009

[eluser]xwero[/eluser]
Just add a temporary field to your comments database table. If the value is 1 the comment needs moderation. If the comment is approved set the field to 0, if it isn't delete the comment.


Moderated comments handling in codeigniter - El Forum - 03-09-2009

[eluser]xwero[/eluser]
to show the comment for the user that added it, use a cookie with a hash to identify the comment from that user.


Moderated comments handling in codeigniter - El Forum - 03-09-2009

[eluser]Unknown[/eluser]
pistolPete and xwero, Thanks a lot for quick reply.