WordPress.org

Ready to get started?Download WordPress

Forums

Browser Detectiono Plug In Problem (1 post)

  1. ruhi
    Member
    Posted 6 years ago #

    Can anyone tell me where to insert

    < ?php pri_print_browser("Using ", "", true, 'on');?>' for the browser detection plug in to work?
    
    My comments.php looks like this:
    <div id="comments">
    <?php
    $req = get_settings('require_name_email'); // Checks if fields are required. Thanks, Adam. ;-)
    if ( 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) )
    die ( 'Please do not load this page directly. Thanks!' );
    if ( ! empty($post->post_password) ) :
    if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) :
    ?>
    <div class="nopassword"><?php _e('This post is password protected. Enter the password to view any comments.', 'sandbox') ?></div>
    </div><!-- .comments -->
    <?php
    return;
    endif;
    endif;
    ?>

    <?php if ( $comments ) : ?>
    <?php global $sandbox_comment_alt ?>

    <?php /* numbers of pings and comments */
    $ping_count = $comment_count = 0;
    foreach ( $comments as $comment )

    get_comment_type() == "comment" ? ++$comment_count : ++$ping_count;

    ?>
    <?php if ( $comment_count ) : ?>
    <?php $sandbox_comment_alt = 0 ?>

    <div id="comments-list" class="comments">
    <h3><?php printf(__($comment_count > 1 ? '<span>%d</span> Comments so far (Add 1 more)' : '<span>One</span> Comment', 'sandbox'), $comment_count) ?></h3>

      <?php $comments = array_reverse($comments, true); /* reverse comments */ ?>
      <?php foreach ($comments as $comment) : ?>

      <?php $i++; ?>

      <?php if ( get_comment_type() == "comment" ) : ?>

      <li id="comment-<?php comment_ID() ?>" class="<?php sandbox_comment_class() ?>">

      <div class="bubble">
      <div class="<?php if ($comment->comment_author_email == "author@mail.com") echo 'commenttext-admin'; else echo 'commenttext'; ?>">

      <?php comment_text() ?>

      </div><!-- end of commenttext-admin -->

      <cite>
      " title="Permalink to this comment"><?php echo $i; ?>. <?php comment_author_link() ?> on <?php comment_date('F jS, Y') ?> at <?php comment_time() ?> <?php edit_comment_link('edit','',''); ?>

      <?php if ($comment->comment_approved == '0') : ?>
      <p>Your comment is awaiting moderation.</p>
      <?php endif; ?>
      </cite>

      </div><!-- end of bubble -->

      <?php endif; /* if ( get_comment_type() == "comment" ) */ ?>
      <?php endforeach; ?>

    </div><!-- #comments-list .comments -->

    <?php endif; /* if ( $comment_count ) */ ?>
    <?php if ( $ping_count ) : ?>
    <?php $sandbox_comment_alt = 0 ?>

    <div id="trackbacks-list" class="comments">
    <h3><?php printf(__($ping_count > 1 ? '<span>%d</span> Trackbacks' : '<span>One</span> Trackback', 'sandbox'), $ping_count) ?></h3>

      <?php foreach ( $comments as $comment ) : ?>
      <?php if ( get_comment_type() != "comment" ) : ?>

      <li id="comment-<?php comment_ID() ?>" class="<?php sandbox_comment_class() ?>">
      <div class="comment-author"><?php printf(__('By %1$s on %2$s at %3$s', 'sandbox'),
      get_comment_author_link(),
      get_comment_date(),
      get_comment_time() );
      edit_comment_link(__('Edit', 'sandbox'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?></div>
      <?php if ($comment->comment_approved == '0') _e('\t\t\t\t\t<span class="unapproved">Your trackback is awaiting moderation.</span>\n', 'sandbox') ?>
      <?php comment_text() ?>

      <?php endif /* if ( get_comment_type() != "comment" ) */ ?>
      <?php endforeach; ?>

    </div><!-- #trackbacks-list .comments -->

    <?php endif /* if ( $ping_count ) */ ?>
    <?php endif /* if ( $comments ) */ ?>
    <?php if ( 'open' == $post->comment_status ) : ?>

    <div id="respond">

    <h3>
    <?php if ( ($comment_author != "") && (!$user_ID) ) { ?>
    Welcome back, want to share something <?php echo $comment_author; ?>?
    <?php } else { ?>
    Post a Comment
    <?php } ?>
    </h3>

    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p id="login-req"><?php printf(__('You must be logged in to post a comment.', 'sandbox'),
    get_option('siteurl') . '/wp-login.php?redirect_to=' . get_permalink() ) ?></p>

    <?php else : ?>
    <div class="formcontainer">
    <form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">

    <?php if ( $user_ID ) : ?>
    <p id="login"><?php printf(__('<span class="loggedin">Logged in as %2$s.</span> <span class="logout">Log out?</span>', 'sandbox'),
    get_option('siteurl') . '/wp-admin/profile.php',
    wp_specialchars($user_identity, true),
    get_option('siteurl') . '/wp-login.php?action=logout&redirect_to=' . get_permalink() ) ?></p>

    <?php else : ?>

    <p id="comment-notes"><?php _e('Your email is never published nor shared.', 'sandbox') ?> <?php if ($req) _e('Required fields are marked <span class="required">*</span>', 'sandbox') ?></p>

    <div class="form-label"><label for="author"><?php _e('Name', 'sandbox') ?></label> <?php if ($req) _e('<span class="required">*</span>', 'sandbox') ?></div>
    <div class="form-input"><input id="author" name="author" type="text" value="<?php echo $comment_author ?>" size="30" maxlength="20" tabindex="3" /></div>

    <div class="form-label"><label for="email"><?php _e('Email', 'sandbox') ?></label> <?php if ($req) _e('<span class="required">*</span>', 'sandbox') ?></div>
    <div class="form-input"><input id="email" name="email" type="text" value="<?php echo $comment_author_email ?>" size="30" maxlength="50" tabindex="4" /></div>

    <div class="form-label"><label for="url"><?php _e('Website', 'sandbox') ?></label></div>
    <div class="form-input"><input id="url" name="url" type="text" value="<?php echo $comment_author_url ?>" size="30" maxlength="50" tabindex="5" /></div>

    <?php endif /* if ( $user_ID ) */ ?>

    <div class="form-label"><label for="comment"><?php _e('Comment', 'sandbox') ?></label></div>
    <div class="form-textarea"><textarea id="comment" name="comment" cols="45" rows="8" tabindex="6"></textarea></div>

    <div class="form-submit"><input id="submit" name="submit" type="submit" value="<?php _e('Post Comment', 'sandbox') ?>" tabindex="7" /><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></div>
    <?php do_action('comment_form', $post->ID); ?>

    </form><!-- #commentform -->
    </div><!-- .formcontainer -->
    <?php endif /* if ( get_option('comment_registration') && !$user_ID ) */ ?>

    </div><!-- #respond -->
    <?php endif /* if ( 'open' == $post->comment_status ) */ ?>

    </div><!-- #comments -->
    `

    Sorry...I don't know what's the loop here; I've just newly started my blog here and am still learning. :) Thanks for your help!

Topic Closed

This topic has been closed to new replies.

About this Topic