1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Please donate today & help us with our growing server costs or buy premium for access to our premium products
    Dismiss Notice

Free [4.2.x] Hide/Remove the Friends Widget (Friends Box) on User Profiles

Discussion in 'vBulletin Template Mods & Extras' started by HAWK, Nov 5, 2016.

  1. HAWK

    HAWK Administrator Staff Member ADMIN

    Likes Received:
    590
    Trophy Points:
    113
    Gender:
    Male
    Hide/Remove the Friends Widget (Friends Box) on User Profiles
    Here is a Screenshot of Befor and After Removal of the Friends Box on my Test Forum:

    Before


    Click here to view the original image of 799x673px.
    [​IMG]


    And After


    Click here to view the original image of 704x558px.
    [​IMG]

    Notice: The Friends Box in Users own Profile Pages will also be removed/hidden. To see the Friends Box in your Profile, You have to be logged-in. The Friends Box have a Pencil on Top of its header. See the Sample below.

    [​IMG]

    The Friends Widget in your Profile Page will no longer be Visible as well as the Others.

    Tutorial Starts Here:


    If you want to Remove or Hide the Friends Box (Widget) from User Profies Completely then Follow the Steps Below.

    1) Login to your AdminCP > Style & Templates > Style Manager > From your Templates right DropDown menu select "Edit Templates" > Then from the Templates section find the Member Info Templates > Next fndthe Template: memberinfo_block_friends_mini

    2) Double Click an Enter the memberinfo_block_friends_mini Template.


    Here You have two Options you can Choose from:

    A. If you want to Remove the Friends Box completely, Then Delete content of the the " memberinfo_block_friends_mini" Template and Click SAVE.

    B. If you want to Hide the Friends Box Template so only Admins Usergroup can view it then Please Continue with Step 3 below.


    3) At the start of memberinfo_block_friends_mini Template dd this line:
    Code:
    <vb:if condition="is_member_of($bbuserinfo,6)">
    4) Next scroll all the way Down in your Template and add this at the very end of the Template:
    Code:
    </vb:if>
    Notice: We have added the Number 6 for Admins Usergroup in the frst Line. If you want to Add More Usergroups for Viewing the Friends Box, then Add the Usergroup ID's Separated by Comma

    Example:
    Code:
    <vb:if condition="is_member_of($bbuserinfo,5,6,7)">
    5. Is For Moderator
    6. Is For Administrator
    7. Is For SuperAdmins

    Thats pretty much it. Below I have added the ememberinfo_block_friends_mini
    Template used in my Forum for vBulletin 4.2.3. It should work in all vBulletin 4.2.x Versiins. You can simply copy and Replace your Template Code with this:

    Code:
    <vb:if condition="is_member_of($bbuserinfo,6)">
    <div class="friends_mini friends block">
       <h5 class="blocksubhead userprof_blocksubhead smaller ">
           <vb:if condition="$prepared['myprofile']">
           <a class="textcontrol imagecontrol" href="profile.php?{vb:raw  session.sessionurl}do=buddylist"><img src="{vb:stylevar  imgdir_button}/edit_40b.png" alt="{vb:rawphrase edit}" /></a>
           </vb:if>
           <vb:if condition="$block_data['friendbits']">
           <a href="{vb:raw relpath}#friends-content"  class="textcontrol" onclick="return  tabViewPicker(document.getElementById('friends-tab'));">{vb:rawphrase  more}</a>
           </vb:if>
           <span class="friends_total">{vb:raw  prepared.friendcount}</span> <vb:if  condition="$prepared['friendcount'] == '1'">{vb:rawphrase  friend}<vb:else />{vb:rawphrase friends}</vb:if>
       </h5>
       <div class="blockbody userprof_content userprof_content_border">
           <div class="blockrow member_blockrow">
               <vb:if condition="$block_data['friendbits']">
                   <ul class="friends_list floatcontainer">
                       {vb:raw block_data.friendbits}
                   </ul>
               <vb:elseif condition="$prepared['myprofile']" />
                   <div>
                       {vb:rawphrase your_friends_list_is_empty}
                   </div>
               <vb:else />
                   <div>
                       {vb:rawphrase x_has_not_made_any_friends_yet, {vb:raw prepared.username}}
                   </div>
               </vb:if>
           </div>
       </div>
    </div>
    <div class="underblock"></div>
    </vb:if>
     
    steve74 likes this.
  2. steve74

    steve74 Registered REGISTERED

    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Thanks!
     

Share This Page