MyBB Hacks

Full Version: menu dropdown
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
does anyone have a good method for a menu drop down that'll work in all browsers..ie6, 7, 8, firefox, safari & google chrome.  I use a drop down now, but it doesn't work properly in chrome.
I have a really simple little drop down on LeeFish. Its only one level deep, but its ok in all IE6, Opera, Safari, FireFox and Chrome.

If its what you want I can tell you how I made it. Its mainly template edits ....

http://www.leefish.nl/mybb/portal.php
(08-09-2010 12:49 AM)leefish Wrote: [ -> ]I have a really simple little drop down on LeeFish. Its only one level deep, but its ok in all IE6, Opera, Safari, FireFox and Chrome.

If its what you want I can tell you how I made it. Its mainly template edits ....

http://www.leefish.nl/mybb/portal.php

that's exactly what I'm looking for...
Its using the built in mybb popup menu code: RateU showed me how to do it. I am busy with another thing right now, but I will post the template edits for you tomorrow if that is ok.
(08-09-2010 07:17 AM)leefish Wrote: [ -> ]Its using the built in mybb popup menu code: RateU showed me how to do it. I am busy with another thing right now, but I will post the template edits for you tomorrow if that is ok.

no worries...

if he helped you on here and you got a link where he helped you..link me to it and I'll try to figure it out.
Hi there, this is the code I use in my dropdown menu:

Code:
<br />
<div>
			<strong><span><a href="#" id="forumlink_{$memprofile['uid']}">Site Areas&nbsp;<img src="{$mybb->settings['bburl']}/mybb/images/NewFish/thing.gif" alt="Click to View Site Links"/></a></span></strong>
				<div id="forumlink_{$memprofile['uid']}_popup" class="popup_menu" style="display: none;"><span></span>				
					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/portal.php" class="popup_item"><span class="smalltext">Home Page</span></a>
					</div>
			                <div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/index.php" class="popup_item"><span class="smalltext">All Areas</span></a>
					</div>
                                        <div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/forumdisplay.php?fid=1" class="popup_item"><span class="smalltext">The Bowl</span></a>
					</div>

					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/forumdisplay.php?fid=6" class="popup_item"><span class="smalltext">SimFish</span></a>
					</div>

					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/forumdisplay.php?fid=3" class="popup_item"><span class="smalltext">Random Fish</span></a>
					</div>

					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/forumdisplay.php?fid=9" class="popup_item"><span class="smalltext">Code Fish</span></a>
					</div>
					<div class="popup_item_container">
						<a href="{$mybb->settings['bburl']}/mybb/games.php" class="popup_item"><span class="smalltext">Games Section</span></a>
					</div>
						
	        		</div>
					<script type="text/javascript">

					<!--

					new PopupMenu("forumlink_{$memprofile['uid']}");

					// -->

					</script>
			</div>


You will see that I use "forumlink" 3 times in this code; you can call your link whatever you like, but it must be called the same in all 3 instances.

I have this as a separate template which is linked to my header. If you wanted it in the default header you would have this:

Code:
<div id="container">
		<a name="top" id="top"></a>
		<div id="header">
			<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>
			<div class="menu">
				<ul>
					<li><a href="{$mybb->settings['bburl']}/search.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></li>
					<li><a href="{$mybb->settings['bburl']}/memberlist.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/memberlist.gif" alt="" title="" />{$lang->toplinks_memberlist}</a></li>
					<li><a href="{$mybb->settings['bburl']}/calendar.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/calendar.gif" alt="" title="" />{$lang->toplinks_calendar}</a></li>
					<li><a href="{$mybb->settings['bburl']}/misc.php?action=help"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/help.gif" alt="" title="" />{$lang->toplinks_help}</a></li>
				</ul>
			</div>
			<hr class="hidden" />
			<div id="panel">
				{$welcomeblock}
			</div>
		</div>
<table><tr>
	<td>{$site_links}</td>
	<td>{$help_links}</td>
</tr></table>
		<hr class="hidden" />
		<br class="clear" />
		<div id="content">
			{$pm_notice}
			{$bannedwarning}
			{$bbclosedwarning}
			{$unreadreports}
			<navigation>
			<br />


By adding more templates and linking to them then you can have a list across your header like mine.

I use the global templates plugin for this (I think you can do it with php in templates and template conditionals but I can't work that out). The global templates plugin does work with 1.6. Alternatively you can just put the code in from the first codeblock I posted where it says {$site_links} in the second codeblock.

I was typing - sadly, RateU closed the forum where his neat tutorial for this was posted - maybe he has a copy of it. He explains better than me.

Hmm, I should add that you can have multiple drop downs on the pages etc but each one must have its own name - so once you have used forumlink you cant use that one again. Call the next one helplink (use helplink in all three instances), then memberlink etc etc.

I'll give that a try tonight, leefish..thanks!
Lee,

how would I get the 'drop down' on the same row as the standard top links like search, help, memberlist, etc..
(08-09-2010 02:34 PM)Shemo Wrote: [ -> ]Lee,

how would I get the 'drop down' on the same row as the standard top links like search, help, memberlist, etc..

You have to add the same code (provided by Lee above ^) in header template.
Hi Shemo, you can do it like this, but in my layout I got rid of the standard links:

Code:
<div id="container">
		<a name="top" id="top"></a>
		<div id="header">
			<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>
<table><tr>
	<td>{$site_links}</td>
	<td>{$featured}</td>
	<td>{$dl_links}</td>
	<td>{$help_link}</td>
	<td><a href="{$mybb->settings['bburl']}/misc.php?action=help"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/help.gif" alt="" title="" />{$lang->toplinks_help}</a></td>
	<td><a href="{$mybb->settings['bburl']}/calendar.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/calendar.gif" alt="" title="" />{$lang->toplinks_calendar}</a></td>
	<td><a href="{$mybb->settings['bburl']}/memberlist.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/memberlist.gif" alt="" title="" />{$lang->toplinks_memberlist}</a></td>
	<td><a href="{$mybb->settings['bburl']}/search.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></td>				
</tr></table>
			<hr class="hidden" />
			<div id="panel">
				{$welcomeblock}
			</div>
		</div>
		<hr class="hidden" />
		<br class="clear" />
		<div id="content">
			{$pm_notice}
			{$bannedwarning}
			{$bbclosedwarning}
			{$unreadreports}
			<navigation>
			<br />

Pages: 1 2
Reference URL's