HMBeaty
07-17-2011, 12:48 AM
Getting a little frustrated with this as I've been trying to figure out why this isn't working as it should for the past couple of days.
I'm using hook location parse_templates to automatically create links in 3 possible places atm. The first code:
if ($vbulletin->options['usml_staffapp_enable'])
{
switch($vbulletin->options['usml_staffapp_autotemplate'])
{
case 1;
$template_hook['navbar_quick_links_menu_pos4'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
case 2;
$template_hook['navbar_community_menu_end'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
case 3;
$template_hook['navbar_after_calendar'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
}
}
That works just fine and displays only when the modification is enabled.
The 2nd code, I've decided to get a little tricky. Basically, if the modification is disabled, yet in the usergroups permissions, the option to "view the modification even when it is disabled" is enabled, the link should show up. However, the code I've been trying to use isn't working....
if (!$vbulletin->options['usml_staffapp_enable'] AND ($permissions['usmlsaperms'] & $vbulletin->bf_ugp_usmlsaperms['canviewdisabledstaffapp']))
{
switch($vbulletin->options['usml_staffapp_autotemplate'])
{
case 1;
$template_hook['navbar_quick_links_menu_pos4'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
case 2;
$template_hook['navbar_community_menu_end'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
case 3;
$template_hook['navbar_after_calendar'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
}
}
Now, my big question is...why? lol What's wrong with it? As far as I can tell, everything is as it should be.... :confused:
I'm using hook location parse_templates to automatically create links in 3 possible places atm. The first code:
if ($vbulletin->options['usml_staffapp_enable'])
{
switch($vbulletin->options['usml_staffapp_autotemplate'])
{
case 1;
$template_hook['navbar_quick_links_menu_pos4'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
case 2;
$template_hook['navbar_community_menu_end'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
case 3;
$template_hook['navbar_after_calendar'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
}
}
That works just fine and displays only when the modification is enabled.
The 2nd code, I've decided to get a little tricky. Basically, if the modification is disabled, yet in the usergroups permissions, the option to "view the modification even when it is disabled" is enabled, the link should show up. However, the code I've been trying to use isn't working....
if (!$vbulletin->options['usml_staffapp_enable'] AND ($permissions['usmlsaperms'] & $vbulletin->bf_ugp_usmlsaperms['canviewdisabledstaffapp']))
{
switch($vbulletin->options['usml_staffapp_autotemplate'])
{
case 1;
$template_hook['navbar_quick_links_menu_pos4'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
case 2;
$template_hook['navbar_community_menu_end'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
case 3;
$template_hook['navbar_after_calendar'] .= '<li><a href="staff-application.php" title="Apply now to be a member of our staff!">Staff Application</a></li>';
break;
}
}
Now, my big question is...why? lol What's wrong with it? As far as I can tell, everything is as it should be.... :confused: