View Full Version : howto add an extra tab to the members profile page

25 Dec 2009, 19:58

where can i find information about how to add an extra tab in the members profile page.
i'm trying to make an extra tab which displays all the attachments post by that user.

this is my first attempt to program somthing in vb so i have a lot of questions. and this is one.

i supose i make a new template, which displays the attachments. now i need that template loaded in a new tab in the members page.

so a lot of work and learning to do.

i don't think this link is going to work

25 Dec 2009, 20:22

Like that ?

25 Dec 2009, 20:52
There is an article in the vB3 forum which pretty much spells out how to do it. I think there are just a couple of small changes you need to make for vB4 (if any, I can't remember). Anyway, follow it, and if you have problems, post what you have and we'll see if we can see what is wrong.

[How-to] Add more tabs to the vB 3.7 profile pages (http://www.vbulletin.org/forum/showthread.php?t=165554)

26 Dec 2009, 05:18
the article lynne has point me to is working.

the next thing if i called the page direct http://localhost/forums/member.php?8646&tab=mymodification there is an empty page displayd.

if i go to members page itself then click on the mymodification tab the content is displayed, what could be wrong.

this is the code i have this far. the output needs to be formated and there needs to be a page counter so a lot of work to do.
$blocklist = array_merge($blocklist, array(
'mymodification' => array(
'class' => 'MyModification',
'title' => 'Bijlagen',
'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())
$output = "thumbnails <br>";

$attachments = mysql_query("SELECT * FROM `vb3_attachment` where `userid`=".$this->profile->userinfo['userid']);
while ($post = mysql_fetch_array($attachments))
$output .= "<a target=blank href=attachment.php?attachmentid=".$post['attachmentid'].">";
$output .= "<img border=0 src=attachment.php?attachmentid=".$post['attachmentid']."&thumb=1>";
$output .= "</a><br>" ;

$this->block_data['mymodification'] = $output;

26 Dec 2009, 17:32
I don't believe you put tab=mymodification in the url to get to that tab. Just add #mymodification to the url and see if that works.

27 Dec 2009, 20:56
is there also a way to call a php page that should display his content in this newly created tab ?

27 Dec 2009, 22:06
is there also a way to call a php page that should display his content in this newly created tab ?
I've never done that, so I really don't know.