PDA

View Full Version : Username in New Forum Posts


Skivey
04-04-2012, 07:49 PM
New Forum Posts block shows the users avatar, but is there a way to make it show the usernames?

Thanks

Matt

kh99
04-04-2012, 08:15 PM
You could try editing the template block_newposts and adding {vb:raw post.username} where you want it.

Skivey
04-04-2012, 08:37 PM
ok im really trying, and not amazing at php or html.

<vb:if condition="$post['showavatar']">
<img width="30" title="" src="{vb:raw post.avatarurl}" alt=""/>
<vb:else />
<img width="30" title="" src="{vb:stylevar imgdir_misc}/unknown.gif" alt=""/>
</vb:if>
<vb:if condition="$post['userid']">
</a>
</vb:if>
{vb:raw post.username}
<br></br>
</div>
</vb:if>
</div>
<div class="smallavatartext widget_post_comment<vb:if condition="!$vboptions['avatarenabled']">_noavatar</vb:if>">

This is where I put it, and im moving it about but it seems to just overwrite everything..

--------------- Added 1333576260 at 1333576260 ---------------

dammit, ive broke the whole bloody thing now, and i didnt save a copy of it. Any way of reseting it back to what it should be?

kh99
04-04-2012, 10:36 PM
I'm not really big on the layout stuff myself, but this seems to work (The line in red added):

<vb:if condition="$vboptions['avatarenabled']">
<div class="cms_widget_post_useravatar widget_post_useravatar">
<vb:if condition="$post['userid']">
<a class="smallavatar comments_member_avatar_link" href="{vb:link member, {vb:raw post}}">
</vb:if>
<vb:if condition="$post['showavatar']">
<img width="30" title="" src="{vb:raw post.avatarurl}" alt=""/>
<vb:else />
<img width="30" title="" src="{vb:stylevar imgdir_misc}/unknown.gif" alt=""/>
</vb:if>
<br />{vb:raw post.username}
<vb:if condition="$post['userid']">
</a>
</vb:if>
</div>
</vb:if>



Which style were you editing? If if was not "MASTER STYLE" then you can fix your template by reverting it (Edit Templates, find it in the list and select it, then press "Revert"). If you did edit the MASTER STYLE, maybe chunk I posted above will fix it? Otherwise send me a PM.


Edit: One more thing - when you're working on it, you need to configure the block to have "Cache Time (in minutes)" of 0 or else you won't see your changes. When you have it like you want it then you can increase it if you want.

Skivey
04-05-2012, 04:28 PM
cache time is already done, it is what i want - but preferably i want it above the text to the right of the avatar.

http://www.rsclassics360.co.uk/community/forum.php

Thanks for helping though I really appreciate it

--------------- Added 1333648115 at 1333648115 ---------------

woohoo, ok i moved that down a bit and added some colour and boldness and boosh! :)

--------------- Added 1333648148 at 1333648148 ---------------

thanks for your help!!!