New custom Tab template:
Code:
<div id="view-my_character_bio" class="<vb:if condition="$selected_tab == 'my_character_bio'">selected_view_section<vb:else />view_section</vb:if><vb:if condition="$userinfo['userid'] != $bbuserinfo['userid']"> vm_other_prof</vb:if>">
<div class="blocksubhead subsectionhead userprof_headers userprof_headers_border">
<h4 class="subsectionhead-understate">My Character's Bio</h4>
</div>
<div style="margin-left:25px;margin-right:25px">
<br />This is a <b>custom tab</b> test.<br />
Code should appear below.<br/>
<vb:if condition="$post['field5']">Field 5:{vb:raw post.field5}<br/></vb:if>
Code should appear above.
</div>
</div>
Plugin to show the custom tab:
Code:
if (isset($vbulletin->GPC['tab']))
{
$selected_tab = $vbulletin->GPC['tab'];
}
$blockinfo['title'] = "My Bio";
$blockid = "my_character_bio";
$taburl = $memberurl = fetch_seo_url('member', $prepared) . "&tab=my_character_bio#my_character_bio";
$templater = vB_Template::create('memberinfo_tab');
$templater->register('selected_tab', $selected_tab);
$templater->register('relpath', $relpath);
$templater->register('blockinfo', $blockinfo);
$templater->register('blockid', $blockid);
$templater->register('taburl', $taburl);
$template_hook['profile_tabs_first'] .= $templater->render();
// ### Your code to fill the tab ###
// Don't forget you need to register any variables for use in templates
$templater = vB_Template::create('my_character_bio');
$templater->register('selected_tab', $selected_tab);
$template_hook['profile_tabs'] .= $templater->render();
plugin to make custom tab default:
Code:
if (!$vbulletin->GPC_exists['tab'])
{
$vbulletin->GPC['tab'] = 'my_character_bio';
}
here is the live link:
http://immortalarg.com/forum/member.php?1-stoute