Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How to Easily Make Your Own Movable Profile Tab Hook
yotsume's Avatar
yotsume
Join Date: Dec 2006
Posts: 844

 

Show Printable Version Email this Page Subscription
yotsume yotsume is offline 08-14-2009, 10:00 PM

How to Easily Make Your Own Movable Profile Tab Hook
Thanks to PaulM for his original simple yet powerful post!!!

If you want to be able to move your profile tabs around and be able to 100% pick their order then my little tutorial here is for you. I can now take any mod and make it's profile tab go where ever I want it to with this method. Many mods use the hook location of $template_hook[profile_left_last]. This location will put the associated tab always off to the left where you can not control the order of the tab. The more mods you have install that use this same hook the more you will loose site of you importnat mods such a vbBlogs. Blogs for my site MUST always be a visible tab. So I had to learn how to do this myself. I feel that we need to be able to control what tab in shown and what tab is less needed and can be lost off the left side in what I call left side La La Land...

INSTRUCTIONS:
1. Create a file labeled: hooks_custom.xml

2. Paste the below code as the content of the file:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<hooks>

    <hooktype type="My Custom Hooks">
        <hook>blog_custom_hook_1</hook>
        <hook>yourmod_custom_hook_2</hook>
    </hooktype>

</hooks>
3. Make your own custom hook labeled whatever you want for this mod's tab. I labeled mine in RED. Note: the code in blue is for being able to move vbBlog's tab to your own custom order on your profile as well which I will cover in this tutorial as well. You can simple leave out the blue line of code if you do now have vbBlog installed: <hook>blog_custom_hook_1</hook>

4. Save and upload this file to your xml folder located here: /includes/xml

5. Next we will add our hook to the MEMBERSINFO template.

6. Go to: AdminCP > Style and Templates > Style Manager > Edit Templates > Members Info Templates > MEMBERSINFO

7. Find: <div id="profile_tabs">

8. In the list of tab hooks below add your tab in red code for the mods tab you need to have moved to where you would like it to show up. NOTE: add the code in blue for vbBlogs. (you can name your hooks as you wish)

Code:
<div id="profile_tabs">
        $template_hook[profile_left_first]
        $blocks[visitor_messaging]
        $blocks[aboutme]
        $template_hook[yourmod_custom_hook_2]
        $template_hook[blog_custom_hook_1]
        $blocks[contactinfo]
        $blocks[stats]
        $blocks[friends]
        $blocks[infractions]
        $template_hook[profile_left_last]
    </div>
9. Now we have to change the plugin associated with the mod so it looks for your custom hook. (Example: vbBlogs)

10. If you have vbBlog installed and you want to move its tab so it is always visible and not lost off in La La Land add the hook code in blue to the xml file and follow the instructions as stated above.

11. Edit the plugin labeled: Member Profile: Add Blog Links to standard MEMBERINFO display.

12. Go to: AdminCP > Plugins & Products > Plugin Manager > Member Profile: Add Blog Links to standard MEMBERINFO display

13. Change: $template_hook[\'profile_left_last\'] to $template_hook[\'blog_custom_hook_1\']

14. SAVE and REFRESH and your profile page now has your Blog tab where ever you placed it in step #8.
Now we can have complete control over our profile tabs and order them any damn way wish to once and for all!!!

SEE ATTACHED SCREENSHOT
:
I have a custom tab labeled "More About Me" and the Blog tab which are now always visible since they are importnat to the members and focus of my site. I do not feel blogs should be lost off the left and it's tab not easily reordered to whatever location we need it to. vbBlogs is too importnat of a mod to have lost off in left side la la land.
Attached Images
File Type: jpg Profile Tabs Reordered (Custom Hooks).jpg (31.9 KB, 0 views)
Reply With Quote
  #2  
Old 09-19-2009, 08:07 PM
cortinator cortinator is offline
 
Join Date: Oct 2007
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice! Just a question though. Is there a way to make it so that members can choose the order for their profile?
Reply With Quote
  #3  
Old 09-20-2009, 01:08 AM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cortinator View Post
Very nice! Just a question though. Is there a way to make it so that members can choose the order for their profile?
This tab is done with a custom hook and template edits.

Maybe in vBulletin v4 there will be a way to drag profile blocks and tabs around similar to how you can do so in vbBlog.

You would have to search for a mod to allow members to sort their own profile tabs.
Reply With Quote
  #4  
Old 11-11-2009, 05:02 AM
jaderollie jaderollie is offline
 
Join Date: Nov 2008
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this looks good
Reply With Quote
  #5  
Old 08-30-2011, 02:55 PM
JohorBahru JohorBahru is offline
 
Join Date: Jan 2009
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi, could you tech me how to adjust the tab width? thank you!
Reply With Quote
  #6  
Old 09-01-2011, 03:48 PM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JohorBahru View Post
hi, could you tech me how to adjust the tab width? thank you!
The width is controlled by the Javascript and CSS files involved with the tabs. I am unsure myself... sorry.
Reply With Quote
  #7  
Old 06-06-2012, 01:49 PM
Been Told Been Told is offline
 
Join Date: Oct 2006
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Either I'm completely stupid, or this is not compatible with vB 4.2. I cannot find the blocks in the MEMBERINFO template.
Reply With Quote
  #8  
Old 06-06-2012, 05:51 PM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Been Told View Post
Either I'm completely stupid, or this is not compatible with vB 4.2. I cannot find the blocks in the MEMBERINFO template.
Your not stupid. I originally wrote this article back in 2009. There was no 4x anything VB back then. I do not use 4x myself so the code for the profile blocks I'm sure is updated and then some.

You could use "firebug" and look for the profile block code in your version of VB to locate the proper template...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:22 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04659 seconds
  • Memory Usage 2,287KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete