The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[How-to] Add more tabs to the vB 3.7 profile pages
If you want to add more tabs to the vB 3.7 profile pages, assuming JavaScript is enabled, or more blocks if JavaScript is off, then this tutorial is for you. If you like to learn in a trial by fire sort of way, create a new template titled memberinfo_block_mymodification with the following content: Code:
<div class="alt1 block_row"> <ul class="list_no_decoration"> $block_data[mymodification] </ul> </div> Code:
$blocklist = array_merge($blocklist, array( 'mymodification' => array( 'class' => 'MyModification', 'title' => 'My Modification', 'hook_location' => 'profile_left_last' ) )); class vB_ProfileBlock_MyModification extends vB_ProfileBlock { var $template_name = 'memberinfo_block_mymodification'; function confirm_empty_wrap() { return false; } function confirm_display() { return ($this->block_data['mymodification'] != ''); } function prepare_output($id = '', $options = array()) { $this->block_data['mymodification'] = 'Content to show in the tab.'; } } If you want to learn a bit more of the details, first consider this part: Code:
$blocklist = array_merge($blocklist, array( 'mymodification' => array( 'class' => 'MyModification', 'title' => 'My Modification', 'hook_location' => 'profile_left_last' ) )); Next consider the next part: Code:
class vB_ProfileBlock_MyModification extends vB_ProfileBlock { var $template_name = 'memberinfo_block_mymodification'; function confirm_empty_wrap() { return false; } function confirm_display() { return ($this->block_data['mymodification'] != ''); } function prepare_output($id = '', $options = array()) { $this->block_data['mymodification'] = 'Content to show in the tab.'; } } Now there is the new template itself: Code:
<div class="alt1 block_row"> <ul class="list_no_decoration"> $block_data[mymodification] </ul> </div> Finally there are other things that can be added to modifications such as options, and these can be seen in the vB class_profileblock.php and member.php files, though this tutorial should get you on your way to adding more content to the profile pages via additional tabs, but remember not to go overboard with queries, because even though you need to click the tab to see the content, whatever queries you run get run on page load, not tab click. Enjoy! Fine print: tutorial based on vB 3.7.0 Beta 2, no redistribution without permission. |
#42
|
||||
|
||||
Anyone gotten the Edit stuff to work on new tabs? Only messed with it for a couple of min myself while working on updating my mods.
|
#43
|
|||
|
|||
Thanks for the awesome article Gave it 5/5
Quick question... how can I have a link that goes (displays) directly to the new tab I created instead of the contents of the first tab on the list? |
#44
|
|||
|
|||
OMG this is soo confusing, is there any easier way to do it ?
|
#45
|
||||
|
||||
It's pretty easy actually. Pop in the 2 quotes in the article, and that's it.
If you just want a tab for a profile category, that's built in. |
#46
|
||||
|
||||
Nice article, works fine. But can anyone tell me how I can call a custom templates for data into that tab ?
|
#47
|
||||
|
||||
thanks
|
#48
|
||||
|
||||
So what's the deal with phrases? It seems only GLOBAL phrases work in blocks no matter what you put in the new class. Even if the phrasegroup shows as available for the page. So there must be some issue with scope here that isn't cured by a mere addition of "global $vbphrase;".
|
#49
|
|||
|
|||
How can I disable the new tab for all usergroups but one?
|
#50
|
|||
|
|||
I've simplified the following code fragment a bit.
Code:
$blocklist['mymodification'] = array ( 'class' => 'MyModification', 'title' => 'My Modification', 'hook_location' => 'profile_left_last' ); |
#51
|
|||
|
|||
Awesome thanks very much this has answered one question at least
Matt |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|