View Full Version : howto add an extra tab to the members profile page
ageurtse
12-25-2009, 06:58 PM
hello,
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
https://vborg.vbsupport.ru/showthread.php?t=165554&highlight=profile*
Vaupell
12-25-2009, 07:22 PM
108145
Like that ?
Lynne
12-25-2009, 07:52 PM
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 (https://vborg.vbsupport.ru/showthread.php?t=165554)
ageurtse
12-26-2009, 04:18 AM
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;
}
}
Lynne
12-26-2009, 04:32 PM
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.
ageurtse
12-27-2009, 07:56 PM
is there also a way to call a php page that should display his content in this newly created tab ?
Lynne
12-27-2009, 09:06 PM
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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.