Plugins & Hacks

Can I add a link to the comment's item in the admin area comment view?

Scenario:
"I know I can delete spam right away in admin area but I want to know which item is getting spam comments. It is especially hard to locate the item on which the comment is made if it is an old article and it is not obvious from the comment itself.

It would be really cool to have link to the item next to each comment in "Comments section" of admin area. I am just a user, don't know anything about programming but it shouldn't be very hard to get that link there."

Solution:
You will need to use a core hack (i.e. a modification of Nucleus' core files) to add a link to the item to which a comment belongs in the admin area.

Original forum thread (thanks, vinhboy!):
http://forum.nucleuscms.org/viewtopic.php?t=15152

Method:

  • Open the file admin.php located in /nucleus/libs/ and find this line of code:
    function listplug_table_commentlist($template, $type)
  • Immediately below that line, add the following line:
    global $CONF;
  • You should now have two lines of code like this:
    function listplug_table_commentlist($template, $type)
    global $CONF;
  • Next, find the following lines of code in the same admin.php file:
    echo '<td>';
    echo date("Y-m-d@H:i",$current->ctime);
    echo '';
  • Again, add the following lines directly below:
    echo "<a href='".$CONF['IndexURL']."index.php?itemid=$current->citem'>ITEM</a>";
    echo '';
  • Save your changes to admin.php and re-upload to your server. Log in to your admin area, click on the "Comments" link next to your blog and you should see a little link to the item next to each comment.
section: Plugins & Hacks | submitted by Leng on 2007.Feb.24 | 3151 views

item rate
This answer was not rated yet.

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10