I've installed the User Badges module and the badges do display on the profiles, but not next to posts in the forum etc.

Can you help me please.

Comments

tom-knox’s picture

Bump!

tom-knox’s picture

I've managed to get badges into the line under 'Submitted' on nodes + under signatures on comments. But they wont show on the forums

Im using:
Drupal core
Advanced forums
User Badges
Barron (theme)

Can anyone help?

michelle’s picture

It would help if you pasted the PHP code you're using to add the badges so we can see what's wrong with it.

Michelle

--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.

tom-knox’s picture

comment.tpl.php

<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' '. $status; print ' '. $zebra; ?>">
  
  <?php if ($picture) { print $picture; } ?>

  <?php if ($comment->new): ?>
    <span class="new"><?php print $new ?></span>
  <?php endif; ?>
  <h3 class="commen-title">
    <?php print $title; ?>
  </h3>

  <div class="submitted">
    <?php print $submitted ?>
  </div>

  <div class="content">
    <?php print $content ?>
    <?php if ($signature): ?>
      <div class="user-signature clear-block">
        <?php print $signature ?>
        <?php print user_badges_for_uid($comment->uid);	?>
      </div>
    <?php endif; ?>
  </div>

  <div class="links">
    <?php print $links; ?>
  </div>
</div>
application/x-httpd-php node.tpl.php
ASCII text

<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">

  <?php print $picture ?>
  <?php if ($page == 0) : ?>
    <h2 class="node-title">
       <a href="<?php print $node_url; ?>"><?php print $title; ?></a>
    </h2>
  <?php endif; ?>
    
  <span class="submitted">
    <?php print $submitted; ?>
    <?php print user_badges_for_uid($node->uid); ?>
  </span>
    
  <?php if ($taxonomy): ?>
    <div class="taxonomy">
      Tagged: <?php print $terms; ?>
    </div>
  <?php endif; ?>
    
  <div class="content">
    <?php print $content; ?>
  </div>
    
  <?php if ($links) : ?>
    <div class="nodeLinks">
      <?php print $links; ?>
    </div>
  <?php endif; ?>
  
</div>

The line of <?php print user_badges_for_uid($uid); ?> is used in both, with comment and node inside the round brackets respectively.

michelle’s picture

One thing I see in comments is that they will only print if there is a signature since it's in the same if test.

You used this same code in advf-forum-post.tpl.php as well?

Michelle

--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.