Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: Yigal in August 04, 2009, 02:30:32 VORMITTAG

Titel: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in August 04, 2009, 02:30:32 VORMITTAG
Tip/Trick: Centering Your Navigation Menu Bar
Description: A Simple Edit to your Index template file to center your navigation bar :)
A Note To Everyone Who Is Packaging This Edit:  Already packaged

---------------------------------------------------------------------
For 1.x
---------------------------------------------------------------------

Index.template.php:

Find:


// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">


Replace with:


// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" align="center">



---------------------------------------------------------------------
For 2.x
---------------------------------------------------------------------

Index.template.php:

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


Replace With:
// Show the menu here, according to the menu sub template.
echo '   
   <div style="width:50%; margin:0 auto;">',template_menu(),'</div>';


Zitat von: Antechinus in August 15, 2009, 01:17:09 VORMITTAG
Ok, here is the best way of doing it for the 2.0 Core theme.

If you use this method the menu will stay perfectly centered regardless of how many tabs you have displayed or how wide your screen is.

Note that this method will also work with list-based menus in other themes, but it will not work if you are also using css-based drop menus.

This is only for single level menus without drop menus. Because of this it will not work with Curve when Curve becomes the default theme in RC2.

Anyway for the RC1 Core theme:

Index.template.php:

Find:

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="clearfix">';


Replace with:

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="clearfix">
    <li class="main_menu_first">&nbsp;</li>';



Css/index.css:

Find:

#main_menu
{
padding-left: 1em;
}
#main_menu ul
{
list-style: none;
padding: 0;
margin: 0;
background: url(../images/maintab_first.gif) no-repeat bottom left;
padding-left: 10px;
}
#main_menu li
{
margin: 0;
padding: 0;
display: inline;
}
#main_menu li a
{
float: left;
display: block;
color: white;
font-size: 0.8em;
font-family: tahoma, sans-serif;
text-transform: uppercase;
}
#main_menu li a:hover
{
color: #e0e0ff;
text-decoration: none;
}
#main_menu li a span
{
background: url(../images/maintab_back.gif) repeat-x bottom left;
display: block;
padding: 0.1em 0.5em 0.5em 0.5em;
}
#main_menu li.last a span
{
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0.1em 1em 0.5em 0.5em;
}
#main_menu li.active a span em
{
padding: 0.1em 0.5em 0.5em 0.5em;
display: block;
font-style: normal;
background: url(../images/maintab_active_back.gif) repeat-x bottom right;
}
#main_menu li.active a span
{
background: url(../images/maintab_active_first.gif) no-repeat bottom left;
padding: 0 0 0 8px;
}
#main_menu li.last.active
{
float: left;
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0 8px 0 0;
}
#main_menu li.active a
{
background: url(../images/maintab_active_last.gif) no-repeat bottom right;
padding-right: 8px;
}


Replace with:

#main_menu {
   float:left;
   width:100%;
   background: none;
   overflow:hidden;
   position:relative;
}
#main_menu ul {
   clear:left;
   float:left;
   list-style:none;
   margin:0;
   padding:0;
   position:relative;
   left:50%;
   text-align:center;
}
li.main_menu_first {
   width: 8px;
   height: 20px;
   background: url(../images/maintab_first.gif) no-repeat bottom left;
}
#main_menu ul li {
   display:block;
   float:left;
   list-style:none;
   margin:0;
   padding:0;
   position:relative;
   right:50%;
}
#main_menu ul li a {
   display:block;
   color: white;
   font-size: 0.8em;
   font-family: tahoma, sans-serif;
   text-transform: uppercase;
}
#main_menu li a span
{
background: url(../images/maintab_back.gif) repeat-x bottom left;
display: block;
padding: 0.1em 0.5em 0.5em 0.5em;
}
#main_menu li.last a span
{
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0.1em 1em 0.5em 0.5em;
}
#main_menu li.active a span em
{
padding: 0.1em 0.5em 0.5em 0.5em;
display: block;
font-style: normal;
background: url(../images/maintab_active_back.gif) repeat-x bottom right;
}
#main_menu li.active a span
{
background: url(../images/maintab_active_first.gif) no-repeat bottom left;
padding: 0 0 0 8px;
}
#main_menu li.last.active
{
float: left;
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0 8px 0 0;
}
#main_menu li.active a
{
background: url(../images/maintab_active_last.gif) no-repeat bottom right;
padding-right: 8px;
}


This method originally comes from this web page: matthewjamestaylor.com/blog (http://matthewjamestaylor.com/blog/beautiful-css-centered-menus-no-hacks-full-cross-browser-support) Screenshots of the result are attached.  ;)



Also, if someone could move this to Tips/Tricks board, that would be great ;)
Titel: Re: [Tip/Trick] Center Nav Menu Bar
Beitrag von: Reflection in August 05, 2009, 01:26:36 NACHMITTAGS
Could you please provide instructions for SMF 2.0. I'm sure a lot of people would find that more useful.  :P
Titel: Re: [Tip/Trick] Center Nav Menu Bar
Beitrag von: Yigal in August 05, 2009, 01:56:50 NACHMITTAGS
Working on it ;)
Titel: Re: [Tip/Trick] Center Nav Menu Bar
Beitrag von: Mark S in August 08, 2009, 08:17:38 NACHMITTAGS
How about for v2.0  RC1.2?
Titel: Re: [Tip/Trick] Center Nav Menu Bar
Beitrag von: Faevilangel in August 08, 2009, 08:32:25 NACHMITTAGS
to do it in smf rc2

index.template.php

find

// Show the menu here, according to the menu sub template.
echo '<div style="width="50%;float:right;';
template_menu();
  echo '</div>';


replace with

// Show the menu here, according to the menu sub template.
echo '<div style="width="50%;margin:auto;';
template_menu();
  echo '</div>';


all i did was remove float:right; and added margin:auto;
Titel: Re: [Tip/Trick] Center Nav Menu Bar
Beitrag von: Yigal in August 08, 2009, 08:38:33 NACHMITTAGS
Thanks...I'm going to add that to the first post :P
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Mark S in August 09, 2009, 01:09:08 VORMITTAG
Well, unfortunately, it didn't work for me.

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<div id="random_news"><h3>', $txt['news'], ':</h3><p>', $context['random_news_line'], '</p></div>';

echo '
</div>
</div>';


// Show the menu here, according to the menu sub template.
echo '<div style="width="50%;margin:auto;';
template_menu();
  echo '</div>';

//Below the menu ads
if (function_exists("show_indexAds") && function_exists("show_towerleftAds") && function_exists("show_towerrightAds"))
{
$ads = show_indexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);



Inserted the code so you can see what's in my file.  Maybe this will give a clue.

The site is www.classicwinnebagos.com

Thanks
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: feline in August 09, 2009, 02:13:08 NACHMITTAGS
Zitat von: ThePharaoh in August 09, 2009, 01:09:08 VORMITTAG
Well, unfortunately, it didn't work for me.
Change this:
// Show the menu here, according to the menu sub template.
   echo '<div style="width="50%;margin:auto;';


to:
// Show the menu here, according to the menu sub template.
   echo '<div style="width:50%;margin:auto;">';


Fel
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in August 09, 2009, 10:05:52 NACHMITTAGS
Has this issue been resolved?
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Mark S in August 09, 2009, 10:16:26 NACHMITTAGS
I had to change the 50% to 90% for some reason because everything wanted to pile up on itself in the middle.  That may be because have a lot of menu tabs.  It's still aligned to the left some, but it's relatively centered so, that's the code which works.  Don't know what to do with it beyond that to get it correctly centered.

Thanks a bunch!

