im trying to pass variables to a custom page.
im sure everyone has put a custom button on there nav bar by now, so im sure you will recognize this:
PHP Code:
$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'yourpage')
{
$vbulletin->options['selectednavtab']='unique_name';
$tabselected = ' class="selected"';
$tablinks = ' <ul class="floatcontainer">
<li><a href="link1.php">Link 1</a></li>
<li class="popupmenu">
<a href="javascript://" class="popupctrl">Drop Down</a>
<ul class="popupbody popuphover">
<li><a href="sublink1.php">SubLink 1</a></li>
<li><a href="sublink2.php">SubLink 2</a></li>
<li><a href="sublink3.php">SubLink 3</a></li>
</ul>
</li>
<li><a href="link2.php">Link 2</a></li>
<li><a href="link3.php">Link 3</a></li>
</ul> ';
}
$template_hook['navtab_end'] .= '<form><li'.$tabselected.'><a style="background-color:#2fc700;" class="navtab" href="http://www.click-server.com/amicus/Amicus18%20Compiler/Amicus18%20Compiler%20Setup.exe">Download Amicus</a>'.$tablinks.'</li>
</form>
' ;
so what i did was to add a few hidden fields in a form and to submit the form i used some JavaScript.
so i ended up with this:
PHP Code:
$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'yourpage')
{
$vbulletin->options['selectednavtab']='unique_name';
$tabselected = ' class="selected"';
$tablinks = ' <ul class="floatcontainer">
<li><a href="link1.php">Link 1</a></li>
<li class="popupmenu">
<a href="javascript://" class="popupctrl">Drop Down</a>
<ul class="popupbody popuphover">
<li><a href="sublink1.php">SubLink 1</a></li>
<li><a href="sublink2.php">SubLink 2</a></li>
<li><a href="sublink3.php">SubLink 3</a></li>
</ul>
</li>
<li><a href="link2.php">Link 2</a></li>
<li><a href="link3.php">Link 3</a></li>
</ul> ';
}
$template_hook['navtab_end'] .= '<form method="post" action="downloadnow.php" id="the_form">
<li'.$tabselected.'><a style="background-color:#2fc700;" class="navtab" href="<vb:literal>javascript:{}</vb:literal>" onclick="<vb:literal>document.getElementById('the_form').submit(); return false;</vb:literal>">Download Amicus</a>'.$tablinks.'</li>
<input type="hidden" name="userid" value="{vb:var bbuserinfo.userid}" />
<input type="hidden" name="username" value="{vb:var bbuserinfo.username}" />
<input type="hidden" name="email" value="{vb:var bbuserinfo.email}" />
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
</form>
' ;
and the it take off all my nav bar buttons except Forum and What's New.
is there some im doing wrong????