Posts for 06th December 2010

To try and dissuade spam comments from FlatPress blogs it is worth adding a nofollow rel attribute to the web address associated with a comment.

To achieve this it is necessary to modify the comments.tpl file found in the root folder for the theme you currently have selected, i.e. fp-interface/themes/ramblingross/comments.tpl

Within the ordered list with an id of "comments" there is a single list item. This list item contains a link when the $url variable contains something. Modify this link to contain a rel="nofollow" attribute, e.g.

...

<strong class='comment-name'>
{* 
    using this tag combo, the name is displayed as a link only
    if user entered a URL.

    Syntax is quite intuitive:
    "if $url is not empty, show $name between a tags, 
    else default fallback on displaying plain $name"        
*}
{$url&#124;notempty:"<a rel=\"nofollow\" href=\"$url\" title=\"Permalink to $name's comment\">$name</a>"&#124;default:$name}
</strong>


...