I haven't seen a tutorial on doing this and I had to do it for a mod of mine, so I figured I would share. It is actually quite a bit easier to do in vb4 then it was before.
You will need 4 templates and 2 plugins. You could reduce it down to 2 templates but mine is used for distribution so I have to account for all versions.
First Template: This will create the tab next to About Me, Friends, etc
I'm hoping that they will implement the suggestions from DP if enough people vote. (I have no clue how that works.) Otherwise we have to bloat mods with an added template for css and a hook.
I'm hoping that they will implement the suggestions from DP if enough people vote. (I have no clue how that works.) Otherwise we have to bloat mods with an added template for css and a hook.
Yeah, hopefully they take the suggestion and implement it. I changed the code, it adds 2 templates if it's something you distribute. Otherwise you can do it still with 2 templates and 2 plugins.
Might not be the best way but it's how I got it to work heh.
looks really cool, oh btw do you know if its possible to add iframes tags in members new profile tabs so that it links to an external site of mine without directing users away from the forum? If so, can you please show me an example of how to do this?
looks really cool, oh btw do you know if its possible to add iframes tags in members new profile tabs so that it links to an external site of mine without directing users away from the forum? If so, can you please show me an example of how to do this?
Should be fairly easy. I would put this in your plugin code. Replace the red text with your link.
Code:
if ($vbulletin->versionnumber < "4.0.8")
{
$templater = vB_Template::create('my_data_tab');
} else {
$templater = vB_Template::create('my_data_tab_408');
}
$templater->register('selected_tab', $selected_tab);
$templater->register('relpath', $relpath);
if ($vbulletin->versionnumber < "4.0.2")
{
$template_hook['profile_left_last'] .= $templater->render();
} else {
$template_hook['profile_tabs_last'] .= $templater->render();
}
//Do your processing to get your data ready here.
$new_user_data = "<iframe src=\"http://www.yoursite.com/your_page.html\" width=\"550\" height=\"500\" frameborder=\"0\">\n";
$new_user_data .= "<a href=\"http://www.yoursite.com/your_page.html\" target=\"ResourceWindow\">Your browser doesn't support iframe content.\n";
$new_user_data .= "Click here to go directly to included content.</a>\n";
$new_user_data .= "</iframe>\n";
if ($vbulletin->versionnumber < "4.0.8")
{
$templater = vB_Template::create('my_data_data');
} else {
$templater = vB_Template::create('my_data_data_408');
}
$templater->register('selected_tab', $selected_tab);
$templater->register('new_user_data', $new_user_data);
if ($vbulletin->versionnumber < "4.0.2")
{
$template_hook['profile_left'] .= $templater->render();
} else {
$template_hook['profile_tabs'] .= $templater->render();
}
I'm hoping that they will implement the suggestions from DP if enough people vote. (I have no clue how that works.) Otherwise we have to bloat mods with an added template for css and a hook.
thanks for the info ..
this has bothered me since vb4.0.8 came out ..
prevented me from upgrading ..
lol
I just couldn't do it
I may now tho after seeing that bug reported
thanks to all that help here at vb.org
your all much appreciated
Anyone tried this on VB 4.1.0? My tab was added successfully, but the content is blank. I can find the content in the browser source file, but it doesn't show in the tab.