[HOW TO - vB4] Adding a New Tab in Member Profile - Reloaded
1 Attachment(s)
This tutorial is an update of Dylanblitz' howto for older versions. Credits to him, and thanks for giving me green light for building on his ideas.
This has been tested with [S]4.1.4[/S] 4.2,[S] but should work as far back as 4.0.8, when profile customization was reintroduced. [/S] [Explanation: At least with version 4.1.8, the template name convention for profile tabs was changed. If you want to code for an earlier version, use custom_profile_tab_test as template name.] First step To create a new member profile tab, create a plugin at hook member_complete Code:
if (isset($vbulletin->GPC['tab']))
Second step The second step to a custom profile tab is to create a new template. It has to be the name you used in your php code to create it, in our case: memberinfo_block_test. Code:
<div id="view-test" class="<vb:if condition="$selected_tab == 'test'">selected_view_section<vb:else />view_section</vb:if><vb:if condition="$userinfo['userid'] != $bbuserinfo['userid']"> vm_other_prof</vb:if>">
Direct access If you want to access your custom profile tag directly, append &tab=test#testto the profile URL. That's it :) |
thank you cellarius - great article! :up:
|
Thanks :D
|
Will come in handy!
|
Great job. I wish this article was here when I first wanted to add a new profile tab! Would have saved me hours of headache over such a small little problem.
|
It really important with me !
Great work ! (I can't like your post, why ??? :() |
I followed all the steps, but it does not work
can some one help me ? |
No, sorry, you're just giving too much information... :rolleyes:
What vB version exactly are you using? What exactly does not work? What code did you use where? Honestly, what help exactly do you expect on the simple statement "it does not work"? Only thing I possibly could offer on that grounds would be: fix the error, then it will. ;) --------------- Added [DATE]1309779783[/DATE] at [TIME]1309779783[/TIME] --------------- Quote:
|
Hello,
Im sorry for no precision :) My vbulletin version : 4.1.4 i have create a plugin at hook member_complete with this code : Code:
if (isset($vbulletin->GPC['tab'])) then i have create template custom_profile_tab_test with this code : Code:
<div id="view-test" class="<vb:if condition="$selected_tab == 'test'">selected_view_section<vb:else />view_section</vb:if><vb:if condition="$userinfo['userid'] != $bbuserinfo['userid']"> vm_other_prof</vb:if>"> |
Then you either have not activated the plugin you created, have deactivated plugins globally, created the template for the wrong style, or use a customized style where the needed template hook is not present.
Since that's, as far as I can see, the unchanged code from the firstpost, I can guarantee this works. |
All times are GMT. The time now is 08:57 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|