Update:  I used some variations of the 50% and found that, depending on the width of your navbar, you can adjust this and achieve correct center alignment.  85% is what worked for me.  I assume that, if you add or delete tabs, you'll need to adjust that percentage.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in August 09, 2009, 10:35:19 NACHMITTAGS
Edit: I updated the codes :)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: busterone in August 09, 2009, 10:44:34 NACHMITTAGS
Very odd to me is that my 2rc1.2 does not have all of that in index.template.php for any of my themes, not even default core. What I have is this-  I would like to center a couple of them myself, including the default.

echo '
</div>
</div>';


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

// Show the navigation tree.
theme_linktree();

// The main content should go here.
echo '
<div id="bodyarea">';
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in August 09, 2009, 11:32:19 NACHMITTAGS
Find
   // Show the menu here, according to the menu sub template.
   template_menu();


Replace
// Show the menu here, according to the menu sub template.
   echo '<div style="width="50%;margin:auto;';
   template_menu();
  echo '</div>';
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: busterone in August 09, 2009, 11:40:35 NACHMITTAGS
already tried that, but it doesn't work for me. I cleared cache, hit refresh half a dozen times, no go. The menu is still to the left. No big deal. It is not that important to me anyway. Thanks.  :)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: bbmtalk in August 10, 2009, 12:03:41 VORMITTAG
Try this one.

// Show the menu here, according to the menu sub template.
   echo '<center>', template_menu(), '</center>';
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: busterone in August 10, 2009, 12:19:26 VORMITTAG
Nope, sorry, I tried that too. It must be something in the css file preventing it. I will look at that later, it is late for me. Thanks anyway.  :)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in August 10, 2009, 12:23:32 VORMITTAG
Sorry we couldn't help you out.  Maybe someone will come up with a code :)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Mark S in August 12, 2009, 08:39:22 NACHMITTAGS
Zitat von: busterone in August 09, 2009, 11:40:35 NACHMITTAGS
already tried that, but it doesn't work for me. I cleared cache, hit refresh half a dozen times, no go. The menu is still to the left. No big deal. It is not that important to me anyway. Thanks.  :)

I notice you didn't try changing the ="width:50%... read my post above.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Antechinus in August 12, 2009, 09:04:16 NACHMITTAGS
Umm, Yigal, your code for 2.0 is wrong. Feline has already posted the correct version and people keep ignoring it. Please correct your OP if you want to post code in Tips and Tricks. Kthnx.

http://www.simplemachines.org/community/index.php?topic=328766.msg2203628#msg2203628

I apologise to members who have been having trouble with this. The staff should have checked that code before now.

For anyone who really wants to get a perfectly centered menu on 2.0 regardless of the number of tabs the following link is the best way to do it.
Works with any list-based menus but be warned that it will make a mess of css-based drop menus. Only use it if you are running the default single level RC1 menu.

http://matthewjamestaylor.com/blog/beautiful-css-centered-menus-no-hacks-full-cross-browser-support

Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in August 12, 2009, 09:55:00 NACHMITTAGS
Edited ?
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Arantor in August 13, 2009, 06:06:05 VORMITTAG
No, the instructions for 2.0 are still showing a " in the middle where there shouldn't be one.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Antechinus in August 13, 2009, 05:18:14 NACHMITTAGS
Yigal, this:

Zitat
For 2.x
---------------------------------------------------------------------

Index.template.php:

Find:
// Show the menu here, according to the menu sub template.
   echo '<div style="width="50%;margin:auto;';


Replace With:
// Show the menu here, according to the menu sub template.
   echo '<div style="width:50%;margin:auto;">';


needs to be changed to this:

Zitat
For 2.x
---------------------------------------------------------------------

Index.template.php:

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


Replace With:
// Show the menu here, according to the menu sub template.
echo '
<div style="width:50%; margin:0 auto;">',template_menu(),'</div>';

You can't just drop the opening tag for the div in front of the template_menu() without also closing the div after the template. You will get errors if you do that. It is also best to set the margin as 0 auto rather than just auto.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in August 13, 2009, 09:30:57 NACHMITTAGS
Calm down guys -_-' ... I'm getting to it.  Oh and thanks :P
Titel: Re: [Tip/Trick] Center Nav Menu Bar (Best method for 2.0 Core theme)
Beitrag von: Antechinus in August 15, 2009, 01:17:09 VORMITTAG
Ok, here is the best way of doing it for the 2.0 Core theme.

If you use this method the menu will stay perfectly centered regardless of how many tabs you have displayed or how wide your screen is.

Note that this method will also work with list-based menus in other themes, but it will not work if you are also using css-based drop menus.

This is only for single level menus without drop menus. Because of this it will not work with Curve when Curve becomes the default theme in RC2.

Anyway for the RC1 Core theme:

Index.template.php:

Find:

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="clearfix">';


Replace with:

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="clearfix">
    <li class="main_menu_first">&nbsp;</li>';



Css/index.css:

Find:

#main_menu
{
padding-left: 1em;
}
#main_menu ul
{
list-style: none;
padding: 0;
margin: 0;
background: url(../images/maintab_first.gif) no-repeat bottom left;
padding-left: 10px;
}
#main_menu li
{
margin: 0;
padding: 0;
display: inline;
}
#main_menu li a
{
float: left;
display: block;
color: white;
font-size: 0.8em;
font-family: tahoma, sans-serif;
text-transform: uppercase;
}
#main_menu li a:hover
{
color: #e0e0ff;
text-decoration: none;
}
#main_menu li a span
{
background: url(../images/maintab_back.gif) repeat-x bottom left;
display: block;
padding: 0.1em 0.5em 0.5em 0.5em;
}
#main_menu li.last a span
{
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0.1em 1em 0.5em 0.5em;
}
#main_menu li.active a span em
{
padding: 0.1em 0.5em 0.5em 0.5em;
display: block;
font-style: normal;
background: url(../images/maintab_active_back.gif) repeat-x bottom right;
}
#main_menu li.active a span
{
background: url(../images/maintab_active_first.gif) no-repeat bottom left;
padding: 0 0 0 8px;
}
#main_menu li.last.active
{
float: left;
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0 8px 0 0;
}
#main_menu li.active a
{
background: url(../images/maintab_active_last.gif) no-repeat bottom right;
padding-right: 8px;
}


Replace with:

#main_menu {
   float:left;
   width:100%;
   background: none;
   overflow:hidden;
   position:relative;
}
#main_menu ul {
   clear:left;
   float:left;
   list-style:none;
   margin:0;
   padding:0;
   position:relative;
   left:50%;
   text-align:center;
}
li.main_menu_first {
   width: 8px;
   height: 20px;
   background: url(../images/maintab_first.gif) no-repeat bottom left;
}
#main_menu ul li {
   display:block;
   float:left;
   list-style:none;
   margin:0;
   padding:0;
   position:relative;
   right:50%;
}
#main_menu ul li a {
   display:block;
   color: white;
   font-size: 0.8em;
   font-family: tahoma, sans-serif;
   text-transform: uppercase;
}
#main_menu li a span
{
background: url(../images/maintab_back.gif) repeat-x bottom left;
display: block;
padding: 0.1em 0.5em 0.5em 0.5em;
}
#main_menu li.last a span
{
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0.1em 1em 0.5em 0.5em;
}
#main_menu li.active a span em
{
padding: 0.1em 0.5em 0.5em 0.5em;
display: block;
font-style: normal;
background: url(../images/maintab_active_back.gif) repeat-x bottom right;
}
#main_menu li.active a span
{
background: url(../images/maintab_active_first.gif) no-repeat bottom left;
padding: 0 0 0 8px;
}
#main_menu li.last.active
{
float: left;
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0 8px 0 0;
}
#main_menu li.active a
{
background: url(../images/maintab_active_last.gif) no-repeat bottom right;
padding-right: 8px;
}


