vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=265971

[HOW TO - vB4] Adding a New Tab in Member Profile - Reloaded
by cellarius
29 Jun 2011 13:47

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 4.1.4 4.2, but should work as far back as 4.0.8, when profile customization was reintroduced.
[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.]



The result will look like this:

Attachment 130539

First step

To create a new member profile tab, create a plugin at hook member_complete

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This code creates the tab and inserts it as the last tab in the row. You
  • should give the tab its own unique id. In this case, we use test. If you change it, make sure you do so everywhere in the plugin and in the template. It has to be identical everywhere
  • can add custom code to fill your tab, if the content is not static html. In that case you would only add code to the template.
  • have to register any variables you want to output in the template, if you add custom code. You will be able to call that variable by using {vb:var test_tab_content} in the template.
  • choose a name for the template you will be calling to show your tab's content.
    Note that template names are case sensitive: test is not the same as TEST or Test. Remember that in step 2!



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.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This is the template for your tab content. You
  • have to adapt the id in several cases. Note that they have to be absolutely identical again.
  • can add static text and html code into the template.
  • can print the output of the variable that you saved the result of your php code in and that you registered correctly.



Direct access


If you want to access your custom profile tag directly, append &tab=test#testto the profile URL.

That's it :)

Princeton 29 Jun 2011 15:38

thank you cellarius - great article! :up:

cellarius 29 Jun 2011 15:42

Thanks :D

BirdOPrey5 29 Jun 2011 21:46

Will come in handy!

Pandemikk 29 Jun 2011 22:41

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.

BCP Hung 03 Jul 2011 16:21

It really important with me !
Great work !

(I can't like your post, why ??? :()

tkhalbiz 04 Jul 2011 10:56

I followed all the steps, but it does not work
can some one help me ?

cellarius 04 Jul 2011 12:40

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 04 Jul 2011 at 12:43 ---------------

Quote:

Originally Posted by Getamped 1404 (Post 2216225)
(I can't like your post, why ??? :()

They improved the likes system, maybe that was the problem. Feel free to try again :D

tkhalbiz 06 Jul 2011 08:37

Hello,
Im sorry for no precision :)
My vbulletin version : 4.1.4
i have create a plugin at hook member_complete
with this code :

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

i just copy past original code
then i have create template custom_profile_tab_test with this code :

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and after i go to profile page to check new tabs but nothing to see :(

cellarius 06 Jul 2011 09:18

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.

tkhalbiz 06 Jul 2011 09:25

Ok i will check all this point and come back :)

WorldCraft 26 Jul 2011 12:45

Awesome thanks!

John Tran 28 Jul 2011 15:20

Installed, but I have a quick question. I know I am asking this in the wrong area but I can't seem to find help anywhere. I installed this tab plugin, now I would like it to display member albums in the tab, is there anyway you can help with this?

n.stanley 25 Aug 2011 15:45

Sorry to sound silly, but where can I find these hooks/plugins?
Is it editing a file directly, or something found within the Administration section?

Sorry..

Edit: Found it out, god bless, google.

n.stanley 29 Aug 2011 11:43

Question;
After creating this tab, how can you specify the USER ID of the members profile you're on?


All times are GMT. The time now is 10:06.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.
Copyright ©2001 - , vbulletin.org. All rights reserved.