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. |
#122
|
|||
|
|||
They must have unique names/classnames.
Maybe you took the same? |
#123
|
|||
|
|||
this the same for VB 3.8.4???
because I don't see member_build_blocks_start in the templates in my Style Manager where it says to "Add a new plugin to the member_build_blocks_start hook with the following PHP code:" |
#124
|
||||
|
||||
3.8.6 Pl 1 woww
Thank You man ! |
#125
|
|||
|
|||
So I've (mostly) got this working for vB 4.1.1, but there's a few problems:
1: The tab's styling is a little messed up (see picture) 2: The contents of the block appear at the bottom of the screen upon loading the member's profile page. Other than changing the hook_location value, it's pretty much a copy of this how-to. I've seen a how-to for adding tabs in 4.0.8, but it looks really messy compared to this, so I'd really rather get this working. Anyone have any ideas? [edit] So I've got the answer to part 2: There is a function called wrap() that you have can override. This function takes the html and wraps it in a div, but the class of this div is wrong. So we need to fix this. Put this code inside the class declaration for vB_ProfileBlock_MyModification (or whatever you're calling it): PHP Code:
|
#126
|
|||
|
|||
how can i adjust the width of the tabs so user can see all tab in one glance.
Attachment 132480 eg, make a proper adjustment to the profile tabs so the last 2 tabs can be display without a drop down bar needed thank you! |
#127
|
||||
|
||||
Quote:
|
Благодарность от: | ||
JohorBahru |
#128
|
|||
|
|||
How do I make the new tab and it's contents only viewable by Administrators of the forum?
Sorry to bump a 2 year old thread. - Revenga |
#129
|
||||
|
||||
Try a Search This Article for "is_member_of" because that has probably already been covered.
|
#130
|
|||
|
|||
Username Management Addon - History in Profile
https://vborg.vbsupport.ru/showthread.php?t=101411 Addon working, but Code:
<div class="alt1 block_row"> <ul class="list_no_decoration"> $block_data[usernamehistory] </ul> </div> member_build_blocks_start Code:
$blocklist = array_merge($blocklist, array( 'usernamehistory' => array( 'class' => 'usernamehistory', 'title' => 'Username History', 'hook_location' => 'profile_left_last' ) )); class vB_ProfileBlock_usernamehistory extends vB_ProfileBlock { var $template_name = 'memberinfo_block_usernamehistory'; function confirm_empty_wrap() { return false; } function confirm_display() { return ($this->block_data['usernamehistory'] != ''); } function prepare_output($id = '', $options = array()) { $this->block_data['usernamehistory'] = '$mh_unm_uph_history'; } } Profile tabs does not show plugin help me |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|