No announcement yet.

Couple questions :)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Couple questions :)

    Hi - I got a few questions I promise you that I have done searching across,,, and the unofficial before doing this.

    1. What is the <if condition=$____> that I need to use if I want to call up a custom field profile to the forumhome (and all other pages)? I'm assuming this has to be a global variable. I have tried several variables (including some that I know would not work on the forumhome (and all other pages).

    2. I am attempting to customize the whosonlinebit template so if any of my staff members is online, they have a special color. And note this, I am not going to be using the special html markup that's in the usergroup manager because I have a store installed onto the site and I'll like them to be able to use it without restrictions.

    Those 2 will suffice for now.

    This is not a must, but if it's possible, could someone post a list of common-used variables, such as $post, $bbuserinfo, and so on??



  • #2
    1) A custom field for the currently logged in user? In that case the variable is $bbuserinfo[fieldX], where fieldX is the field indentifier of the field as shown in your:

    Admin CP -> User Profile Fields -> User Profile Field Manager

    If you want to display custom fields in posts then use $post[fieldX] in the postbit or postbit_legacy template.

    2) In your whosonlinebit template, add the red code:

    	<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">[color=red]<span <if condition="is_member_of($userinfo, X)">style="color: #123456"</if>>[/color]$userinfo[musername][color=red]</span>[/color]</a>$userinfo[hidden]<if condition="$show['buddy']">+</if>
    		<else />
    			<if condition="$show['spider']">$userinfo[spider] $vbphrase[spider]<else />$userinfo[musername]</if>
    Where X is the usergroupid of the group to which your staff members belong, and #123456 is the color code of the color you want for the names.

    This template will affect the online.php page. If you want the color change to show up on your forumhome page as well then you need to make a similar change to the forumhome_loggedinuser template:

    <a href="member.php?$session[sessionurl]u=$loggedin[userid]">[color=red]<span <if condition="is_member_of($loggedin, X)">style="color: #123456"</if>>[/color]$loggedin[musername][color=red]</span>[/color]</a>$loggedin[invisiblemark]$loggedin[buddymark]
    That should work.


    • #3
      Thanks, Jake, for answering

      #2 worked Thank you

      #1 I should have explained the question better. I plan on making a side menu, but an user option. The profile field would be a "Yes" or "No" dropdown where users can choose to have the menu or not. I have tried every variable that I can think of. But of course, I'm still learning about vbulletin.

      Does that make sense?



      • #4
        1) Then you would use $bbuserinfo[fieldX] in the condition, like this:

        <if condition="[i]$bbuserinfo[[color=red]fieldX[/color]][/i]">
        	CODE FOR MENU
        A checkbox profile field would probably be best for this application. Word the field so that checked means the menu is enabled, then the above code will work.


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