This method originally comes from this web page: matthewjamestaylor.com/blog (http://matthewjamestaylor.com/blog/beautiful-css-centered-menus-no-hacks-full-cross-browser-support) Screenshots of the result are attached.  ;)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in August 15, 2009, 01:27:34 VORMITTAG
Thanks ;)   I will add this to the top of the posts ;)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Mark S in September 07, 2009, 08:25:43 NACHMITTAGS
Ok... here's the code you referred to for always beautifully centered nav bars compatible with all browsers and requires no css hacking.... (breathe)...


<div id="centeredmenu">
   <ul>
      <li><a href="#">Tab one</a></li>
      <li><a href="#" class="active">Tab two</a></li>
      <li><a href="#">Tab three</a></li>
      <li><a href="#">Tab four</a></li>
   </ul>
</div>


I put that in place of :

<div style="width:80%; margin:0 auto;">',template_menu(),'</div>'

and... of course it didn't work.  So, what is the correct insertion for this?

Thanks!
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in September 08, 2009, 02:51:44 VORMITTAG
Have you tried these following codes?
http://www.simplemachines.org/community/index.php?topic=328766.msg2193162#msg2193162
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Antechinus in September 08, 2009, 03:09:50 VORMITTAG
Zitat von: ThePharaoh in September 07, 2009, 08:25:43 NACHMITTAGS
Ok... here's the code you referred to for always beautifully centered nav bars compatible with all browsers and requires no css hacking.... (breathe)...


<div id="centeredmenu">
   <ul>
      <li><a href="#">Tab one</a></li>
      <li><a href="#" class="active">Tab two</a></li>
      <li><a href="#">Tab three</a></li>
      <li><a href="#">Tab four</a></li>
   </ul>
</div>


I put that in place of :

<div style="width:80%; margin:0 auto;">',template_menu(),'</div>'

and... of course it didn't work.  So, what is the correct insertion for this?

Thanks!
That is just a basic html example from that page. It wont work without the required css. Complete instructions specifically for the SMF default theme are available at the end of the OP. I suggest reading them.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: aw06 in März 27, 2010, 05:19:23 NACHMITTAGS
Need to center my menu  8) See my index.template below and advise

<?php
// Version: 2.0 RC3; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '2.0 RC3';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as opposed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status separate from topic icons? */
$settings['separate_sticky_lock'] = true;

/* Does this theme use the strict doctype? */
$settings['strict_doctype'] = false;

/* Does this theme use post previews on the message index? */
$settings['message_index_preview'] = false;

/* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
$settings['require_theme_strings'] = false;
}

// The main sub template above the content.
function template_html_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''>
<head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
<meta name="keywords" content="' 
$context['meta_keywords'] . '" />' '''
<title>'
$context['page_title_html_safe'], '</title>';

// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />'
;

// Present a canonical url for search engines to prevent duplicate content in their indices.
if (!empty($context['canonical_url']))
echo '
<link rel="canonical" href="'
$context['canonical_url'], '" />';

// The ?rc3 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/css/index'$context['theme_variant'], '.css?rc3" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/print.css?rc3" media="print" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" />
<link rel="search" href="'
$scripturl'?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name_html_safe'], ' - '$txt['rss'], '" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="'
$scripturl'?board='$context['current_board'], '.0" />';

// Some browsers need an extra stylesheet due to bugs/compatibility issues.
foreach (array('ie7''ie6''webkit') as $cssfix)
if ($context['browser']['is_' $cssfix])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/'$cssfix'.css" />';

// RTL languages require an additional stylesheet.
if ($context['right_to_left'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/css/rtl.css" />';

echo '
<script type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/script.js?rc3"></script>
<script type="text/javascript" src="'
$settings['theme_url'], '/scripts/theme.js?rc3"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_default_theme_url = "'
$settings['default_theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";'$context['show_pm_popup'] ? '
var fPmPopup = function ()
{
if (confirm("' 
$txt['from'] . ' ' $context['pm_informer']['sender'] . '\\n' $txt['subject'] . ' ' $context['pm_informer']['subject'] . '\\n' $txt['show_personal_messages'] . '"))
window.open(smf_prepareScriptUrl(smf_scripturl) + "action=pm");
}
addLoadEvent(fPmPopup);' 
'''
var ajax_notification_text = "'
$txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "'
$txt['modify_cancel'], '";
// ]]></script>'
;

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'];

echo '
</head>
<body>'
;
}

function 
template_body_above()
{
global $context$settings$options$scripturl$txt$modSettings;

echo 
'
<div id="bodybg">
<div id="wrapper">
<div id="shad-l">
<div id="shad-r">
<div id="header">
<div id="head-l">
<div id="head-r">
<div id="userarea" class="smalltext">'
;
if ($context['user']['is_logged'])
{
echo '
<b>'
$txt['hello_member_ndt'], ' '$context['user']['name'], '</b><br />';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo $txt['msg_alert_you_have'], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo sprintf($txt['welcome_guest'], $txt['guest_title']);

echo '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/sha1.js"></script>
<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user"  size="10" />
<input type="password" name="passwrd"  size="10" />
<input type="submit" value="'
$txt['login'], '" />
<input type="hidden" name="hash_passwrd" value="" />
</form>'
$context['current_time'],'<br />';
}

echo '
</div>
<div id="searcharea">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '">
<input type="text" name="search" value="'
$txt['search'], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt['search'], '...\';" /> ';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</div>
<a href="'
.$scripturl.'" title=""><span id="logo">&nbsp;</span></a>';
echo '
</div>
</div>
</div>
<div id="toolbar">
'
,template_menu(),'
</div>
<div id="bodyarea">'
;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//echo 
echo '<BR>';
include 'adverts1.php';
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Show the navigation tree.
theme_linktree();
}

function 
template_body_below()
{

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//echo 
include 'adverts2.php';
echo '<BR>';
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

global $context$settings$options$scripturl$txt$modSettings;

echo '
</div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer">
<div id="foot-l">
<div id="foot-r">
<div id="footerarea">
<span class="smalltext">'
theme_copyright(), '
<br /><a href="http://www.photojamaica.net"><b>PhotoJamaica.net &copy; 2010</b></a> | Theme by <a href="http://www.dzinerstudio.com" target="_blank"><b>DzinerStudio</b></a> | '
, !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<a id="button_rss" href="' $scripturl '?action=.xml;type=rss" class="new_win"><span>' $txt['rss'] . '</span></a>' ''' | <a id="button_wap2" href="'$scripturl '?wap2" class="new_win"><span>'$txt['wap2'], '</span></a></span>';

// Show the load time?
if ($context['show_load_time'])
echo '<br /><span class="smalltext">'$txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</span>';

echo '
</div>
</div>
</div>
</div>
</div>
</div>
</div>'
;
}

function 
template_html_below()
{
global $context$settings$options$scripturl$txt$modSettings;

echo '
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
try {
_uacct = "UA-15421433-1";
urchinTracker();
} catch(err) {}</script>
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree($force_show false)
{
global $context$settings$options$shown_linktree;

// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;

echo '
<div class="navigate_section">
<ul>'
;

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li'
, ($link_num == count($context['linktree']) - 1) ? ' class="last"' '''>';

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' 
$tree['url'] . '"><span>' $tree['name'] . '</span></a>' '<span>' $tree['name'] . '</span>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' &#38;#187;';

echo '
</li>'
;
}
echo '
</ul>
</div>'
;

$shown_linktree true;
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

echo '
<div id="topmenu">
<ul>'
;

foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a '$button['active_button'] ? ' class="current"' '' ' href="'$button['href'], '"><span>'$button['title'], '</span></a></li>';

echo '
</ul>
</div>'
;

}

// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$strip_options = array())
{
global $settings$context$txt$scripturl;

if (!is_array($strip_options))
$strip_options = array();

// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '
<li><a' 
. (isset($value['id']) ? ' id="button_strip_' $value['id'] . '"' '') . ' class="button_strip_' $key '' . (isset($value['active']) ? ' active' '') . '" href="' $value['url'] . '"' . (isset($value['custom']) ? ' ' $value['custom'] : '') . '><span>' $txt[$value['text']] . '</span></a></li>';
}

// No buttons? No button strip either.
if (empty($buttons))
return;

// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>''<span class="last">'$buttons[count($buttons) - 1]);

echo '
<div class="buttonlist'
, !empty($direction) ? ' align_' $direction '''"', (empty($buttons) ? ' style="display: none;"' ''), (!empty($strip_options['id']) ? ' id="' $strip_options['id'] . '"'''), '>
<ul>'
,
implode(''$buttons), '
</ul>
</div>'
;
}

?>
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Tiribulus in April 04, 2010, 04:40:30 NACHMITTAGS
For the index.css in RC3 I don't find anything even close to this anymore. Has anybody figured this out for RC3?
Thanks
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: exnecko in April 13, 2010, 05:31:03 VORMITTAG
Is there this for download !  ??
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Arantor in April 13, 2010, 05:32:46 VORMITTAG
Tiribulus: No, I don't think anyone has. The menu is constructed differently in Curve.

exnecko: No, this is a tip you have to apply yourself rather than as a mod because on 1.1.x you can't use it anyway on custom themes and on 2.0 it's incomplete.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Antechinus in April 26, 2010, 08:16:22 VORMITTAG
Zitat von: Tiribulus in April 04, 2010, 04:40:30 NACHMITTAGS
For the index.css in RC3 I don't find anything even close to this anymore. Has anybody figured this out for RC3?
Thanks
Yes, I have. Sorted it the other day. I'm going to package it up as a mod. :)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: coldy316 in April 27, 2010, 06:07:10 VORMITTAG
Okay i'm running SMF 2.0 RC2 and just tried this and it didnt work at all. at the present moment i now
have no top menu showing. how do I solve that problem.

Its the default core one

(http://www.imagebam.com/image/1561be78143974/)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: bullbreedluverz in April 27, 2010, 09:03:32 VORMITTAG
Zitat von: coldy316 in April 27, 2010, 06:07:10 VORMITTAG
Okay i'm running SMF 2.0 RC2 and just tried this and it didnt work at all. at the present moment i now
have no top menu showing. how do I solve that problem.

Its the default core one

(http://www.imagebam.com/image/1561be78143974/)

if this is your site http://www.coldyshangout.com/index.php then you are usin curve theme not core

Zitat von: Antechinus in August 15, 2009, 01:17:09 VORMITTAG
Ok, here is the best way of doing it for the 2.0 Core theme.

If you use this method the menu will stay perfectly centered regardless of how many tabs you have displayed or how wide your screen is.

Note that this method will also work with list-based menus in other themes, but it will not work if you are also using css-based drop menus.

This is only for single level menus without drop menus. Because of this it will not work with Curve when Curve becomes the default theme in RC2.


this tip isnt for curve theme - you will need to undo the edits you made - if you kept a back up of your files before you edited them reupload the back up files otherwise you will need to undo the edits you made removing the changes you made
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: coldy316 in April 27, 2010, 11:50:53 NACHMITTAGS
Zitat von: stikkki in April 27, 2010, 09:03:32 VORMITTAG
Zitat von: coldy316 in April 27, 2010, 06:07:10 VORMITTAG
Okay i'm running SMF 2.0 RC2 and just tried this and it didnt work at all. at the present moment i now
have no top menu showing. how do I solve that problem.

Its the default core one

(http://www.imagebam.com/image/1561be78143974/)

if this is your site http://www.coldyshangout.com/index.php then you are usin curve theme not core

Zitat von: Antechinus in August 15, 2009, 01:17:09 VORMITTAG
Ok, here is the best way of doing it for the 2.0 Core theme.

If you use this method the menu will stay perfectly centered regardless of how many tabs you have displayed or how wide your screen is.

Note that this method will also work with list-based menus in other themes, but it will not work if you are also using css-based drop menus.

This is only for single level menus without drop menus. Because of this it will not work with Curve when Curve becomes the default theme in RC2.


this tip isnt for curve theme - you will need to undo the edits you made - if you kept a back up of your files before you edited them reupload the back up files otherwise you will need to undo the edits you made removing the changes you made

okay let me get this right

1. undo the edits  (which I did already)
2. re-upload the backup file  (never did a backup)

what is the standard code and can i add the standard code back.

Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Antechinus in April 28, 2010, 03:17:35 VORMITTAG
If you have undone the edits you don't need to worry about other files. If you need to find the standard code you can extract the css from an installation or upgrade pack.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: coldy316 in April 28, 2010, 03:38:28 VORMITTAG
yeah i manage to extract the css and re-up it
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Antechinus in Mai 02, 2010, 08:52:03 VORMITTAG
I've uploaded a mod that'll centre the menu for the 2.0 RC3 default theme. Haven't tested it in RTL yet but it works in LTR languages. Only browser it screws up in is Firefox 2, but nobody in their right mind uses that any more anyway. Fine in all versions of IE and in all other browsers.

Note that it isn't approved on the mod site yet, but I've tested it pretty thoroughly and it's only css edits anyway so it can't crash your site.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Antechinus in Mai 05, 2010, 06:34:34 NACHMITTAGS
Mod is approved now. Link is in my sig. FF2 bug is fixed so it's fine in all browsers (including the dreaded IE6). The mod only supports LTR languages at this stage. I'll sort RTL support when I can (IE 6 and 7 being the problem there, of course).
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: knightofdoom in Juni 10, 2010, 06:08:27 VORMITTAG
will try it out   ::)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: jasonnjon in Juni 10, 2010, 06:33:18 VORMITTAG
works for mee
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Aportadordelmix in Juni 15, 2010, 07:52:38 NACHMITTAGS
thanks yigal  :)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in Juni 18, 2010, 07:23:10 NACHMITTAGS
Ahaha!  No Problem (=
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: gmbhneo in September 15, 2010, 12:15:11 NACHMITTAGS
Hmm .. i got the problem that i cant find your part of code in my index.template...

the only thiung ive found is:
// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Show the [home] and [help] buttons.
echo '
<a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.png" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0"; align="center" />' : $txt[103]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=help">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.png" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0"; align="center" />' : $txt[119]), '</a>', $context['menu_separator'];

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.png" alt="' . $txt[182] . '" style="margin: 2px 0;" border="0"; align="center" />' : $txt[182]), '</a>', $context['menu_separator'];

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<a href="', $scripturl, '?action=admin">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin.png" alt="' . $txt[2] . '" style="margin: 2px 0;" border="0"; align="center" />' : $txt[2]), '</a>', $context['menu_separator'];

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="', $scripturl, '?action=profile">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.png" alt="' . $txt[79] . '" style="margin: 2px 0;" border="0"; align="center" />' : $txt[467]), '</a>', $context['menu_separator'];

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0"; align="center" />' : $txt['calendar24']), '</a>', $context['menu_separator'];

// If the user is a guest, show [login] and [register] buttons.
if ($context['user']['is_guest'])
{
echo '
<a href="', $scripturl, '?action=login">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/login.png" alt="' . $txt[34] . '" style="margin: 2px 0;" border="0"; align="center" />' : $txt[34]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=register">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" style="margin: 2px 0;" border="0"; align="center" />' : $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
else
echo '
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.png" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0"; align="center" />' : $txt[108]), '</a>';
}

// Generate a strip of buttons, out of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;

if (empty($button_strip))
return '';

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . ($value['lang'] ? $context['user']['language'] . '/' : '') . $value['image'] . '" alt="' . $txt[$value['text']] . '" border="0" />' : $txt[$value['text']]) . '</a>';

$button_strip[$key] = $buttons[$key];
}

echo '
<td ', $custom_td, '>', implode($context['menu_separator'], $button_strip) , '</td>';
}

?>


Is there any outher way to center the buttons?
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in September 15, 2010, 05:25:41 NACHMITTAGS
My codes are definetly outdated.  I'm not sure if there are any other codes around for centering your navigation.  But for sure, there should be somewhere.  Try searching the community.

Sorry.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Antechinus in September 15, 2010, 05:31:08 NACHMITTAGS
Would have to see the rest of the template to know how the container for the menu was coded in that theme. Codes in this thread are only for the default theme.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: gmbhneo in September 16, 2010, 01:21:07 VORMITTAG
Thx for the quick anwsers! Here are the index.template and the css file ... i hope this is what you need?!

http://www.mediafire.com/file/cvze3nv4j8ubp9w/Desktop.zip
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in Dezember 07, 2010, 11:35:02 VORMITTAG
The File is deleted?
But Thanks anyway..
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: alios in März 27, 2011, 04:35:06 NACHMITTAGS
hey guys can you tell me where to modify so i can increase the font size in the menu bar ??

i-ve searched the style.css and index.template.php and no luck :(
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: pearpandas in März 28, 2011, 12:08:03 NACHMITTAGS
Thanks, I will be implementing this later today.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in März 29, 2011, 08:45:30 NACHMITTAGS
Zitat von: alios in März 27, 2011, 04:35:06 NACHMITTAGS
hey guys can you tell me where to modify so i can increase the font size in the menu bar ??

i-ve searched the style.css and index.template.php and no luck :(

You should post in the Graphics & Templates board.

Zitat von: pearpandas in März 28, 2011, 12:08:03 NACHMITTAGS
Thanks, I will be implementing this later today.

You're welcome! :)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: pearpandas in März 31, 2011, 01:38:08 NACHMITTAGS
thnx, going with the 2X
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: re1lazz in Mai 01, 2013, 03:17:13 NACHMITTAGS
Need help...
Have problem that i cant find part of code in my index.template.php...

My index.template.php
<?php
// Version: 2.0 RC3; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '2.0 RC3';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as opposed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status separate from topic icons? */
$settings['separate_sticky_lock'] = true;

