Jump to content

Cre8asiteforums Internet Marketing
and Conversion Web Design


Wordpress Caution

  • Please log in to reply
2 replies to this topic

#1 AbleReach


    Peacekeeper Administrator

  • Hall Of Fame
  • 6471 posts

Posted 22 May 2011 - 03:43 PM

I was asked to configure a theme and ended up taking it apart and starting over again. It's an older theme, based on an unmaintained 3rd party plugin. Part of it were never hooked up and though I can make it work as-is, it kicks out an error in the control panel. Plus, it's php4 and php4 won't be supported when WP 3.2 comes out in a month or so.

I'm spending way too much time on it. :) And I'm learning. I'm using the open source javascript thingy he used to build my own theme

For some reason I was scanning through his code and found this, from the theme's comments.php. Look at the class for the first list item. An email address is inserted in a conditional statement. (I changed it to email@domain.com) If I'm right, this is as bad as it gets and it's harmless -- it just means that if someone with his email address makes a comment, the CSS will be different. This was a for-real email address associated with the theme author's for-real and above-the-board domain. He probably hacked the template for a personal blog, and forgot to take this part out when releasing the theme.

However, think of what could be accomplished with something as simple as an alternative bit of CSS. If comment_author_email is bigonesxxx@oops.com, use this css class that has a background image you really don't want to see...

Something to think about.

<!-- You can start editing here. -->
<?php if ($comments) : ?>
<h2 id="comments"><?php comments_number('No Replies', 'One Reply', '% Replies' );?></h2> 
	<ol class="commentlist">
	<?php foreach ($comments as $comment) : ?>
	<?php if (get_comment_type() == "comment"){ ?>
	<li class="<?php if ($comment->comment_author_email == "email@domain.com") echo 'author'; else echo $oddcomment; ?> item" id="comment-<?php comment_ID() ?>">
		<div class="commentMeta">
			<span class="author"><?php comment_author_link() ?></span>
			<span class="date"><a href="#comment-<?php comment_ID() ?>" title="Comment Permalink"><?php comment_date('M jS Y') ?></a></span>
			<span class="moderate"><?php edit_comment_link('Moderate','',''); ?></span>
				<?php if(function_exists('get_avatar')) { echo get_avatar($comment, '40'); } ?>

		<div class="commentText">
			<?php if ($comment->comment_approved == '0') : ?>
				<strong>Your comment is awaiting moderation.</strong>
			<?php endif; ?>
			<?php comment_text() ?>
		<div class="clearfix"></div>
	<?php } ?>
	<?php endforeach; /* end for each comment */ ?>
 	<?php else : // this is displayed if there are no comments so far ?>

	  <?php if ('open' == $post->comment_status) : ?> 
	<h2 id="comments"><?php comments_number('No Replies', 'One Reply', '% Replies' );?></h2>
	<p>Feel free to leave a reply using the form below!</p>
	 <?php else : // comments are closed ?>
		<p class="nocomments">Comments are closed.</p>
	<?php endif; ?>
<?php endif; ?>

#2 jonbey


    Eyes Like Hawk Moderator

  • Moderators
  • 4757 posts

Posted 22 May 2011 - 04:04 PM

yeah, seen that in some comments files (or similar). Some work on email, some on the id of the administrator / author etc. Probably some plugins to manage that these days. My comments appear different, cannot remember how now though!

#3 AbleReach


    Peacekeeper Administrator

  • Hall Of Fame
  • 6471 posts

Posted 22 May 2011 - 05:18 PM

Probably some plugins to manage that these days.

Not needed. WordPress can generate classes according to role. All you have to do is style the class.

I wouldn't be surprised if this example is left over from a much older version of WordPress, possibly older than the theme itself.

RSS Feed

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users