1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

If thread X show X aswell as userID/name variable

Discussion in 'Styling and Customization Questions' started by Nudaii, Mar 25, 2012.

  1. Nudaii

    Nudaii Well-Known Member

    When I was on vBulletin I used to have a conditional to show certain avatar in a certain thread


    If thread x show

    <img src=/userid_variable/thread_id.png>

    Which if the posters id was 80 and thread id 256

    It would look like below

    <img src=/80/256.png>

    the site in questions is a private very small group writers project (2 writers) it was so the avatars could match the stories they were writing

    What I need isthe variables needed for threadid, forumid and post userid

    Thanks in advance for your help :)
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> message_user_info

    Add the red code:

    	<xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
    		<div class="avatarHolder">
    			<span class="helper"></span>
    			<xen:if is="{$thread.thread_id} == 1 AND {$user.user_id} == 2">
    				<a href="{xen:link members, $user}" class="avatar Av{$user.user_id}m" data-avatarHtml="true"><span class="img m" style="background-image: url('styles/avatars/{$user.user_id}/{$thread.thread_id}.png')"></span></a>
    			<xen:else />
    				<xen:avatar user="$user" size="m" />
    			<!-- slot: message_user_info_avatar -->
    You need to fill in the blue pieces. That should work for you.
  3. Nudaii

    Nudaii Well-Known Member

    thanks jake i will check it out and get back to you :)

Share This Page