/* Does this theme use the strict doctype? */
$settings['strict_doctype'] = false;

/* Does this theme use post previews on the message index? */
$settings['message_index_preview'] = false;

/* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
$settings['require_theme_strings'] = false;
}

// The main sub template above the content.
function template_html_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''>
<head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
<meta name="keywords" content="' 
$context['meta_keywords'] . '" />' '''
<title>'
$context['page_title_html_safe'], '</title>';

// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />'
;

// Present a canonical url for search engines to prevent duplicate content in their indices.
if (!empty($context['canonical_url']))
echo '
<link rel="canonical" href="'
$context['canonical_url'], '" />';

// The ?rc3 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/css/index'$context['theme_variant'], '.css?rc3" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/print.css?rc3" media="print" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" />
<link rel="search" href="'
$scripturl'?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name_html_safe'], ' - '$txt['rss'], '" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="'
$scripturl'?board='$context['current_board'], '.0" />';

// Some browsers need an extra stylesheet due to bugs/compatibility issues.
foreach (array('ie7''ie6''webkit') as $cssfix)
if ($context['browser']['is_' $cssfix])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/'$cssfix'.css" />';

// RTL languages require an additional stylesheet.
if ($context['right_to_left'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/css/rtl.css" />';

echo '
<script type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/script.js?rc3"></script>
<script type="text/javascript" src="'
$settings['theme_url'], '/scripts/theme.js?rc3"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_default_theme_url = "'
$settings['default_theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";'$context['show_pm_popup'] ? '
var fPmPopup = function ()
{
if (confirm("' 
$txt['from'] . ' ' $context['pm_informer']['sender'] . '\\n' $txt['subject'] . ' ' $context['pm_informer']['subject'] . '\\n' $txt['show_personal_messages'] . '"))
window.open(smf_prepareScriptUrl(smf_scripturl) + "action=pm");
}
addLoadEvent(fPmPopup);' 
'''
var ajax_notification_text = "'
$txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "'
$txt['modify_cancel'], '";
// ]]></script>'
;

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'];

echo '
</head>
<body>'
;
}

function 
template_body_above()
{
global $context$settings$options$scripturl$txt$modSettings;

echo 
'
<div id="bodybg">
<div id="wrapper">
<div id="shad-l">
<div id="shad-r">
<div id="header">
<div id="head-l">
<div id="head-r">
<div id="userarea" class="smalltext">'
;
if ($context['user']['is_logged'])
{
echo '
<b>'
$txt['hello_member_ndt'], ' '$context['user']['name'], '</b><br />';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo $txt['msg_alert_you_have'], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo sprintf($txt['welcome_guest'], $txt['guest_title']);

echo '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/sha1.js"></script>
<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user"  size="10" />
<input type="password" name="passwrd"  size="10" />
<input type="submit" value="'
$txt['login'], '" />
<input type="hidden" name="hash_passwrd" value="" />
</form>'
$context['current_time'],'<br />';
}

echo '
</div>
<div id="searcharea">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '">
<input type="text" name="search" value="'
$txt['search'], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt['search'], '...\';" /> ';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</div>
<a href="'
.$scripturl.'" title=""><span id="logo">&nbsp;</span></a>';
echo '
</div>
</div>
</div>
<div id="toolbar">
'
,template_menu(),'
</div>
<div id="bodyarea">'
;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//echo 
echo '<BR>';
include 'adverts1.php';
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Show the navigation tree.
theme_linktree();
}

function 
template_body_below()
{

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//echo 
include 'adverts2.php';
echo '<BR>';
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

global $context$settings$options$scripturl$txt$modSettings;

echo '
</div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer">
<div id="foot-l">
<div id="foot-r">
<div id="footerarea">
<span class="smalltext">'
theme_copyright(), '
<br /><a href="http://www.photojamaica.net"><b>PhotoJamaica.net &copy; 2010</b></a> | Theme by <a href="http://www.dzinerstudio.com" target="_blank"><b>DzinerStudio</b></a> | '
, !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<a id="button_rss" href="' $scripturl '?action=.xml;type=rss" class="new_win"><span>' $txt['rss'] . '</span></a>' ''' | <a id="button_wap2" href="'$scripturl '?wap2" class="new_win"><span>'$txt['wap2'], '</span></a></span>';

// Show the load time?
if ($context['show_load_time'])
echo '<br /><span class="smalltext">'$txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</span>';

echo '
</div>
</div>
</div>
</div>
</div>
</div>
</div>'
;
}

function 
template_html_below()
{
global $context$settings$options$scripturl$txt$modSettings;

echo '
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
try {
_uacct = "UA-15421433-1";
urchinTracker();
} catch(err) {}</script>
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree($force_show false)
{
global $context$settings$options$shown_linktree;

// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;

echo '
<div class="navigate_section">
<ul>'
;

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li'
, ($link_num == count($context['linktree']) - 1) ? ' class="last"' '''>';

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' 
$tree['url'] . '"><span>' $tree['name'] . '</span></a>' '<span>' $tree['name'] . '</span>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' &#38;#38;#187;';

echo '
</li>'
;
}
echo '
</ul>
</div>'
;

$shown_linktree true;
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

echo '
<div id="topmenu">
<ul>'
;

foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a '$button['active_button'] ? ' class="current"' '' ' href="'$button['href'], '"><span>'$button['title'], '</span></a></li>';

echo '
</ul>
</div>'
;

}

// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$strip_options = array())
{
global $settings$context$txt$scripturl;

if (!is_array($strip_options))
$strip_options = array();

// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '
<li><a' 
. (isset($value['id']) ? ' id="button_strip_' $value['id'] . '"' '') . ' class="button_strip_' $key '' . (isset($value['active']) ? ' active' '') . '" href="' $value['url'] . '"' . (isset($value['custom']) ? ' ' $value['custom'] : '') . '><span>' $txt[$value['text']] . '</span></a></li>';
}

// No buttons? No button strip either.
if (empty($buttons))
return;

// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>''<span class="last">'$buttons[count($buttons) - 1]);

echo '
<div class="buttonlist'
, !empty($direction) ? ' align_' $direction '''"', (empty($buttons) ? ' style="display: none;"' ''), (!empty($strip_options['id']) ? ' id="' $strip_options['id'] . '"'''), '>
<ul>'
,
implode(''$buttons), '
</ul>
</div>'
;
}

?>



Theme by Crip
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: re1lazz in Mai 01, 2013, 03:22:12 NACHMITTAGS
My index.css

#main_menu {
   float:left;
   width:100%;
   background: none;
   overflow:hidden;
   position:relative;
}
#main_menu ul {
   clear:left;
   float:left;
   list-style:none;
   margin:0;
   padding:0;
   position:relative;
   left:50%;
   text-align:center;
}
li.main_menu_first {
   width: 8px;
   height: 20px;
   background: url(../images/maintab_first.gif) no-repeat bottom left;
}
#main_menu ul li {
   display:block;
   float:left;
   list-style:none;
   margin:0;
   padding:0;
   position:relative;
   right:50%;
}
#main_menu ul li a {
   display:block;
   color: white;
   font-size: 0.8em;
   font-family: tahoma, sans-serif;
   text-transform: uppercase;
}
#main_menu li a span
{
background: url(../images/maintab_back.gif) repeat-x bottom left;
display: block;
padding: 0.1em 0.5em 0.5em 0.5em;
}
#main_menu li.last a span
{
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0.1em 1em 0.5em 0.5em;
}
#main_menu li.active a span em
{
padding: 0.1em 0.5em 0.5em 0.5em;
display: block;
font-style: normal;
background: url(../images/maintab_active_back.gif) repeat-x bottom right;
}
#main_menu li.active a span
{
background: url(../images/maintab_active_first.gif) no-repeat bottom left;
padding: 0 0 0 8px;
}
#main_menu li.last.active
{
float: left;
background: url(../images/maintab_last.gif) no-repeat bottom right;
padding: 0 8px 0 0;
}
#main_menu li.active a
{
background: url(../images/maintab_active_last.gif) no-repeat bottom right;
padding-right: 8px;
}
.dropmenu, .dropmenu ul
{
list-style: none;
line-height: 1em;
padding: 0;
margin: 0;
}
.dropmenu
{
padding: 0 0.5em;
}
.dropmenu a
{
display: block;
color: #000;
text-decoration: none;
}
.dropmenu a span
{
display: block;
padding: 0 0 0 5px;
font-size: 0.9em;
}
/* the backgrounds first level only*/
.dropmenu li a.firstlevel
{
margin-right: 8px;
}
.dropmenu li a.firstlevel span.firstlevel
{
display: block;
position: relative;
left: -5px;
padding-left: 5px;
height: 22px;
line-height: 19px;
}
.dropmenu li
{
float: left;
padding: 0;
margin: 0;
position: relative;
}
.dropmenu li ul
{
z-index: 90;
display: none;
position: absolute;
width: 19.2em;
font-weight: normal;
border-bottom: 1px solid #999;
background: url(../images/theme/menu_gfx.png) 0 -100px no-repeat;
padding: 7px 0 0 0;
}
.dropmenu li li
{
width: 19em;
margin: 0;
border-left: 1px solid #999;
border-right: 1px solid #999;
}
.dropmenu li li a span
{
display: block;
padding: 8px;
}
.dropmenu li ul ul
{
margin: -1.8em 0 0 13em;
}

