vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Administrative Tools Dropdown (https://vborg.vbsupport.ru/showthread.php?t=106658)

01-28-2006 10:00 PM

Administrative Tools Dropdown
 
Administrative Tools Dropdown Menu

What it does: Adds a dropdown menu visible only to the Administrator group for Admin tools and related links.

Time to install: 5 Minutes
Difficulty: Easy
Templates: 1
Phrases: 1

Step 1:

AdminCP -> Languages & Phrases -> Phrase Manager -> Add New Phrase
Phrase Type: Global
Product: vBulletin
Varname: navadmin
Text: Admin Tools

Step 2:

Style & Templates -> Style Manager -> (Your Style) -> Edit Templates -> Navigation / Breadcrumb Templates -> navbar

Find:
Code:

<td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td>
Add AFTER:

Code:

<!-- Admin Menu -->
<if condition="$show['admincplink']">
        <if condition="$show['popups']">
        <!-- start vBMenu control element -->
                <td class="vbmenu_control" id="AdminMenu">
                <a STYLE="text-decoration:none" href="#">$vbphrase[navadmin]</a>
                <script type="text/javascript">
                <!--
                vbmenu_register("AdminMenu");
                //-->
                </script>
                </td> 
        <!-- end vBMenu control element -->
          </if>
</if>
<!-- /Admin Menu -->

Find:

Code:

<!-- / NAVBAR POPUP MENUS -->
Add ABOVE:

Code:

<!-- Admin Tools Menu Element -->
<if condition="$show['admincplink']">
        <div class="vbmenu_popup" id="AdminMenu_menu" style="display:none">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr><td class="thead">Admin Tools</span></td></tr>
                <tr><td class="vbmenu_option"><a href="http://option1">First Option</a></td></tr>
                <tr><td class="vbmenu_option"><a href="http://option2">Second Option</a></td></tr>
                <tr><td class="vbmenu_option"><a href="http://option3">Third Option</a></td></tr>
                </table>
        </div>
</if>
<!-- /Admin Tools Menu Element -->

Change http://option1/2/3 to the full URL of the option you'd like to link. For example, if you wanted to put a link to the AdminCP in the dropdown, the code would be:

Code:

<tr><td class="vbmenu_option"><a href="http://www.yourdomain.tld/forum/admincp/index.php">Admin CP</a></td></tr>
"First/Second/Third Option" is simply the text displayed in the dropdown, edit it to suit whatever it is you're linking to. I personally don't use this for the AdminCP, but I find it useful for linking to PSIStats, Moderator Statistics and my VPS Server's Control Panel.

Screenshot attached.

Please Click https://vborg.vbsupport.ru/ if you are using this. Thanks!

Allan 01-29-2006 10:13 PM

Nice idea ;)

Lizard King 01-29-2006 10:32 PM

Just a quick question what is different then regular dynamic pop-up menus ?

Nothing

Guest210212002 01-29-2006 11:25 PM

Quote:

Originally Posted by Lizard King
Just a quick question what is different then regular dynamic pop-up menus ?

Nothing

Well if you want to nitpick, the difference is the conditional, and the fact that I didn't see anything like this posted on here.

Not every hack has to be revolutionary dude. I find this handy, so I took the time to post it up and share it with the community. If this makes one single person's life easier, my time spent putting it together was well spent.

Tony G 01-30-2006 12:31 AM

Thanks for sharing your mod. Could you also attach your instructions in a .txt file? Thanks.

TTG 01-30-2006 12:31 AM

Simple but useful, thanks Chris-777
Clicked install

Guest210212002 01-30-2006 01:02 AM

Quote:

Originally Posted by Tony G
Thanks for sharing your mod. Could you also attach your instructions in a .txt file? Thanks.

Whoops! Pardon that, edited. :)

Trana 01-30-2006 12:47 PM

This is a great mini hack for those of us that can't do any of our own code.

I am using this as an option in my existing drop downs in order to get to my Administration forum:

<!-- Admin Menu -->
<if condition="in_array($bbuserinfo['usergroupid'], array(7))">
<tr><td class="vbmenu_option">
<a href="/forum/forumdisplay.php?f=3">Administration</a>
</td></tr>
</if>
<!-- /Admin Menu -->

However, it only works for members who are ONLY in the Moderator group (#7). It doesn't seem to work for the accounts that are both Admins and Moderators (6+7). Is there any way to fix this?

Thanks!

Guest210212002 01-30-2006 01:02 PM

Yep, change:

Code:

<if condition="in_array($bbuserinfo['usergroupid'], array(7))">
To:

Code:

<if condition="in_array($bbuserinfo['usergroupid'], array(6, 7))">
:)

Guest210212002 01-30-2006 01:22 PM

You can do it this way as well. I only use the array because of personal preference.

Code:

<if condition="$bbuserinfo['usergroupid'] == 6 OR $bbuserinfo['usergroupid'] == 7">
or
Code:

<if condition="is_member_of($bbuserinfo, 6, 7)">

Trana 01-30-2006 02:40 PM

The last one looks the cleanest.

Thanks again!

Guest210212002 01-30-2006 04:23 PM

Anytime. :)

[high]* Guest210212002 eyes the install button[/high]

Snake 01-30-2006 07:10 PM

Oh lovely!

GatorV 01-31-2006 11:53 PM

Code:

<!-- Admin Tools Menu Element -->
        <div class="vbmenu_popup" id="AdminMenu_menu" style="display:none">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr><td class="thead">Admin Tools</span></td></tr>
                <tr><td class="vbmenu_option"><a href="http://option1">First Option</a></td></tr>
                <tr><td class="vbmenu_option"><a href="http://option2">Second Option</a></td></tr>
                <tr><td class="vbmenu_option"><a href="http://option3">Third Option</a></td></tr>
                </table>
        </div>
<!-- /Admin Tools Menu Element -->

Won't this enable too see the links if they view source code, no matter what usergroup are no?

I ask this because I installed this to put a dropdown to some special search tools, and if anyone does right click and view source can get the links...

Guest210212002 02-01-2006 01:59 AM

That's a great point, and wrapping the bottome code in a conditional is something I overlooked, thank you! This is a better way to do it.

Original post is updated with the new code.

To fix your existing navbar template:

Find:
Code:

<if condition="in_array($bbuserinfo['usergroupid'], array(7))">
Replace with:
Code:

<if condition="$show['admincplink']">
Find:
Code:

<!-- Admin Tools Menu Element -->
Add Below:

Code:

<if condition="$show['admincplink']">
Find:
Code:

<!-- /Admin Tools Menu Element -->
Add above:
Code:

</if>

Luggruff 02-06-2006 08:34 AM

hmm, now that the <if condition="in_array($bbuserinfo['usergroupid'], array(7))"> and such is gone, and I suck at coding.. how can I set more than the admin usergroup?
Like if I want it to show for moderators too.. (6 and 7)?
Or if I want a seperate menu for mods and one for admins?

Edit: Fixed.

Just replaced the <if condition="$show['admincplink']"> with <if condition="in_array($bbuserinfo['usergroupid'], array(7))"> again. No one can see the code anyways now. Just the <!-- Admin content menu --> but nothing in between.

Omranic 02-07-2006 10:40 AM

nice


All times are GMT. The time now is 04:06 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01927 seconds
  • Memory Usage 1,766KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (16)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (17)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete