Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Other BFA WordPress Themes »

Using "paged comments" in Atahualpa v. 2.21


 
Prev Previous Post   Next Post Next
  #1  
Old Dec 22, 2008, 12:59 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Using "paged comments" in Atahualpa v. 2.21

The plugin http://wordpress.org/extend/plugins/paged-comments/ enables paged comments for WP 2.6 and older. To use this plugin with Atahualpa 2.21 install the plugin as described in the plugin howto's and additionally save the following as comments-paged.php and put it into the /wp-content/themes/atahualpa/ or /wp-content/themes/atahualpa2/ (whatever its named on your installation) directory. Note: paged-comments.php (the plugin file) and comments-paged.php (the file below) are two different files with 2 different locations.



PHP Code:
<?php // Do not delete these lines
    
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments-paged.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 clearfix" ';
 
global 
$options;
foreach (
$options as $value) {
if (
get_option$value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option$value['id'] ); } }
?>
<!-- You can start editing below: -->
 
<?php // If there are any comments
if ($comments) : ?>
 
    <h3 id="comments"><?php // Comment Area Title 
    
comments_number('No Responses''One Response''% Responses' );?> to <?php the_title(); ?></h3>
 
    <!-- Comment page numbers -->
    <?php if ($paged_comments->pager->num_pages() > 1): ?>
    <p class="comment-page-numbers"><?php _e("Pages:"); ?> <?php paged_comments_print_pages(); ?></p>
    <?php endif; ?>
    <!-- End comment page numbers -->
 
    <!-- Comment List -->
    <ol class="commentlist">
 
 
        <?php         
        
// Do this for every comment -->
        
foreach ($comments as $comment) : 
        if ( (
$ata_separate_trackbacks == "Yes" AND get_comment_type() == 'comment') OR $ata_separate_trackbacks == "No" ) {
        
?>
 
        <li <?php if ( $ata_author_highlight == "Yes" AND $comment->comment_author_email == get_the_author_email() ) { echo 'class="authorcomment clearfix" '; } else { echo $oddcomment; } ?>id="comment-<?php comment_ID() ?>">
 
            <?php // GRAVATAR
            
if (get_comment_type() == 'comment') {
            if (
$ata_avatar_size != AND $ata_avatar_size != "") {
            if (
function_exists('get_avatar')) {
            echo 
get_avatar($comment -> comment_author_email$size=$ata_avatar_size);} 
            
# if this WP version has no gravatars, use the theme's custom gravatar function:
            
else { if(!empty($comment -> comment_author_email)) {
                
$md5 md5($comment -> comment_author_email);
                
$default urlencode(get_bloginfo('template_directory') . '/images/no-gravatar.gif');
                echo 
"<img class=\"avatar\" src='http://www.gravatar.com/avatar.php?gravatar_id=$md5&size=" $ata_avatar_size "&default=$default' alt='Gravatar' />";
                }
            }
            }
            }
            
?>
 
            <div class="comment-number"><a href="<?php echo paged_comments_url('comment-'.get_comment_ID()); ?>" title=""><?php echo $comment_number$comment_number += $comment_delta?></a></div>
 
            <span class="authorname"><?php // Comment Author
            
comment_author_link() ?></span>
 
            <?php // Awaiting Moderation Text
            
if ($comment->comment_approved == '0') : ?>
            Your comment is awaiting moderation.
            <?php endif; ?>
 
            <br />
 
            <span class="commentdate">
            <?php // Comment Date and Time
            
comment_date('F jS, Y'?> at <?php comment_time() ?>
            </span>
 
            <?php // Comment Text
            
comment_text() ?>
 
            <?php // Edit Comment Link
            
edit_comment_link('edit','<span class="editcomment">','</span>'); ?>
 
 
        </li>
 
        <?php $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt clearfix" ' 'class="clearfix" '
 
        }
        endforeach; 
        
// END of "Do this for every comment "
        
?>
 
 
 
    </ol>
    <!-- / Comment List -->
 
    <!-- Comment page numbers -->
    <?php if ($paged_comments->pager->num_pages() > 1): ?>
    <p class="comment-page-numbers"><?php _e("Pages:"); ?> <?php paged_comments_print_pages(); ?></p>
    <?php endif; ?>
    <!-- End comment page numbers -->
 
<?php 
// END of "If there ARE any comments"
else : 
// START of "If there are NO comments" 
?>
 
    <?php 
    
// If comments are open, but there are no comments:
    
if ('open' == $post->comment_status) : 
    
?>
        <!-- .... -->
 
    <?php 
    
// END of "If comments are open, but there are no comments"
    
else : 
    
// If comments are closed:
    
?>
        <p>Comments are closed.</p>
    <?php endif; ?>
 
<?php 
// END of "If there are NO comments"
endif; 
?>
 
<?php // If comments are open
if ('open' == $post->comment_status) : ?>
 
    <h3>Leave a Reply</h3>
 
    <?php // If Login is required and User is not logged in 
    
if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
 
    <?php // If Login is not required, or User is logged in 
    
else : ?>
 
        <!-- Comment Form -->
        <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
 
            <?php // If User is logged in
            
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 // If User is not logged in: Display the form fields "Name", "Email", "URL"
            
else : ?>
            <p>
            <input class="text author" type="text" name="author" id="author" value="<?php echo $comment_author?>" size="30" tabindex="1" />
            <label for="author">Name <?php if ($req) echo "(required)"?></label>
            </p>
            <p>
            <input class="text email" type="text" name="email" id="email" value="<?php echo $comment_author_email?>" size="30" tabindex="2" />
            <label for="email">Mail (will not be published) <?php if ($req) echo "(required)"?></label>
            </p>
            <p>
            <input class="text url" type="text" name="url" id="url" value="<?php echo $comment_author_url?>" size="30" tabindex="3" />
            <label for="url">Website</label>
            </p>
            <?php endif; ?>
 
        <!-- Display Quicktags or allowed XHTML Tags -->
        <?php if (function_exists('lmbbox_comment_quicktags_display')) { lmbbox_comment_quicktags_display(); } 
        else { 
?>
        <p><strong>XHTML:</strong> You can use these tags:</p>
        <p><code><?php echo allowed_tags(); ?></code></p>
        <?php ?>
 
        <!-- Comment Textarea -->
        <p><textarea name="comment" id="comment" rows="10" cols="20" tabindex="4"></textarea></p>
 
        <!-- Submit -->
        <p>
        <input name="submit" type="submit" class="button" 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>
        <!-- / Comment Form -->
 
    <?php endif; ?>
    <!-- / If Login is not required, or User is logged in -->
 
<?php endif; ?>
<!-- If comments are open -->
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting rid of the rel="nofollow" thing in articles (not comments), how? MarkusM. Installing & running WordPress 6 Apr 25, 2010 04:06 PM
[SOLVED] How to remove &quot;comments are closed&quot; from the end of posts wylde1der Post-Kicker, -Byline & -Footer 3 Dec 14, 2009 05:45 AM
Comments on "Page" pages bug ricky119 Comments, trackbacks & pings 6 Jul 22, 2009 04:39 PM
Spaces in the fields of "Post comments" form Lucker Comments, trackbacks & pings 1 May 25, 2009 12:38 PM
How to style "post icon" and "post comments" text Whatsthatcat? RSS, Feeds & Subscribing 3 Apr 1, 2009 09:41 AM


All times are GMT -6. The time now is 12:33 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.