Buy Now
Sign in

Moderation in the Frontpage

rgoncalves , April 08 2009
R
rgoncalves
At present the only possible moderation in the FrontPage is to unpublished already publish comments, but in my case I wanted to moderate all comments and thought that to go to the backend to do it is a waste of time.
In fact, in my opinion, this should came in built in as default
I’m not in favor of hacks but in this case there was no other alternative

I just downloaded the ChronoComments today, please see modified attached files

basically I modified the plugin file and 3 files in the component
I attached both original and modified files so you can see how I did it.

the end result is that if you are a user under the 'unpublish' rights you'll see all comments (published and unpublished). The unpublished one will have a [UNPUBLISH] tag and a publish bottom, so you will be able to do it all from the frontpage

Looking forward to ear your feedback
Attachments
plg_ChronoComments.zip
(8.21 KiB)
903 Downloads/Views
com_chronocomments.zip
(24.05 KiB)
947 Downloads/Views
admin
Hi rgoncalves,

Thank you very much for sharing this, I'm happy you solved this issue, I will add it to the next release, I was not active at the Comments forums in the past few days because I was very busy with major Chronoforms releases, now and after we are almost done from upgrading Chronoforms, I will move to ChronoComments and include all enhancements/fixes!

Regards,
Max
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
C
cruxe
This feature is great and one of most important when I look for a comment/guestbook system, because I don't want the person who moderate the messages to have access in backend and don't want the messages to be auto published.
But there is other function that misses from frontpage. That's the hability to delete/remove comments.
I think there should be some more options in parameters:
-Who can publish messages in frontend
-Who can reply to messages in frontend (I changed code so only moderator can post reply)
-Who can delete messages in frontend
-If no one have access to voting, voting system should not appear.

That is my sugestions
R
rgoncalves
I made a few changes more to the component (the same files once again) to add the following features:
* a new delete bt
* enabled ajax in both (un)publish and delete bts, so everything looks a lot nicer
* centralized the few new words that I had to include in my last changes and now to the language file
* optimization of the JRequests in the frontend component for better security against SQL injections

For the time being the permissions used for all these are the ‘unpublish’ rights. I don’t really want to start changing too much

Hope this is useful, and that they can be included in the next release so everyone can use them.
I attached the new files, with the original and older versions so the more curious ones can check where the changes were made.(you can use WinMerge to compare them)
Attachments
language.zip
(1.65 KiB)
979 Downloads/Views
plg_ChronoComments.zip
(12.56 KiB)
880 Downloads/Views
com_chronocomments.zip
(36.49 KiB)
921 Downloads/Views
C
cruxe
Nice work! Thank you!

Hope this features would be included in next release

Only one note: the files you posted don't have copyright notice...
S
samatt
Thanks guys, this is just what I was looking for 8)
B
bertmeelberg
This is exactly what I need, thanks for this modification.
Hope this will be part of the next update.
Regards, Bert
R
rgoncalves
Unfortunately the new version is taking too long to come out, so I would like to tell people about a minor extra thing they could be fixing.

File:
plugins/content/ChronoComments.php

Line:
14

Find:
function plgContentChronocomments( &$row, &$params, $page=0 )
{

Add the following line right after:
if (!$row->id) return true;


This error is only noticeable when debug is turned on, but don’t forget that it is always there making invalid calls to your database no matter if you have debug on or not.

Therefore I would recommend to update it.

I’m still waiting feedback from my post regarding this (http://www.chronoengine.com/forums.html?cont=posts&f=17&t=18192) but I believe it should also apply to the original chronocomments code.
M
Maxvn
Very nice hack, that's what i'm looking for. Thanks for sharing.

Do you have any demo version? so i can look at before i start hack for my website.
R
rgoncalves
unfortunately I do not have in any application that can be accessed from the internet, but I have this changes running for 1yr now and everything runs smoothly
R
rgoncalves
One thing I noticed just recently is that chronocomments will always output code to your pages regardless if comments are enabled for the current article/section/category.
So I just added a very small code to avoid that 

File: /plugins/content/chronocomments.php
Line: 25 (aprox depends on teh version you are using)
Find:
$session =& JFactory::getSession();

Add bellow:
if((!in_array($row->sectionid, (array)$configs->get('comment_sections'))) && (!in_array($row->catid, (array)$configs->get('comment_categories'))) && (!in_array($row->id, (array)$configs->get('comment_articles'))))
{
  return true;
}