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. |
#102
|
|||
|
|||
I'm not sure as I haven't tried but the code below might work if you don't want to loop data.
PHP Code:
|
#103
|
|||
|
|||
I'm trying to get this information to show but for some reason it keeps bringing errors. Any ideas?
Currently my plugin is the default: PHP Code:
PHP Code:
It did not show the image whatsoever. --------------- Added [DATE]1246493739[/DATE] at [TIME]1246493739[/TIME] --------------- I've been toying around with every single combination of codes and it keeps only bringing up the text of the coding or error message. Any assistance would be greatly appreciated. |
#104
|
|||
|
|||
Does this work with VBulletin 3.8.4? I've tried it, but I can't get the tab I'm trying to add to display.
|
#105
|
|||
|
|||
Yes it should work, nothing changed here.
What's the code you're using? |
#106
|
|||
|
|||
The code in the first two boxes. I believe I've done it all correctly, but it doesn't work.
|
#107
|
||||
|
||||
With the hook locations we can specify relative positions (eg: first on the left, last on the right, etc.) but is it possible to specify a specific location, as in the second position from the left?
Thanks |
#108
|
||||
|
||||
No, not with default vbulletin. You may modify the template and add another template_hook to use in the location you want. (I think there is even an article on how to do this.)
|
#109
|
||||
|
||||
just thought I would share with the people who are looking for help.
my vB version is 3.8.1 I needed to query a table I created myself to display all the tutorials of that specific user. here is the code I used and it works like a charm Code:
function prepare_output($id = '', $options = array()) { $sql = mysql_query("SELECT * FROM tutorials WHERE approved = 1 AND user_id=".$this->profile->userinfo[userid].""); $test = "<ul>"; while($result = mysql_fetch_array($sql)) { $test .= "<li> <img src='http://cmstutorials.org/".$result['tutorial_thumb']."' width='50' height='50' alt='' /> <a href='http://cmstutorials.org/tutorial/".$result['tutorial_id']."' target='_blank'>".$result['title']."</a></li> "; } $test .= "</ul>"; $this->block_data['mymodification'] = $test; } how do you call a specific tab with a url? http://cmstutorials.org/forums/member.php?u=1#tabname ???? --------------- Added [DATE]1252407322[/DATE] at [TIME]1252407322[/TIME] --------------- ok I found it http://cmstutorials.org/forums/membe...1&tab=favorite Quote:
|
#110
|
||||
|
||||
Quote:
Thanks for the info. For now I'll go with the relative positions since one of our goals with the project is to make it as template edit free as possible for the site admin'. |
#111
|
|||
|
|||
I am trying tocreate a Tab where it can list specific user Threads in different forums like the profile page on vb.org where it pulls users threads from MODs forum, Templates, Styles forum.
example: I want this users threads from forum ids 2, 4, 6 etc towards the bottom of https://vborg.vbsupport.ru/member.php?u=925 Appreciate your help! I am new to programming. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|