[HOW TO - vB4] Adding a New Tab in Member Profile
1 Attachment(s)
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:
https://vborg.vbsupport.ru/attachmen...1&d=1266180760 |
Thank you. I do a lot of stuff with custom profiles and this code is nice to have.
/subscribed. I'll now look into seeing how I can get certain profilefields to appear on the new tab. |
is this article written for the latest vb 4.0.2 or is this for a different version ?
i now had my mod working on vb 4.0.1 and on vb 4.0.2 this mod is working but on every tab there is a link of the tab. so if your solution works on 4.0.2 i have to rewrite my mod :( i don't like it that vbulletin changes on every release the way things should be done. so a mod can't be use on several version's |
Quote:
I'm going to have to bite the bullet and install it on my production box. 4.0.0 only half works for me on my dev because the CMS wont allow me to use a port other then 80. 4.0.1 doesn't work at all on my dev. I'm sure 4.0.2 will be worse for me heh. |
ageurtse,
They changed the template hook names. I found the new hooks to use and it works fine on my test system. I updated the code in the original post. Let me know if you have problems with it. Wish they would at least keep the old ones for a while and let us know they're going to be gone. |
thanks 4 great work !
|
very nice.. you saved my day.. !!!
just one thing.. I thought the $show array does NOT need to be registered... $templater->register('show', $show); havent tested here yet.. but usually on other pages it does not... F. |
I wasn't sure, I haven't seen a list of what is auto registered, so I usually just register everything I need in the template.
|
well as far as I know (assume) ....
(not sure read somewhere, but sorry, cant remember where) magic globals dont need registering, like $template_hook, $show, $vboptions, $stylevar, $vbphrase not sure with $template_hook, but thats easy to test.. there might be others.. would be interesting if someone knew where to find a complete list!! F. PS: check class_core.php line: 3959 and following: public function render $template_hook and $show are 'magic globals' |
Yeah would be nice to have a list of everything. I removed the $show registration from the code, thanks for the input :)
|
All times are GMT. The time now is 11:58 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|