News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

(Tip) Simplemachines.org DropDown Menu for 1.1.x

Started by Hoochie Coochie Man, October 27, 2008, 11:19:34 AM

Previous topic - Next topic

Hoochie Coochie Man



Live Demo
UserName: Test
Password: 123456

Narration: for default theme
Compatible With: IE6, IE7, Firefox, Opera, Safari, Google Chrome




index.template.php
Code (find) Select
</head>
<body>';

Code (replace) Select
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/ddlevelsfiles/ddlevelsmenu-base.css" />
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/ddlevelsfiles/ddlevelsmenu-topbar.css" />
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/ddlevelsfiles/ddlevelsmenu-sidebar.css" />
<script language="JavaScript" type="text/javascript" src="', $settings['theme_url'], '/ddlevelsfiles/ddlevelsmenu.js"></script>';

/***********************************************
* All Levels Navigational Menu- (c) Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

echo '
</head>
<body>';


Code (find) Select
</table>
</div>';


// Show the menu here, according to the menu sub template.
template_menu();

Code (replace) Select
</table>';

// Show the menu here, according to the menu sub template.
template_menu();

echo '</div>';


Code (find) Select
// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
</td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
</td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
</td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>
</tr>
</table>';

Code (replace) Select
echo '
<div id="ddtopmenubar" class="mattblackmenu">
<ul>';

// Show the [home] button.
echo '<li', $current_action == 'home' ? ' class="current_page"' : '', '><a href="', $scripturl, '">' , $txt[103] , '</a></li>';

// Show the [help] button.
echo '<li', $current_action == 'help' ? ' class="current_page"' : '', '> <a href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';

// How about the [search] button?
if ($context['allow_search'])
echo '<li', $current_action == 'search' ? ' class="current_page"' : '', '><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '<li', $current_action == 'admin' ? ' class="current_page"' : '', '><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></li>';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '<li', $current_action == 'profile' ? ' class="current_page"' : '', '><a href="', $scripturl, '?action=profile" rel="ddsubmenu1">' , $txt[79] , '</a></li>';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo '<li', $current_action == 'pm' ? ' class="current_page"' : '', '><a href="', $scripturl, '?action=pm" rel="ddsubmenu2">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';

// The [calendar]!
if ($context['allow_calendar'])
echo '<li', $current_action == 'calendar' ? ' class="current_page"' : '', '><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></li>';

// the [member] list button
if ($context['allow_memberlist'])
echo '<li', $current_action == 'mlist' ? ' class="current_page"' : '', '><a href="', $scripturl, '?action=mlist" rel="ddsubmenu3">' , $txt[331] , '</a></li>';

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '<li', $current_action == 'login' ? ' class="current_page"' : '', '><a href="', $scripturl, '?action=login">' , $txt[34] , '</a></li>';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '<li', $current_action == 'register' ? ' class="current_page"' : '', '><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></li>';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '<li', $current_action == 'logout' ? ' class="current_page"' : '', '><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>';




echo '
</ul>
</div>

<script type="text/javascript">
ddlevelsmenu.setup("ddtopmenubar", "topbar") //ddlevelsmenu.setup("mainmenuid", "topbar|sidebar")
</script>

<!--HTML for the Drop Down Menus associated with Top Menu Bar-->
<!--They should be inserted OUTSIDE any element other than the BODY tag itself-->
<!--A good location would be the end of the page (right above "</BODY>")-->';

echo '
<!--Top Drop Down Menu 1 HTML-->
<ul id="ddsubmenu1" class="ddsubmenustyle">
<li><a href="', $scripturl, '?action=profile">' , $txt['hcm_summary'] , '</a></li>
<li><a href="', $scripturl, '?action=profile;sa=account">' , $txt['hcm_account'] , '</a></li>
<li><a href="', $scripturl, '?action=profile;sa=forumProfile">' , $txt['hcm_forumProfile'] , '</a></li>
</ul>';

echo '
<!--Top Drop Down Menu 2 HTML-->
<ul id="ddsubmenu2" class="ddsubmenustyle">
<li><a href="', $scripturl, '?action=pm">' , $txt['hcm_readmessages'] , '</a></li>
<li><a href="', $scripturl, '?action=pm;sa=send">' , $txt['hcm_sendmessage'] , '</a></li>
</ul>';

echo '
<!--Top Drop Down Menu 3 HTML-->
<ul id="ddsubmenu3" class="ddsubmenustyle">
<li><a href="', $scripturl, '?action=mlist">' , $txt['hcm_viewmembers'] , '</a></li>
<li><a href="', $scripturl, '?action=mlist;sa=search">' , $txt['hcm_searchmembers'] , '</a></li>
</ul>';


Modifications.english.php
Code (find) Select
?>
Code (add before) Select
$txt['hcm_summary'] = 'Summary';
$txt['hcm_account'] = 'Account Settings';
$txt['hcm_forumProfile'] = 'Forum Profile';
$txt['hcm_readmessages'] = 'Read Your Messages';
$txt['hcm_sendmessage'] = 'Send A Message';
$txt['hcm_viewmembers'] = 'View The Memberlist';
$txt['hcm_searchmembers'] = 'Search For Members';


And upload attached file to your theme folder.
Example: www.sitename/forum/Themes/default/ddlevelsfiles

Open ddlevelsmenu.js with a notepad:
Find:
Quotedownarrowpointer: ["http://www.sitename.com/forum/Themes/default/images/sort_down.gif", 12,12], //path to "down arrow" image that gets added to main menu items (last 2 parameters should be width/height of img)
rightarrowpointer: ["http://www.sitename.com/forum/Themes/default/images/selected.gif", 12,12], //path to "right arrow" image that gets added to LI elements within drop down menu containing additional menus
Change www.sitename.com
İnadına SMF 1.1.X

Hoochie Coochie Man

+ Fixed an IE6 problem
+ uploaded new ddlevelsmenu-base.css file
İnadına SMF 1.1.X

Jakki

Okay question, so if we use this do we still have to change the CSS style sheet as the other one indicated?

Jakki

#3
Nevermind my previous question....

I do have a rather unique question..
I want to add a "FUN STUFF" button  I don't want it functional, all I want it for is so that the arcade, gallery, blogging to show up under it.

I have the submenu's in place for the arcade, etc. I just don't know how to make the button itself..

How do I make it show it just has the drop down menu?

Jakki

Okay I got the thing figured out thanks to a friend....

dark_warriorxx8

Foro: Smf + Portal: SimplePortal. //ultima version smf 2.0

dark_warriorxx8

as I add more names to link on the menu and also add more sub categories within other menu buttons?
Foro: Smf + Portal: SimplePortal. //ultima version smf 2.0

Advertisement: