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. |
#62
|
|||
|
|||
Code:
$blocklist = array_merge($blocklist, array( 'playlist' => array( 'class' => 'Playlist', 'title' => 'Playlist', 'hook_location' => 'profile_left_last' ) )); class vB_ProfileBlock_playlist extends vB_ProfileBlock { var $template_name = 'memberinfo_block_playlist'; function confirm_empty_wrap() { return false; } function confirm_display() { return ($this->block_data['playlist'] != ''); } function prepare_output($id = '', $options = array()) { $this->block_data['playlist'] = '<div style="text-align: center; margin-left: auto; visibility:visible; margin-right: auto; width:450px;"><embed style="width:435px; visibility:visible; height:270px;" allowScriptAccess="never" src="http://www.greatprofilemusic.com/mc/mp3player-othersite.swf?config=http://www.greatprofilemusic.com/mc/config/config_black_shuffle.xml&mywidth=435&myheight=270&playlist_url=http://www.greatprofilemusic.com/loadplaylist.php?playlist='$this->profile->userinfo[field7]'" menu="false" quality="high" width="435" height="270" name="mp3player" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" border="0"/> </div>'; } } |
#63
|
||||
|
||||
heh, what would be stellar is a tutorial on creating your own fancy tab thing on other pages
|
#64
|
|||
|
|||
Hi there and i am trying to, i am not that good at describing the code but what i am trying acheive is that - i need to get some data from a the database and show in one of the block. Have a look at my code
PHP Code:
PHP Code:
|
#65
|
|||
|
|||
Is anyone else having the problem of custom profile tabs not parsing BB Code?
It displays normal HTML correctly, but not BBCode. |
#66
|
|||
|
|||
I am trying to output pictures from coppermine gallery in a tab. There is a script for coppermine gallery called cpmfetch, which allows to display any picture of your coppermine gallery on external pages. All you need to do is put this into your php page:
PHP Code:
Code:
<table >
<tr>
<td><a href='http://your_domain.com/coppermine_gallery/thumbnails.php?album=14' ><img src="http://your_domain.com/coppermine_gallery/albums_directory/categoryname/picture_name.jpg" /></a></td>
</tr>
</table>
Code:
$blocklist = array_merge($blocklist, array( 'copperminegallery' => array( 'class' => 'CoppermineGallery', 'title' => 'Last Added Pic', 'hook_location' => 'profile_left_last' ) )); class vB_ProfileBlock_CoppermineGallery extends vB_ProfileBlock { var $template_name = 'memberinfo_block_copperminegallery'; function confirm_empty_wrap() { return false; } function confirm_display() { return ($this->block_data['copperminegallery'] != ''); } function prepare_output($id = '', $options = array()) { include "./coppermine_gallery/cpmfetch/cpmfetch.php"; $objCpm = new cpm("./coppermine_gallery/cpmfetch/cpmfetch_config.php"); $this->block_data['copperminegallery'] = $objCpm->cpm_viewLastAddedMedia(1,1,$options); } } Code:
$blocklist = array_merge($blocklist, array(
'copperminegallery' => array(
'class' => 'CoppermineGallery',
'title' => 'My Favs',
'hook_location' => 'profile_left_last'
)
));
class vB_ProfileBlock_CoppermineGallery extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_copperminegallery';
function confirm_empty_wrap()
{
return false;
}
function confirm_display()
{
return ($this->block_data['copperminegallery'] != '');
}
function prepare_output($id = '', $options = array())
{
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$this->block_data['copperminegallery'] = '<table >
<tr>
<td><a href=\'http://your_domain.com/coppermine_gallery/thumbnails.php?album=14\' ><img src="http://your_domain.com/coppermine_gallery/albums_directory/categoryname/picture_name.jpg" /></a></td>
</tr>
</table>
';
}
}
Quote:
Thank you! |
#67
|
|||
|
|||
great! thanks a lot!
is there a way to have a preview of the latest threads and posts made by a user the way they have it on ipb in those tabs: http://forums.invisionpower.com/inde...showuser=75430 i actually requested that as a mod: https://vborg.vbsupport.ru/showthread.php?t=196487 |
#68
|
||||
|
||||
Great Article.
Code:
'hook_location' => 'profile_left_last' My product has setting options like seen below: Code:
<setting varname="custom_hook_location" displayorder="20"> <datatype>free</datatype> <optioncode><![CDATA[select:piped 0|None 1|$template_hook[profile_left_first] 2|$template_hook[profile_left_last] ]]></optioncode> <defaultvalue>0</defaultvalue> </setting> Have tried the following with no luck- custom_hook_location $vbulletin->options['custom_hook_location'] Thanks |
#69
|
|||
|
|||
How do I display a list which i want to get out of an mysql database in such a profile tab?
|
#70
|
||||
|
||||
You'll need to add your query into the plugin and then spit the results out into "$this->block_data['mymodification']"
|
#71
|
||||
|
||||
Hey, I'm trying to test this out and see if I can make something cool for my members, but I've noticed something a bit weird...
For the template, I've got the following code: Code:
<if condition="$vbulletin->userinfo['userid'] == 15010"> <div class="alt1 block_row"> <ul class="list_no_decoration"> $block_data[animelist] </ul> </div> </if> Code:
<if condition="$vbulletin->userinfo['userid'] == 15010"> <if condition="$vbulletin->userinfo['userid']"> <if condition="$vbulletin->userinfo"> <if condition="$vbulletin"> <if condition="1"> How would I make it so that the $vbulletin object IS recognized? EDIT: BTW, I did "solve" it simply by putting the plugin itself in some "IF" brackets, but still for curiosity's sake, let's say for some reason I wanted to use the $vbulletin object in the tab (maybe I wanted to make a Tab with the User's name or something equally silly). |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|