Sarcoth
03-19-2010, 06:53 PM
Alright, I am using Ragtek's navbar article (https://vborg.vbsupport.ru/showthread.php?t=228313) and everything is working fine right now. I'm trying to advance it a bit though and I have a question. Is there another way to control the order of the tab rather than by changing the execution order?
Here's my two settings (that are in my install.xml file):
<setting varname="showroster_navbar_loc" displayorder="20">
<datatype>number</datatype>
<optioncode>radio:piped
1|Left
2|Middle
3|Right</optioncode>
<defaultvalue>3</defaultvalue>
</setting>
<setting varname="showroster_navbar_order" displayorder="25">
<datatype>number</datatype>
<defaultvalue><![CDATA[5]]></defaultvalue>
</setting>
This is my plugin. I currently have it working so the left, middle, and right location bit is working:
$accessgroups = explode(',', $vbulletin->options['showroster_access_groups']);
$navbarloc = $vbulletin->options['showroster_navbar_loc'];
$navbarorder = $vbulletin->options['showroster_navbar_order'];
switch ($navbarloc) {
case '1':
$nbloc = 'navtab_start'; break;
case '2':
$nbloc = 'navtab_middle'; break;
case '3':
$nbloc = 'navtab_end'; break;
}
if (THIS_SCRIPT == 'showroster')
{
$vbulletin->options['selectednavtab'] = 'showroster';
}
$templater = vB_Template::create('showroster_navbar');
$templater->register('accessgroups', $accessgroups);
$template_hook[$nbloc] .= $templater->render();
Now, if I know what controls the order, I think I could get this working on my own, but I'll accept any suggestions or help. All responses are appreciated.
Here's my two settings (that are in my install.xml file):
<setting varname="showroster_navbar_loc" displayorder="20">
<datatype>number</datatype>
<optioncode>radio:piped
1|Left
2|Middle
3|Right</optioncode>
<defaultvalue>3</defaultvalue>
</setting>
<setting varname="showroster_navbar_order" displayorder="25">
<datatype>number</datatype>
<defaultvalue><![CDATA[5]]></defaultvalue>
</setting>
This is my plugin. I currently have it working so the left, middle, and right location bit is working:
$accessgroups = explode(',', $vbulletin->options['showroster_access_groups']);
$navbarloc = $vbulletin->options['showroster_navbar_loc'];
$navbarorder = $vbulletin->options['showroster_navbar_order'];
switch ($navbarloc) {
case '1':
$nbloc = 'navtab_start'; break;
case '2':
$nbloc = 'navtab_middle'; break;
case '3':
$nbloc = 'navtab_end'; break;
}
if (THIS_SCRIPT == 'showroster')
{
$vbulletin->options['selectednavtab'] = 'showroster';
}
$templater = vB_Template::create('showroster_navbar');
$templater->register('accessgroups', $accessgroups);
$template_hook[$nbloc] .= $templater->render();
Now, if I know what controls the order, I think I could get this working on my own, but I'll accept any suggestions or help. All responses are appreciated.