/* the active button */
.dropmenu li a.active
{
background: url(../images/theme/menu_gfx.png) no-repeat 100% 0;
color: #fff;
font-weight: bold;
}
.dropmenu li a.active span.firstlevel
{
background: url(../images/theme/menu_gfx.png) no-repeat 0 0;
}
/* the hover effects */
.dropmenu li a.firstlevel:hover, .dropmenu li:hover a.firstlevel
{
background: url(../images/theme/menu_gfx.png) no-repeat 100% -30px;
color: #fff;
cursor: pointer;
text-decoration: none;
}
.dropmenu li a.firstlevel:hover span.firstlevel, .dropmenu li:hover a.firstlevel span.firstlevel
{
background: url(../images/theme/menu_gfx.png) no-repeat 0 -30px;
}
/* the hover effects on level2 and 3*/
.dropmenu li li a:hover, .dropmenu li li:hover>a
{
background: url(../images/theme/main_block.png) no-repeat -10px -160px;
color: #000;
text-decoration: none;
}
.dropmenu li:hover ul ul, .dropmenu li:hover ul ul ul
{
top: -999em;
}
.dropmenu li li:hover ul
{
top: auto;
}
.dropmenu li:hover ul
{
display: block;
}
.dropmenu li li.additional_items
{
background-color: #fff;
}

/* The dropdown menu toggle image */
#menu_toggle
{
float: right;
margin-right: 10px;
padding-top: 3px;
}
#menu_toggle span
{
position: relative;
right: 5000px;
}

/* Styles for the standard button lists.
------------------------------------------------------- */

.buttonlist ul
{
z-index: 100;
padding: 5px;
margin: 0 0.2em 0 0;
}
.buttonlist ul li
{
margin: 0;
padding: 0;
list-style: none;
float: left;
}
.buttonlist ul li a
{
display: block;
font-size: 0.8em;
color: #000;
background: url(../images/theme/menu_gfx.png) no-repeat 0 -60px;
padding: 0;
margin-left: 12px;
text-transform: uppercase;
cursor: pointer;
}
.buttonlist ul li a:hover
{
background: url(../images/theme/menu_gfx.png) no-repeat 0 0;
color: #fff;
text-decoration: none;
}
.buttonlist ul li a span
{
background: url(../images/theme/menu_gfx.png) no-repeat 100% -60px;
display: block;
height: 24px;
line-height: 20px;
padding: 0 8px 0 0;
position: relative;
right: -8px;
}
.buttonlist ul li a:hover span
{
background: url(../images/theme/menu_gfx.png) no-repeat 100% 0;
}
/* the active one */
.buttonlist ul li a.active
{
background: url(../images/theme/menu_gfx.png) no-repeat 0 -30px;
color: #fff;
font-weight: bold;
}
.buttonlist ul li a.active span
{
background: url(../images/theme/menu_gfx.png) no-repeat 100% -30px;
}
.buttonlist ul li a.active
{
font-weight: bold;
}
.buttonlist ul li a.active:hover
{
color: #ddf;
}
.align_top ul li a, .align_bottom ul li a
{
margin: 0 12px 0 0;
}

/* the navigation list */
ul#navigation
{
margin: 0;
font-size: 0.9em;
padding: 1em 0.4em;
}
ul#navigation li
{
float: none;
font-size: 0.95em;
display: inline;
}

#adm_submenus
{
padding-left: 2em;
overflow: hidden;
}

/* Styles for the general looks for the Curve theme.
------------------------------------------------------- */

/* the content section */
#content_section
{
background: repeat-y top left;
padding-left: 20px;
}
#content_section div.frame
{
background: repeat-y top right;
display: block;
padding: 0 20px 0 0;
}
#main_content_section
{
width: 100%;
min-height: 200px;
}

/* the main title, always stay at 45 pixels in height! */
h1.forumtitle
{
line-height: 45px;
font-size: 1.8em;
font-family: Geneva, verdana, sans-serif;
margin: 0;
padding: 0;
float: left;
}
/* float these items to the right */
#siteslogan, img#smflogo
{
margin: 0;
padding: 0;
float: right;
line-height: 3em;
}
h3, h4
{
padding-bottom: 3px;
}
/* the upshrink image needs some tweaking */
img#upshrink
{
float: right;
margin: 1em;
}
/* ..so does the SMF logo */
img#smflogo
{
margin-left: 1em;
}
/* the upper_section, float the two each way */
#upper_section
{
padding: 5px;
margin-bottom: 1.5em;
}
#upper_section ul li.greeting
{
font-size: 1.3em;
font-weight: bold;
line-height: 1.5em;
}
#upper_section div.news
{
width: 50%;
float: right;
text-align: right;
}
#guest_form
{
overflow: hidden;
}
#guest_form .info
{
padding: 4px 0 ;
}
div#upper_section div.user
{
width: 50%;
float: left;
overflow: auto;
}
div#upper_section div.user p
{
float: left;
margin: 0 1em 1em 0;
padding: 0;
}
div#upper_section div.user ul
{
margin: 0;
padding-left: 10px;
}
div#upper_section div.user ul li
{
margin-bottom: 2px;
}
div#upper_section div.news p
{
display: inline;
}
div#upper_section div.news form
{
padding-bottom: 10px;
}
/* clearing the floats */
#top_section
{
min-height: 65px;
overflow: hidden;
margin-bottom: 3px;
}
#upper_section
{
overflow: hidden;
}

/* The navigation list (i.e. linktree) */
.navigate_section
{
padding: 0.5em;
margin: 0 0 0 0;
}
.navigate_section ul
{
display: block;
margin: 0;
font-size: 0.9em;
padding: 1em 0 0.5em 0;
border-top: 1px solid #ccc;
overflow: hidden;
list-style: none;
clear: both;
width: 100%;
}
.navigate_section ul li
{
float: left;
padding: 0 0.5em 0 0;
font-size: 0.95em;
}

/* The footer wih copyright links etc. */
#footer_section
{
text-align: center;
background: url(../images/theme/main_block.png) no-repeat 0 -820px;
padding-left: 20px;
}
#footer_section span.smalltext
{
font-size: 100%;
}
#footer_section div.frame
{
background: url(../images/theme/main_block.png) no-repeat 100% -820px;
display: block;
padding: 60px 0 0 0;
}
#footer_section ul li, #footer_section p
{
font-size: 0.8em;
}
#footer_section ul li
{
display: inline;
padding-right: 5px;
}
#footer_section ul li.copyright
{
display: block;
}
select.qaction, input.qaction
{
font-size: 0.85em;
padding: 0;
}
#mlist table tbody td.windowbg2
{
text-align: center;
}

/* Styles for a typical table.
------------------------------------------------------- */
table.table_list
{
width: 100%;
}
table.table_list p
{
padding: 0;
margin: 0;
}
table.table_list td, table.table_list th
{
padding: 5px;
}
table.table_list tbody.header td
{
padding: 0;
}
table.table_list tbody.content td.stats
{
font-size: 90%;
width: 15%;
text-align: center;
}
table.table_list tbody.content td.lastpost
{
line-height: 1.3em;
font-size: 85%;
width: 24%;
}
table.table_list tbody.content td.icon
{
text-align: center;
width: 6%;
}

/* Styles for the board index.
------------------------------------------------- */

/* the board title! */
.table_list tbody.content td.info a.subject
{
font-weight: bold;
font-size: 110%;
color: #111;
}
.table_list tbody.content td.children
{
color: #555;
font-size: 85%;
}
p.moderators
{
font-size: 0.8em;
font-family: verdana, sans-serif;
}
/* hide the table header/footer parts - but its here for those needing to style it */
#boardindex_table .table_list thead, #boardindex_table .table_list tfoot
{
display: none;
}

/* the posting icons */
#posting_icons
{
padding: 0 1em 0.5em 1em;
margin: 0 0 1em 0;
line-height: 1em;
}
#posting_icons ul
{
font-size: 0.8em;
}
#posting_icons img
{
vertical-align: middle;
margin: 0 0 0 4ex;
}
#postbuttons_upper ul li a span
{
line-height: 19px;
padding: 0 0 0 6px;
}
.nextlinks
{
text-align: right;
margin-top: -1px;
}
.nextlinks_bottom
{
clear: right;
text-align: right;
}
.mark_read
{
padding: 0 0.5em;
}

/* the newsfader */
#newsfader
{
margin: 0 2px;
}
#smfFadeScroller
{
text-align: center;
padding: 0 2em;
overflow: auto;
margin: 1em 0;
color: #575757; /* shouldn't be shorthand style due to a JS bug in IE! */
}

/* Styles for the info center on the board index.
---------------------------------------------------- */

#upshrinkHeaderIC
{
margin-top: 4px;
}
dl#ic_recentposts
{
margin: 0 0 0.5em 0;
padding: 0.5em;
line-height: 1.3em;
}
dl#ic_recentposts dt
{
float: left;
}
dl#ic_recentposts dd
{
text-align: right;
}
#upshrinkHeaderIC p
{
margin: 0 0 0.5em 0;
padding: 0.5em;
}
#upshrinkHeaderIC p.last
{
margin: 0;
padding: 0.5em;
border-top: 2px dotted #bbb;
}
#upshrinkHeaderIC p.inline
{
border: none;
margin: 0;
padding: 0.2em 0.5em 0.2em 0.5em;
}
#upshrinkHeaderIC p.stats
{
font-size: 1.1em;
padding-top: 8px;
}
form#ic_login
{
padding: 0.5em;
height: 2em;
}
form#ic_login ul li
{
margin: 0;
padding: 0;
float: left;
width: 20%;
text-align: center;
}
form#ic_login ul li label
{
display: block;
}

/* the small stats */
#index_common_stats
{
display: block;
margin: 0 0 0.5em 0;
text-align: right;
font-size: 0.9em;
position: relative;
top: -20px;
line-height: 1px;
}

img.new_posts
{
padding: 0 0.1em;
}
/* Styles for the message (topic) index.
---------------------------------------------------- */
div.table_frame .table_list
{
border-collapse: collapse;
margin: 2px 0;
}
.table_frame .table_list td.icon, .table_frame .table_list td.info, .table_frame .table_list td.stats
{
border-right: 2px solid white;
}
#messageindex
{
clear: both;
}
/* the page navigation area */
.childboards
{
margin-bottom: 0.2em;
}
#childboards h3
{
padding-bottom: 0;
}
#childboards .table_list thead
{
display: none;
}
#childboards .table_list
{
margin-bottom: 1em;
}
.lastpost img
{
float: right;
padding: 4px;
}

/* Styles for the display template (topic view).
---------------------------------------------------- */

