Image in posts but not 'whos online'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wattie
    Senior Member
    • Jul 2004
    • 186
    • 3.0.3

    Image in posts but not 'whos online'

    Is it possible to assign an image to appear next to the users name on posts and profile but not on the whos online list?
    Thanks.
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    "A user" or "a usergroup"? Because you can do this for a usergroups by entering the image code into the username markup:

    Admin CP -> Usergroups -> Usergroup Manager -> Edit Usergroup -> Username HTML Markup

    In the second field, enter an img tag, like this:

    Code:
    <img src="URL OR PATH TO IMAGE" alt="" border="0" />
    This will add the image after user's names in posts, profiles, and in the online list. Then you can make it so the online list doesn't use the username markup by editing this template:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_loggedinuser

    Remove the m:

    Code:
    <a href="member.php?$session[sessionurl]u=$loggedin[userid]">$loggedin[[color=red]m[/color]username]</a>$loggedin[invisiblemark]$loggedin[buddymark]
    Admin CP -> Styles & Templates -> Style Manager -> « » -> Who's Online Templates -> whosonlinebit

    Remove the m:

    Code:
    <tr>
    
    	<td class="alt1" width="35%">
    		<span class="smallfont" style="float:$stylevar[right]"><span class="time">$userinfo[time]</span></span>
    		<if condition="$show['loggedinuser']">
    			<a href="member.php?$session[sessionurl]u=$userinfo[userid]" target="_blank">$userinfo[[color=red]m[/color]username]</a>$userinfo[hidden]<if condition="$show['buddy']">+</if>
    		<else />
    			<if condition="$show['spider']"><phrase 1="$userinfo[spider]">$vbphrase[x_spider]</phrase><else />$userinfo[[color=red]m[/color]username]</if>
    		</if>
    	</td>

    Comment

    • Wattie
      Senior Member
      • Jul 2004
      • 186
      • 3.0.3

      #3
      Thanks Jake. Will this also do away with the different colours Ive selected for different usergroups on the 'Whos online' section? Ideally Id want to keep those, and have the image displayed next to the users name on messages.
      Thanks.

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        Originally posted by Wattie
        Thanks Jake. Will this also do away with the different colours Ive selected for different usergroups on the 'Whos online' section?
        Yes it would.

        You can try using template conditionals to display the image. In the postbit template:

        Code:
        <if condition="$post[usergroupid] == X">
        	IMAGE CODE HERE
        </if>
        In the MEMBERINFO and whosonlinebit templates:

        Code:
        <if condition="$userinfo[usergroupid] == X">
        	IMAGE CODE HERE
        </if>
        Where X is the usergroupid of the usergroup that gets the image.

        Comment

        • boro_boy
          Senior Member
          • Dec 2002
          • 376
          • 3.8.x

          #5
          Is it possible to show the avatar in here?

          Or even making a new user profile Field so people can select what team they support and then this image can be shown before their username?
          My Football Forum

          Comment

          • peterska2
            Senior Member
            • Oct 2003
            • 8869
            • 3.7.x

            #6
            Please start a new thread with your question in the relevant forum for your version.

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...