Log in

View Full Version : MAU CP in navbar


SuperFly
01-14-2006, 10:00 PM
What it does is lets you pick from User CP, Mod CP or Admin CP from your navbar.

In Navbar Find
<if condition="$show['member']">
<td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
</if>

And Replace with
<script type="text/javascript">function goto_cp(){window.location=document.getElementById( "select_cp_link").options[document.getElementById("select_cp_link").selected Index].value;}</script><if condition="$show['admincplink']"><td class="vbmenu_control" style="position:relative;right:3px;"><select id="select_cp_link"><option selected="selected" value="/usercp.php">$vbphrase[user_cp]</option><option value="/modcp/index.php">Moderator CP</option><option value=/admincp/index.php>Administrator CP </option></select><input type="button" style="font-size:10pt;font-family:courier;position:relative;bottom:3px;" value="Go" onclick="goto_cp()" /></td><else /><if condition="$show['modcplink']"><td class="vbmenu_control" style="position:relative;right:3px;"><select id="select_cp_link"><option selected="selected" value="/usercp.php">$vbphrase[user_cp]</option><option value="/modcp/index.php">Moderator CP </option></select><input type="button" style="font-size:10pt;font-family:courier;position:relative;bottom:3px;" value="Go" onclick="goto_cp()" /></td></if><else /><if condition="$show['member']"><td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td></if></if>

rb290
01-15-2006, 09:38 PM
thanks, but the "Go" button isnt aligned nice, how can i fix that ?

croportal
01-15-2006, 10:43 PM
position:relative;bottom:3px;" value="Go" i think here

Yorixz
01-16-2006, 06:03 AM
If you change the "3px" to "1px" it should be ok I guess.

Detomah
01-16-2006, 01:01 PM
I don't want to sound ungreatful as this is such a good and simple addon with much practicality and one which I really hope I can make use of....

But...

Would it not have been better to get it to simply use the vb menu control instead of being a drop down menu? It would fit into the global scheme of the nav bar much better if it could.

Something along the lines of:

This for the navbar link bits


<if condition="$show['admincplink']">
<td id="usercplistadmin" class="vbmenu_control"><a href="$show[nojs_link]#usercplistadmin">Control Panels</a><script type="text/javascript"> vbmenu_register("usercplistadmin"); </script></td>
<else />
<if condition="$show['modcplink']">
<td id="usercplistmod" class="vbmenu_control"><a href="$show[nojs_link]#usercplistmod">Control Panels</a><script type="text/javascript"> vbmenu_register("usercplistmod"); </script></td>
<else />
<if condition="$show['member']">
<td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
</if>
</if>


and this for the popup menu bits:


<if condition="$show['admincplink']">
<!-- user cp list admin menu -->
<div class="vbmenu_popup" id="usercplistadmin_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="vbmenu_option"><a href="/forum/$admincpdir/index.php?$session[sessionurl]">$vbphrase[admin]</a></td></tr>
<tr><td class="vbmenu_option"><a href="/forum/$modcpdir/index.php?$session[sessionurl]">$vbphrase[mod]</a></td></tr>
<tr><td class="vbmenu_option"><a href="usercp.php$session[sessionurl_q]">Administrator CP</a></td></tr>
</table>
</div>
<!-- / user cp list admin menu -->
</if>
<if condition="$show['modcplink']">
<!-- user cp list mod menu -->
<div class="vbmenu_popup" id="usercplistmod_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<td id="usercplistadmin" class="vbmenu_control"><a href="$show[nojs_link]#usercplistadmin">Control Panels</a><script type="text/javascript"> vbmenu_register("usercplistadmin"); </script></td>
<tr><td class="vbmenu_option"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td></tr>
<tr><td class="vbmenu_option"><a href="/forum/$modcpdir/index.php?$session[sessionurl]">$vbphrase[mod]</a></td></tr>
</table>
</div>
<!-- / user cp list mod menu -->
</if>


That's only a really rough working of it though.

I certainly don't mean to be stepping on toes here, so sorry if it wasn't wanted. If you can use it though, feel free.