Drupal 6 - Remove Login or register to post comments from Anonymous and maintain CSS for Link List

  • Published by steve on 22 March 2013.

Sorry for the long title, but I was trying to get rid of these comment links for anonymous users to fight off spammers. I found the code below in several places but added the 'class' => 'links' so that my

links would show up horizontal as they should in my theme, without this they would appear as an un-ordered list.

This code in in template.php

function phptemplate_links($links, $attributes = array('class' => 'links')) {
global $user;
if (!$user->uid) {
unset($links['comment_forbidden']);
}
return theme_links($links, $attributes);
}