Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help! I can't respond to comments
Old 08-19-2007, 03:36 PM Help! I can't respond to comments
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
After I spent hours working on my site's new (wordpress) theme this seems to be the only trouble I've been having. No registered members or administrators (me) can post a comment (under there name).

Here is the comments.php code, if the error lies within it:
Code:
<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
 die ('Please do not load this page directly. Thanks!');
 
 
       if (!empty($post->post_password)) { // if there's a password
        if (is_user_logged_in())   if ($_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) {  // and it doesn't match the cookie
   ?>
 
 
    <p class="nocomments"><?php _e("This post is password protected. Enter the password to view comments."); ?><p>
 
    <?php
   return;
           }
       }
 
 
 /* This variable is for alternating comment background */
 $oddcomment = "graybox";
?>
 
 
 
 
<?php if ($comments) : ?>
 <a name="comments"></a><h2><?php comments_number('No Responses','One Response','% Responses' );?></h2>
 
 
 <ol class="commentlist">
 
 
 <?php foreach ($comments as $comment) : ?>
 
 
  <li class="<?=$oddcomment;?>">
   <a name="comment-<?php comment_ID() ?>"></a><cite><?php comment_author_link() ?></cite> Says:<br />
   <!--<small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title="<?php comment_date('l, F jS, Y') ?> at <?php comment_time() ?>"><?php /* $entry_datetime = abs(strtotime($post->post_date)); $comment_datetime = abs(strtotime($comment->comment_date)); echo time_since($entry_datetime, $comment_datetime) */ ?></a> after publication. <?php edit_comment_link('e','',''); ?></small>-->
   <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('e','',''); ?></small>
 
   <?php comment_text() ?>
 
  </li>
 
  <?php /* Changes every other comment to a different class */ 
  if("graybox" == $oddcomment) {$oddcomment="";}
  else { $oddcomment="graybox"; }
 ?>
 
 
 <?php endforeach; /* end for each comment */ ?>
 
 
 </ol>
 
 
 <?php else : // this is displayed if there are no comments so far ?>
 
 
  <?php if ('open' == $post-> comment_status) : ?>
  <!-- If comments are open, but there are no comments. -->
 
  <?php else : // comments are closed ?>
  <!-- If comments are closed. -->
  <p class="nocomments">Comments are closed.</p>
 
 <?php endif; ?>
<?php endif; ?>
 
 
 
 
<?php if ('open' == $post-> comment_status) : ?>
 
 
<a name="respond"></a><h2>Leave a Comment</h2>
<form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform" >
 
 
<p><label for="author"><small>Name</small></label><input type="text" name="author" id="author" class="styled" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>" /></p>
 
 
<p><label for="email"><small>Mail (will not be published)</small></label>
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /></p>
 
 
<p><label for="url"><small>Website</small></label><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
</p>
 
 
<small>Your comment</small>
<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" class="submit1" id="submit" tabindex="5" value="Submit Comment" /></p>
<p><small>You can use these tags: <?php echo allowed_tags(); ?></small></p>
 
 
<?php if ('none' != get_settings("comment_moderation")) { ?>
 <p><small><strong>Please note:</strong> Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.</small></p>
<?php } ?>
 
 
 
 
</form>
 
 
<?php // if you delete this the sky will fall on your head
endif; ?>
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
 
Register now for full access!
Old 08-19-2007, 11:51 PM Re: Help! I can't respond to comments
Junior Talker

Posts: 3
Trades: 0
i would suggest you go and look at the default theme, and see what is different with the php code, you might of deleted a line of php code and not relized.
powerspike is offline
Reply With Quote
View Public Profile
 
Old 08-20-2007, 01:31 PM Re: Help! I can't respond to comments
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
Thanks, but I looked at the default code and couldn't find the alteration, maybe some PHP experts could find it here is my Default comment.php code:

Code:
<?php // Do not delete these lines
 if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  die ('Please do not load this page directly. Thanks!');
 if (!empty($post->post_password)) { // if there's a password
  if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
   ?>
   <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
   <?php
   return;
  }
 }
 /* This variable is for alternating comment background */
 $oddcomment = 'class="alt" ';
?>
<!-- You can start editing here. -->
<?php if ($comments) : ?>
 <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3>
 <ol class="commentlist">
 <?php foreach ($comments as $comment) : ?>
  <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
   <cite><?php comment_author_link() ?></cite> Says:
   <?php if ($comment->comment_approved == '0') : ?>
   <em>Your comment is awaiting moderation.</em>
   <?php endif; ?>
   <br />
   <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?></small>
   <?php comment_text() ?>
  </li>
 <?php
  /* Changes every other comment to a different class */
  $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
 ?>
 <?php endforeach; /* end for each comment */ ?>
 </ol>
 <?php else : // this is displayed if there are no comments so far ?>
 <?php if ('open' == $post->comment_status) : ?>
  <!-- If comments are open, but there are no comments. -->
  <?php else : // comments are closed ?>
  <!-- If comments are closed. -->
  <p class="nocomments">Comments are closed.</p>
 <?php endif; ?>
<?php endif; ?>

<?php if ('open' == $post->comment_status) : ?>
<h3 id="respond">Leave a Reply</h3>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>
<?php else : ?>
<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small>Website</small></label></p>
<?php endif; ?>
<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Reply     « Reply to Help! I can't respond to comments
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24161 seconds with 12 queries