By Kornika on
I am using the user badges module and while I have that working correctly, what I would like to do is place my badge (currently a star) in a different place.
Right now it shows ...
Submitted by Username on 17 October 2006 - 6:17pm.
[image of star appears here]
What I would like is ...
Submitted by Username [image of star appears here] on 17 October 2006 - 6:17pm.
Though I would settle for ...
Submitted by Username on 17 October 2006 - 6:17pm. [image of star appears here]
With the star inline with the submitted by line.
I'm working with my node.tpl.php file and this is what I've got:
<div class="node<?php if ($sticky) { print " sticky"; } ?>">
<?php if ($page == 0) { ?><h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2><?php }; ?><div class="nodecontent"><?php if ($picture) { print $picture; }?>
<span class="taxonomy"><?php print $terms?></span>
<div class="submitted"><?php print $submitted?>
<?php if (module_exist('user_badges') ) { print user_badges_for_uid($uid); }?>
</div>
<div class="content"><?php print $content?></div>
<?php if ($links) { ?><div class="links">» <?php print $links?></div><?php }; ?>
</div>
</div>
Comments
A regex might do the trick here...
Hi!
You could try
Pete.
That works but ...
Not like I want it too ...
Now it displays as ...
Submitted by Kornika
[image of star]
on 16 October 2006 - 7:45pm.
On three separate lines.
Thanks for your response!
-Kornika
Almost there...
Hi, Kornika.
Could you post the generated HTML for the 'Submitted by' part of the page? On my pages, it looks like this (I don't have user_badges working as I use filemanager rather than the upload module, so can't test it) :-
It should be possible to fix the problem if we could see what's actually happening...
Looking at the module source, function theme_user_badge($badge) could be overridden if you're using a phptemplate-based theme, so that's another possibility...
Pete.
I've figured it out.
Pete-
Thanks for your input however, by lots (and lots) of trial and error I figured it out.
I'd post it here, but I really don't know what I did. I just kept tweaking the PHP until I got it.
Thanks anyway!
-Kornika
Half the battle...
...is remembering what you did ;-)
Pete.
badge in front of username
Hi - If I wanted the badge to appear in front of the username, with everything all in line, how would I do that? Thanks so much!
You're lucky...
I just installed user badges to test them out and they don't show up at all on my site.
Thanks,
David
EDIT - never mind, I totally forgot that you have to add code to the php of the site files to make the badges show up. I haven't done that yet.