Jump to content

loyski

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

loyski's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Works like a charm!!!! I also edited the one in line 80. Thank you very much! Everything is fine now...
  2. The syntax error is stated as: Parse error: syntax error, unexpected T_ENDIF in /home/loy/public_html/wp-content/themes/loymeetsworld/comments.php on line 68
  3. Hello PHP geeks, especially Wordpress experts! I'm new to this forum. Can anyone pls help me solve this PHP error in my Wordpress blog: http://loymeetsworld.com/2008/06/18/this-blog-is-due-for-launch/ Here is the PHP code for the comments.php file: <?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 = 'alt'; ?> <!-- You can start editing here. --> <?php if ($comments) : ?> <?php /* Count the totals */ $numPingBacks = 0; $numComments = 0; /* Loop through comments to count these totals */ foreach ($comments as $comment) { if (get_comment_type() != "comment") { $numPingBacks++; } else { $numComments++; } } ?> <?php /* This is a loop for printing comments */ if ($numComments != 0) : ?> <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3> <ol class="commentlist"> <?php foreach ($comments as $comment) : ?> <?php if (get_comment_type() == "comment"){ ?> <li class="<?php if ( $comment->comment_author_email == get_the_author_email() ) echo 'authorcomment'; else echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>"> <?php if (function_exists('gravatar')) { ?><img src="<?php gravatar('X', '32', get_bloginfo('template_url')."/images/defaultgravatar.jpg"); ?>" alt="Gravatar Icon" class="gravatar" /><?php } ?> <cite><?php comment_author_link() ?></cite> Says: <br /> <small class="commentmetadata"><span class="date"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a></span> <span class="edit"><?php edit_comment_link('edit','',''); ?></span></small> <?php comment_text() ?> <?php if ($comment->comment_approved == '0') : ?> <em>Your comment is awaiting moderation.</em> <?php endif; ?> </li> <?php /* Changes every other comment to a different class */ if ('alt' == $oddcomment) $oddcomment = ''; else $oddcomment = 'alt'; ?> <?php endif; endforeach; ?> </ol> <?php endif; ?> <?php /* This is a loop for printing trackbacks if there are any */ if ($numPingBacks != 0) : ?> <h3><?php _e($numPingBacks); ?> Trackbacks/Pingbacks</h3> <ol class="pingslist"> <?php foreach ($comments as $comment) : ?> <?php if (get_comment_type() != "comment"){ ?> <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>"><?php comment_author_link() ?> - <span><?php comment_date('M jS, Y') ?> at <?php comment_time() ?></span></li> <?php /* Changes every other comment to a different class */ if ('alt' == $oddcomment) $oddcomment = ''; else $oddcomment = 'alt'; ?> <?php endif; endforeach; ?> </ol> <?php endif; ?> <?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. --> <h3>No Comments Yet</h3> <p>You can be the first to comment! Don't be afraid.</p> <?php else : // comments are closed ?> <!-- If comments are closed. --> <p class="info">Sorry, comments are closed at this time.</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" onsubmit="new Ajax.Updater({success: 'commentlist'}, '<?php bloginfo('stylesheet_directory') ?>/comments-ajax.php', {asynchronous: true, evalScripts: true, insertion: Insertion.Bottom, onComplete: function(request){complete(request)}, onFailure: function(request){failure(request)}, onLoading: function(request){loading()}, parameters: Form.serialize(this)}); return false;"> <?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="<?php _e('Log out of this account') ?>">Logout »</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) _e('(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) _e('(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> <?php if (function_exists('show_subscription_checkbox')) { show_subscription_checkbox(); } ?> <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit" /> <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 ?> Here is the code for the single.php file: <?php get_header(); ?> <div id="content" class="narrowcolumn"> <a name="main"></a> <?php if (function_exists('wp_ozh_wsa')) { ?> <!-- start Who Sees Ads? plugin code --> <div class="adsense"> <?php wp_ozh_wsa("468x60-top"); ?> </div> <!-- end Who Sees Ads? plugin code --> <?php } ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php include (TEMPLATEPATH . '/navigation.php'); ?> <div class="post"> <h2 id="post-<?php the_ID(); ?>"><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2> <div class="postinfo"><span class="posted">Stats: <?php if (function_exists('the_views')) { ?><?php the_views(); ?>, <?php } ?><a href="#comments"><?php comments_number('0','1','%'); ?> comments</a></span><br /><span class="tags">Tags: <?php the_tags(); ?></span> </div> <div class="entry"> <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?> <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?> <?php if (function_exists('sociable_html')) { print sociable_html(); } ?> <p class="postmetadata"> <small> This entry was posted by <?php the_author() ?> <?php /* This is commented, because it requires a little adjusting sometimes. You'll need to download this plugin, and follow the instructions: http://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */ /* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?> on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?> and is filed under <?php the_category(', ') ?>. You can follow any responses to this entry through the <?php comments_rss_link('RSS 2.0'); ?> feed. <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { // Both Comments and Pings are open ?> You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(display); ?>">trackback</a> from your own site. <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) { // Only Pings are Open ?> Responses are currently closed, but you can <a href="<?php trackback_url(display); ?> ">trackback</a> from your own site. <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) { // Comments are open, Pings are not ?> You can skip to the end and leave a response. Pinging is currently not allowed. <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) { // Neither Comments, nor Pings are open ?> Both comments and pings are currently closed. <?php } edit_post_link('Edit this entry.','',''); ?> </small> </p> <div class="navigation"> <div class="alignleft"><?php previous_post('%','','yes') ?></div> <div class="alignright"><?php next_post('%','','yes') ?></div> </div> <?php if (function_exists('similar_posts')) { ?> <h3>Related Entries</h3> <?php similar_posts(); ?> <?php } ?> </div> </div> <?php comments_template(); ?> <?php endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?> Any help would be greatly appreciated. I would like to get this blog up and running but this error is hindering my efforts. As a reward I'll write a post about this...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.