Here's the code used to create my navbar tab for the script, but it does not work on 4.2, please write again for me, thanks a lot
PHP Code:
if (defined('VB_AREA') AND $vbulletin->credit['enabled']) {
if (defined('credit_SCRIPT')) {
$vbulletin->options['selectednavtab'] = 'credit';
$templater = vB_Template::create('credit_navbar_tab');
$templater->register('links',$link);
$template_hook['navtab_end'] .= $templater->render();
} else {
global $credit_active_items;
require_once(DIR . '/credit/functions.php');
$template_hook['navtab_end'] .= vB_Template::create('credit_navbar_tab')->render();
if (is_array($credit_active_items[$vbulletin->userinfo['userid']])) {
$items2show = fetchItemFromCache(
$credit_active_items[$vbulletin->userinfo['userid']]
, $vbulletin->credit['phpfile'] . '?do=myitems&itemid=%1$s#item%1$s'
, 'itemid'
, true
, true
);
foreach ($items2show as $items2show_tmp) {
foreach ($items2show_tmp as $item2show) {
$useHead = false;
$fulllink = $item2show['fulllink'];
$link = $item2show['link'];
$text =
$item2show['name']
. iif($item2show['status_str'],' ' . $item2show['status_str'])
. iif($item2show['count'] > 1," x<strong style=\"color:red\">$item2show[count]</strong>");
$templater = vB_Template::create('credit_navbar_popup_menu_bit');
$templater->register('useHead', $useHead);
$templater->register('fulllink', $fulllink);
$templater->register('link', $link);
$templater->register('text', $text);
$template_hook['credit_navbar_popup_menu_more'] .= $templater->render();
}
}
}
($hook = vBulletinHook::fetch_hook('credit_navbar_popup_menu')) ? eval($hook) : false;
$templater = vB_Template::create('credit_navbar_popup_menu_bit');
$templater->register('useHead', false);
$templater->register('fulllink', true);
$templater->register('link', '#');
$templater->register('text', $vbulletin->credit['name'] . ': ' . $vbulletin->userinfo['credit']);
$template_hook['credit_navbar_popup_menu_more'] .= $templater->render();
$templater = vB_Template::create('credit_navbar_link');
$templater->register('template_hook',$template_hook);
$template_hook['navbar_after_calendar'] .= $templater->render();
}
}
--------------- Added [DATE]1338005352[/DATE] at [TIME]1338005352[/TIME] ---------------
bump .