#postbuttons div.buttons
{
padding: 0.5em;
width: 40%;
float: right;
}
#postbuttons div.middletext
{
width: 60%;
}
#postbuttons span
{
display: block;
text-align: right;
}
#postbuttons span.lower
{
clear: right;
}
#postbuttons .buttonlist
{
float: right;
}
#postbuttons #pagelinks
{
padding-top: 1em;
}
#moderationbuttons
{
overflow: hidden;
}
/* Events */
.linked_events
{
padding: 1em 0;
}
.edit_event
{
margin: 0 1em;
vertical-align: middle;
}
/* Poll question */
#poll
{
overflow: hidden;
}
#poll .content
{
padding: 0 1em;
}
h4#pollquestion
{
padding: 0 0 0.5em 2em;
}

/* Poll vote options */
#poll_options ul.options
{
border-top: 1px solid #9999aa;
padding: 1em 2.5em 0 2em;
margin: 0 0 1em 0;
}
#poll_options div.submitbutton
{
border-bottom: 1px solid #9999aa;
clear: both;
padding: 0 0 1em 2em;
margin: 0 0 1em 0;
}

/* Poll results */
#poll_options dl.options
{
border: solid #9999aa;
border-width: 1px 0;
padding: 1em 2.5em 1em 2em;
margin: 0 1em 1em 0;
line-height: 1.1em !important;
}

#poll_options dl.options dt
{
padding: 0.3em 0;
width: 30%;
float: left;
margin: 0;
clear: left;
}

#poll_options dl.options .voted
{
font-weight: bold;
}

#poll_options dl.options dd
{
margin: 0 0 0 2em;
padding: 0.1em 0 0 0;
width: 60%;
max-width: 450px;
float: left;
}

#poll_options dl.options .percentage
{
display: block;
float: right;
padding: 0.2em 0 0.3em 0;
}

/* Poll notices */
#poll_options p
{
margin: 0 1.5em 0.2em 1.5em;
padding: 0 0.5em 0.5em 0.5em;
}

div#pollmoderation
{
margin: 0;
padding: 0;
overflow: auto;
}

/* onto the posts */
#forumposts
{
clear: both;
}
#forumposts .cat_bar
{
margin: 0 0 2px 0;
}
/* author and topic information */
#forumposts h3 span#author
{
margin: 0 7.7em 0 0;
}
#forumposts h3 img
{
float: left;
margin: 4px 0.5em 0 0;
}
#forumposts h3.catbg
{
margin-bottom: 3px;
}
p#whoisviewing
{
margin: 0;
padding: 0.5em;
}
/* poster and postarea + moderation area underneath */
.post_wrapper
{
float:left;
width:100%;
}
.poster
{
float: left;
width: 15em;
}
.postarea, .moderatorbar
{
margin: 0 0 0 16em;
}
.postarea div.flow_hidden
{
width: 100%;
}

.moderatorbar
{
clear: right;
}
/* poster details and list of items */
.poster h4, .poster ul
{
padding: 0;
margin: 0 1em 0 1.5em;
}
.poster h4
{
margin: 0.2em 0 0.4em 1.1em;
font-size: 120%;
}
.poster h4, .poster h4 a
{
color: #222;
}
.poster ul ul
{
margin: 0.3em 1em 0 0;
padding: 0;
}
.poster ul ul li
{
display: inline;
}
.poster li.stars, .poster li.avatar, .poster li.blurb, li.postcount, li.im_icons ul
{
margin-top: 0.5em;
}
.poster li.avatar
{
overflow: hidden;
}
.poster li.warning
{
line-height: 1.2em;
padding-top: 1em;
}
.poster li.warning a img
{
vertical-align: bottom;
padding: 0 0.2em;
}
.messageicon
{
float: left;
margin: 0 0.5em 0 0;
}
.messageicon img
{
padding: 6px 3px;
}
.keyinfo
{
float: left;
width: 50%;
}
.modifybutton
{
clear: right;
float: right;
margin: 6px 20px 10px 0;
text-align: right;
font: bold 0.85em arial, sans-serif;
color: #334466;
}

/* The quick buttons */
div.quickbuttons_wrap
{
padding: 0.2em 0;
width: 100%;
float: left;
}

ul.quickbuttons
{
margin: 0.9em 11px 0 0;
clear: right;
float: right;
text-align: right;
font: bold 0.85em arial, sans-serif;
}
ul.quickbuttons li
{
float: left;
display: inline;
margin: 0 0 0 11px;
}
ul.quickbuttons li a
{
padding: 0 0 0 20px;
display: block;
height: 20px;
line-height: 18px;
float: left;
}
ul.quickbuttons a:hover
{
color: #c4451d;
}
ul.quickbuttons li.quote_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 0;
}
ul.quickbuttons li.remove_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 -30px;
}
ul.quickbuttons li.modify_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 -60px;
}
ul.quickbuttons li.approve_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 -90px;
}
ul.quickbuttons li.restore_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 -120px;
}
ul.quickbuttons li.split_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 -150px;
}
ul.quickbuttons li.reply_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 -180px;
}
ul.quickbuttons li.reply_all_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 -180px;
}
ul.quickbuttons li.notify_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 -210px;
}
ul.quickbuttons li.inline_mod_check
{
margin: 0 0 0 5px;
}

.post
{
margin-top: 0.5em;
clear: right;
}
.inner
{
padding: 1em 1em 2px 0;
margin: 0 1em 0 0;
border-top: 1px solid #99a;
}
.inner img.smiley
{
vertical-align: bottom;
}
#forumposts .modified
{
float: left;
}
#forumposts .reportlinks
{
margin-right: 1.5em;
text-align: right;
clear: right;
}
#forumposts .signature, .post .signature
{
margin: 1em 0 0 0;
}
#forumposts span.botslice
{
clear: both;
}
.attachments hr
{
clear: both;
margin: 1em 0 1em 0;
}
.attachments
{
padding: 1em 0 2em 0;
}
.attachments div
{
padding: 0 0.5em;
}

/* Styles for the quick reply area.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: re1lazz in Mai 02, 2013, 03:03:29 NACHMITTAGS
up ???
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: TheListener in Mai 02, 2013, 05:36:35 NACHMITTAGS
Zitat von: re1lazz in Mai 02, 2013, 03:03:29 NACHMITTAGS
up ???

May I suggest you ask the themes author for help with this.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in Mai 08, 2013, 11:07:12 NACHMITTAGS
Yeah.  The codes I used when producing this mod are all from the default template.

Good luck:]
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: archdearz in Mai 15, 2013, 10:06:30 VORMITTAG
Thanks yigal  :)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: solewind in Mai 19, 2013, 01:56:58 NACHMITTAGS
Thanks for guiding Yigal. I'm gonna implement it now. :)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Yigal in Mai 21, 2013, 01:20:37 VORMITTAG
No problem guys :)

Have a good one.
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: mulwa in Dezember 16, 2013, 03:16:14 VORMITTAG
please these codes are not working on smf 2.0.6
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: busterone in Dezember 16, 2013, 04:55:26 NACHMITTAGS
There is a mod that will do that for the curve theme - http://custom.simplemachines.org/mods/index.php?mod=2553
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: mulwa in Februar 16, 2014, 12:33:46 NACHMITTAGS
thank you for the link you have provided. But unfortunately it's not working on Mytheme2, though the mod was successfully installed without any error on the theme, but the nav menu wasn't centered. Please i need help! Thank you
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: CrimeS in Februar 17, 2014, 07:28:28 VORMITTAG
It won't work on customised themes that have changed menu structure ;)
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: Antechinus in Februar 24, 2014, 05:08:13 NACHMITTAGS
The same general principle will probably work (ie: using relative positioning tricks) but the CSS would have to be adapted to some degree (class names and id's, or whatever).
Titel: Re: [Tip/Trick] Center Nav Menu Bar (1.x and 2.x)
Beitrag von: CrimeS in Februar 25, 2014, 11:05:46 VORMITTAG
Yes, the class names and id's under the template_menu() would need to be adapted.