PDA

View Full Version : Pls converse navtab 4.1 to 4.2 for me


Easy5s.net
05-25-2012, 11:29 PM
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 :)


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_men u')) ? 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 1338005352 at 1338005352 ---------------

bump .

AusPhotography
05-26-2012, 09:21 AM
Scrap that and create the new tab menu structure in the Navigation manager via AdminCP

Add plugins as needed (if needed).

Easy5s.net
05-26-2012, 12:27 PM
I can use the Navigation manager but can not write plug so it does not work, please help me step by step.

AusPhotography
05-26-2012, 10:07 PM
I can use the Navigation manager but can not write plug so it does not work, please help me step by step.

Options:
a) Learn to code a plugin (not that hard) -- http://php.net/docs.php
b) Pay someone

:D