Announcement

Collapse
No announcement yet.

Username dropdown menu that is a field in user profile

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Username dropdown menu that is a field in user profile

    When I click on someone's username in a post, can I have profile fields which link to another website automatically appear on the dropdown menu?

  • #2
    Go to your:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates -> postbit or postbit_legacy (depending on which layout you use)

    Add the red code:

    Code:
    <!-- post $post[postid] popup menu -->
    <div class="vbmenu_popup" id="postmenu_$post[postid]_menu" style="display:none">
    	<table cellpadding="4" cellspacing="1" border="0">
    	<tr>
    		<td class="thead">$post[username]</td>
    	</tr>
    	<if condition="$show['profile']">
    		<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]userid=$post[userid]" target="_blank">$vbphrase[view_public_profile]</a></td></tr>
    	</if>
    	<if condition="$show['pmlink']">
    		<tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]do=newpm&amp;userid=$post[userid]"><phrase 1="$post[username]">$vbphrase[send_private_message_to_x]</phrase></a></td></tr>
    	</if>
    	<if condition="$show['emaillink']">
    		<tr><td class="vbmenu_option"><a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[send_email_to_x]</phrase></a></td></tr>
    	</if>
    	<if condition="$show['homepage']">
    		<tr><td class="vbmenu_option"><a href="$post[homepage]"><phrase 1="$post[username]">$vbphrase[visit_xs_homepage]</phrase></a></td></tr>
    	</if>
    	<if condition="$show['search']">
    		<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&amp;userid=$post[userid]"><phrase 1="$post[username]">$vbphrase[find_more_posts_by_x]</phrase></a></td></tr>
    	</if>
    	<if condition="$post['userid']">
    	<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
    	</if>
    	<if condition="$post['field2']">
    	<tr><td class="vbmenu_option"><a href="$post[field2]">link</a></td></tr>
    	</if>
    	</table>
    </div>
    <!-- / post $post[postid] popup menu -->
    Change both instances of field2 to the field indentifier of the profile field as shown in your:

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

    Change link to the linked text you want.

    Comment


    • #3
      It works perfect. Now I want to advance this a little further. Is there anyway I can make the dropdown link name a field in the user profile?

      Thanks.

      Comment


      • #4
        Use the appropriate $post[fieldX] variable for profile fields. If it is not a profile field then what field is it?

        Comment

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