The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[HOW TO - vB4] Adding a New Tab in Member Profile
If you are using anything above vB4.0.8 then refer to cellarius' updated article. https://vborg.vbsupport.ru/showthread.php?p=2214470 I haven't seen a tutorial on doing this and I had to do it for a mod of mine, so I figured I would share. It is actually quite a bit easier to do in vb4 then it was before. You will need 4 templates and 2 plugins. You could reduce it down to 2 templates but mine is used for distribution so I have to account for all versions. First Template: This will create the tab next to About Me, Friends, etc (my_data_tab) Quote:
Second Template: The data you want to show. (my_data_data) Quote:
Third Template: This will create the tab next to About Me, Friends, etc (4.0.8+) (my_data_tab_408) Quote:
Fourth Template: The data you want to show (4.0.8+). (my_data_data_408) Quote:
Now the first plugin Hook Location: member_build_blocks_start Title: Whatever you want to call it Plugin Code PHP Code:
Hook Location: cache_templates Title: Whatever you want to call it PHP Code:
|
#22
|
|||
|
|||
I don't see why not. You could find the album code and replicate how they do it with plugins.
I can't look at it right now though, trying to figure out what css changes they made in 4.0.8 that makes non default tabs look jacked up. |
#23
|
|||
|
|||
Quote:
I'm hoping that they will implement the suggestions from DP if enough people vote. (I have no clue how that works.) Otherwise we have to bloat mods with an added template for css and a hook. |
#24
|
|||
|
|||
Quote:
Might not be the best way but it's how I got it to work heh. |
#25
|
|||
|
|||
looks really cool, oh btw do you know if its possible to add iframes tags in members new profile tabs so that it links to an external site of mine without directing users away from the forum? If so, can you please show me an example of how to do this?
|
#26
|
|||
|
|||
Quote:
Code:
if ($vbulletin->versionnumber < "4.0.8") { $templater = vB_Template::create('my_data_tab'); } else { $templater = vB_Template::create('my_data_tab_408'); } $templater->register('selected_tab', $selected_tab); $templater->register('relpath', $relpath); if ($vbulletin->versionnumber < "4.0.2") { $template_hook['profile_left_last'] .= $templater->render(); } else { $template_hook['profile_tabs_last'] .= $templater->render(); } //Do your processing to get your data ready here. $new_user_data = "<iframe src=\"http://www.yoursite.com/your_page.html\" width=\"550\" height=\"500\" frameborder=\"0\">\n"; $new_user_data .= "<a href=\"http://www.yoursite.com/your_page.html\" target=\"ResourceWindow\">Your browser doesn't support iframe content.\n"; $new_user_data .= "Click here to go directly to included content.</a>\n"; $new_user_data .= "</iframe>\n"; if ($vbulletin->versionnumber < "4.0.8") { $templater = vB_Template::create('my_data_data'); } else { $templater = vB_Template::create('my_data_data_408'); } $templater->register('selected_tab', $selected_tab); $templater->register('new_user_data', $new_user_data); if ($vbulletin->versionnumber < "4.0.2") { $template_hook['profile_left'] .= $templater->render(); } else { $template_hook['profile_tabs'] .= $templater->render(); } |
#27
|
|||
|
|||
Thank you so much for this reply, I will give a try on my forum soon. ^^
|
#28
|
||||
|
||||
Anyone got this working for 3.8.x?
|
#29
|
||||
|
||||
There is an article in the vB3 forum for this for 3.8.x. It's by Calorie.
|
#30
|
||||
|
||||
Quote:
this has bothered me since vb4.0.8 came out .. prevented me from upgrading .. lol I just couldn't do it I may now tho after seeing that bug reported thanks to all that help here at vb.org your all much appreciated |
#31
|
|||
|
|||
Anyone tried this on VB 4.1.0? My tab was added successfully, but the content is blank. I can find the content in the browser source file, but it doesn't show in the tab.
Edit: never mind, I had a typo. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|