Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m using the following:

    <?php// Comment loop
    if ($comments):
    	foreach ($comments as $comment):
    	// Test if Comment Author == Post Author
    		if ($comment->user_id == $post->post_author):
    			$CommentAuthorIsPostAuthor = True;
    		else:
    			$CommentAuthorIsPostAuthor = False;
    		endif;
    
    	// NoFollow sucks, we need an "alt" tag
    		$AuthorName = $comment->comment_author;
    		$AuthorURL = $comment->comment_author_url;
    		if ( ($AuthorURL == '') || ($AuthorURL == 'https://') ):
    			$AuthorData = "Comment by $AuthorName";
    		else:
    			$AuthorData = "Comment by <a href='$AuthorURL' alt='URL for comment author $AuthorName'>$AuthorName</a>";
    		endif;
    ?>

    So this chunk of code does the following:

    1. Identify the author based on user id. This means you will only be identified as the author if are actually logged in. (keeping email high-jackers from being identified as the author erroneously).
    2. Allow for custom comment author links. In my case I’m adding an “alt” tag, and removing the “rel” tag.

    Kevin

    Thread Starter wyldwolf

    (@wyldwolf)

    Small update: The offending spam was inserted directly into my DB. So I guess I have a bigger issue I need to solve.

    Any suggestions?

    Thanks.

    Kevin

Viewing 2 replies - 1 through 2 (of 2 total)