How can I add [Forums] button to my navigation bar??

Started by blahblahblah, June 11, 2008, 04:33:26 PM

Previous topic - Next topic

blahblahblah

Okay this is probably really simple I hope, all I want to do is add a 'forums' button thing to the navigation bar.

The 'Home' one goes to the simple portal addon I have, which is a good addon however has no way to select 'forums'.. which is stupid. You have to click a recent post link just to get to the forums.

So I'd to be able to add a forums one between the 'help' and 'home' buttons if possible so it would look like this: [HOME][FORUMS][HELP]


blahblahblah

Here's a link to the theme I'm talking about:

http://custom.simplemachines.org/themes/index.php?lemma=264

The lighter blue navigation bar with home|help|search on the preview picture. That is where I'd like to add the "Forums" button. Would like it to link to mysite.com/boards [nofollow] when clicked.

Nathaniel

Have a look at the code in the template_menu() function from the index.template.php file for your theme, it makes the list of buttons, so you should be able to add one there. If you download a clean copy of the theme then you should be able to copy the [home] button code from it into the copy that you are using, just remember that you will have to replace the $txt[blah] with 'forums'.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

blahblahblah

That didn't seem to do anything for me. It didn't add a button at all I see no changes. I don't know if I did something wrong or not..

ccbtimewiz

Are you using a custom theme? If yes, then be sure you're editing that file.

If it still doesn't work, attach it.

blahblahblah

Yes I'm using CS-DK the theme I linked to above.

Attach what? The theme itself? The file? My attempt at modifying the file?



ccbtimewiz

Quote from: blahblahblah on June 11, 2008, 04:33:26 PM
Okay this is probably really simple I hope, all I want to do is add a 'forums' button thing to the navigation bar.

The 'Home' one goes to the simple portal addon I have, which is a good addon however has no way to select 'forums'.. which is stupid. You have to click a recent post link just to get to the forums.

So I'd to be able to add a forums one between the 'help' and 'home' buttons if possible so it would look like this: [HOME][FORUMS][HELP]

blahblahblah

#9
Ok here is the file

desidude

#10
buddy use simple portal mod.....

blahblahblah

As stated once by me and highlighted by another poster above, I already have Simple portal. The reason I'm even asking for this button to be added at all is because of simple portal, if there is an option to have a "Forum(s)" button in the navigation bar somewhere I certainly am not able to find it.

blahblahblah

I just looked at your site, I see the Forum button. Nowehere on my site is a forum button. How did you get one there? Or was it there automatically when you installed SMF/SP?

desidude



blahblahblah

#15
http://www.****

There's the site, no forum button. Portal installed.

desidude

well dude chk ur default theme n thn tell me.....wats there

blahblahblah


blahblahblah

#18
Hmm alright. The [Forum] Button shows up in the navigation bar when I load the default SMF template. If I try to switch to any other templates (tried 5 of them now, all say they support 1.5) the [Forum] button disappears.

Anybody have any idea why? I mean this isn't life or death it's only a gaming forum, but I'd really like to stick with SMF and the theme i picked out.. If anyone can help or suggest anything I'd appreciate it.


desidude

did forum appears on home page of other themes....

blahblahblah

Quote from: blahblahblah on June 12, 2008, 12:48:15 AM
Hmm alright. The [Forum] Button shows up in the navigation bar when I load the default SMF template. If I try to switch to any other templates (tried 5 of them now, all say they support 1.5) the [Forum] button disappears.

Anybody have any idea why? I mean this is life or death it's only a gaming forum, but I'd really like to stick with SMF and the theme i picked out.. If anyone can help or suggest anything I'd appreciate it.

desidude

acctualy u have to edit index.template file nd hve to insert forum button......only if forums are nt shown on home page

blahblahblah

I already did, it's already in the file in fact. I already linked to the file earlier in the thread. I also tried to add the button a second time as 'forums' and it still does not show up.

desidude


blahblahblah

#24
.

desidude


blahblahblah

#26
.

desidude

search for dis   
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))

and replace it wid dis
if (in_array($context['current_action'], array('forum','search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))





desidude

look 4
// Show the [help] button.

and add dis code above it

// Show the [forum] button.
   echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '' : '' , '
            <div class="maintab_' , $current_action == 'forum' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '">' , $txt[103] , '</a>
            </div>' , $current_action == 'forum' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

blahblahblah

Added a duplicate [Home] button next to the other [Home] button.

blahblahblah

lmao.. not so easy is it.

I searched, a few threads say to check for $txt[...] in the langues file. I don't see anything in there to change from "home" to "forum".

I figured out how to edit the [help] buttons URL. That now redirects to my forums now. All i need to do is rename that button, anyone..?

fangweile

You are using the simpleportal mod right,

replace you index.template.php with this code but before that make a backup of the original file cause I haven't test this code yet

<?php
// Version: 1.1; 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'] = '1.1.5';

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

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

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$forum_version$language$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'], '" />', empty($context['robot_no_index']) ? '' '
<meta name="robots" content="noindex" />'
'
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['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'], '";
// ]]></script>
<title>'
$context['page_title'], '</title>';

// The ?fin11 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'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<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']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - 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" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}

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

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

// ]]></script>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td id="bg-l">
&nbsp;
</td>
<td width="900">
<div id="top">
<div class="top_menu">'
;
top_menu();
echo'
</div>
</div>
<div id="top-r">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0;">
<input type="text" name="search" value="'
$txt[182], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt[182], '...\';" style="width: 150px; margin-left: 40px;" /> ';

// 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>
<div id="trooper">
</div>'
;
if (empty($settings['header_logo']))
echo '
<div id="logo-bg"><a href="'
.$scripturl.'" title="">'$context['forum_name'], '</a></div>';
if (!empty($settings['header_logo']))
echo '
<div id="logo"><a href="'
.$scripturl.'" title=""></a></div>';

// The main menu
echo'
<div id="main_menu_l">
&nbsp;
</div>
<div id="main_menu_top">
&nbsp;
</div>
<div id="main_menu">
'
,template_menu(),'
</div>
<div id="main_menu_bot">
&nbsp;
</div>'
;

// The main content should go here.
echo'
<div id="content">'
;
if ($context['user']['is_admin'])
{
if (empty($settings['theme_version_attention']))
{
if ($forum_version != 'SMF 1.1.5')
echo '
<div style="margin: 0 2ex 2ex 2ex; padding: 2ex; border: 2px dashed #cc3344; color: black; background-color: #ffb76f;">
<div style="float: left; width: 2ex; font-size: 2em; color: red;">!!</div>
<b style="text-decoration: underline;">Attention of CS-DK theme:</b><br />
<div style="padding-left: 6ex;">
This theme doesn\'t correspond to the version of SMF that you are using. This theme is made for SMF 1.1.5 
</div>
</div>'
;
}
if (empty($txt['necessary_to_translate']))
{
echo '
<div style="margin: 0 2ex 2ex 2ex; padding: 2ex; border: 2px dashed #cc3344; color: black; background-color: #e7e7f7;">
<div style="float: left; width: 2ex; font-size: 2em; color: red;">!!</div>
<b style="text-decoration: underline;">Attention of cs-dk theme:</b><br />
<div style="padding-left: 6ex;">
You have to create &quot;<b>Modifications.<span style="color: red;"><acronym title="Name of language that you are using">' 
$language '</acronym></span>.php</b>&quot; in the &quot;<b>languages</b>&quot; directory ( <i>'$settings['theme_url'], '/languages/</i> ) of your cs-dk theme.<br /><br />
Duplicate the &quot;<i>Modifications.english.php</i>&quot; of the &quot;languages&quot; directory of cs-dk. Next, rename it according to the language for which you use the file. 
</div>
</div>'
;
}
}
}

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



// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<div id="footer">
'
theme_copyright(), '<br /><br />Theme <b>CS-DK</b> created by <a href="http://padexx.de">panic</a>
</div>'
;
echo 
'
</div>'
;
// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
</td><td id="bg-r">&nbsp;</td></tr></table></body></html>'
;
}

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

echo '<div class="breadcrumb">'$txt['you are here: '] ,'<span class="pathway">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="pathway">' $tree['name'] . '</a>' $tree['name'] , ' &raquo; ';
else
echo $tree['name'];

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

}

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

// template_menu() IS THE MAIN MENU / top_menu IS THE "TOP" MENU ( [login]... )

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

// Work out where we currently are.
$current_action 'home';
if (in_array($context['current_action'], array('admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm''forum')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action 'forum';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' 'profile' 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first 'last';
$last 'first';
}
else
{
$first 'first';
$last 'last';
}

// Start of the tab section.
echo ' <div class="seperator"><!--no content--></div>';
// Show the [home] button.
if (!empty($settings['cs_forum_button']))
echo '
<div class="maintab_back">
<a href="'
$settings['cs_forum_button'], '">' $txt[103] , '</a>
</div>
<div class="seperator"><!--no content--></div>'
;

if (!empty($settings['cs_forum_button']))
{
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
<a href="'
$scripturl'">' $txt['cs_forum_button_forum'] , '</a>
</div>' 
$current_action == 'home' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';
}
else
{
// Show the [Home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
<a href="'
$scripturl'">' $txt[103] , '</a>
</div>' 
$current_action == 'home' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

}

// Show the [forum] button. 


echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'forum' 'active_back' 'back' '">
< a href="'
$scripturl,
'?action=forum">'.$txt['sp-forum'].'</a>
</div>' 
$current_action == 'forum' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';





// Show the [help] button.

echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'help' 'active_back' 'back' '">
<a href="'
$scripturl'?action=help">' $txt[119] , '</a>
</div>' 
$current_action == 'help' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
<a href="'
$scripturl'?action=search">' $txt[182] , '</a>
</div>' 
$current_action == 'search' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
<a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
</div>' 
$current_action == 'calendar' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
<a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
</div>' 
$current_action == 'mlist' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// The end of tab section.
}

// Show the TOP_menu up top...
function top_menu()
{
global $context$settings$options$scripturl$txt;

// Work out where we currently are.
$current_action 'home';
if (in_array($context['current_action'], array('admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm''forum')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action 'forum';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' 'profile' 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first 'last';
$last 'first';
}
else
{
$first 'first';
$last 'last';
}

// Start of the tab section.

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'admin' 'active_back' 'back' '">
<a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
</div>' 
$current_action == 'admin' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// How about the [quick links] button?
if ($context['user']['is_logged'])
echo '
<div class="toptab_back"><a href="'
$scripturl'#quicklinks" onClick="return overlay(this, \'quicklinks\',\'bottomleft\')">'$txt['quicklinks'] ,'&or;</a>
<!--Do not remove outer most DIV tag with id="quicklinks"-->
<div id="quicklinks" style="position:absolute; border: 2px solid #5377a0; width: 150px; padding: 0; display:none">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">'
$txt['quicklinks'] ,'</td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=unread">'$txt['q_newposts'] ,'</a></td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=unreadreplies">'$txt['q_newreplies'] ,'</a></td>
</tr>
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">'
$txt['q_usersettings'] ,'</td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=profile">'$txt['q_viewprofile'] ,'</a></td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=profile;u='$context['user']['id'], ';sa=account">'$txt['q_accountset'] ,'</a></td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=profile;u='$context['user']['id'], ';sa=forumProfile">'$txt['q_editprofile'] ,'</a></td>
</tr>
</table>
<div align="right" style="font-size:10px;"><a href="#" onClick="overlayclose(\'quicklinks\'); return false">'
$txt['q_close'] ,'</a></div>

</div>
</div><div class="seperator_top"><!--no content--></div>'
;

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'profile' 'active_back' 'back' '">
<a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
</div>' 
$current_action == 'profile' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'pm' 'active_back' 'back' '">
<a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
</div>' 
$current_action == 'pm' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'register' 'active_back' 'back' '">
<a href="'
$scripturl'?action=register">' $txt[97] , '</a>
</div>' 
$current_action == 'register' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'login' 'active_back' 'back' '">
<a href="'
$scripturl'?action=login">' $txt[34] , '</a>
</div>' 
$current_action == 'login' '<div class="menu_end_l"><!--no content--></div>' '<div class="menu_end_l"><!--no content--></div>';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'logout' 'active_back' 'back' '">
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
</div>' 
$current_action == 'logout' '<div class="menu_end_l"><!--no content--></div>' '<div class="menu_end_l"><!--no content--></div>';

// The end of tab section.
}

// 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>';
}

?>



Hope it will work  :D


blahblahblah

#33
Not even close, hehe.

http://www.****

That's the aftermath.

fangweile

Okay, I will check the code thoroughly.
HOpe other could help you too

blahblahblah

Well thanks for trying I certainly cannot get it to work  :(

fangweile

Do you have any other mods installed except from simpleportal?
Just want to know.


fangweile

Hello blahblah

Use this updated code
Replace your index.template.php

<?php
// Version: 1.1; 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'] = '1.1.5';

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

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

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$forum_version$language$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'], '" />', empty($context['robot_no_index']) ? '' '
<meta name="robots" content="noindex" />'
'
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['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'], '";
// ]]></script>
<title>'
$context['page_title'], '</title>';

// The ?fin11 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'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<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']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - 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" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}

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

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

// ]]></script>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td id="bg-l">
&nbsp;
</td>
<td width="900">
<div id="top">
<div class="top_menu">'
;
top_menu();
echo'
</div>
</div>
<div id="top-r">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0;">
<input type="text" name="search" value="'
$txt[182], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt[182], '...\';" style="width: 150px; margin-left: 40px;" /> ';

// 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>
<div id="trooper">
</div>'
;
if (empty($settings['header_logo']))
echo '
<div id="logo-bg"><a href="'
.$scripturl.'" title="">'$context['forum_name'], '</a></div>';
if (!empty($settings['header_logo']))
echo '
<div id="logo"><a href="'
.$scripturl.'" title=""></a></div>';

// The main menu
echo'
<div id="main_menu_l">
&nbsp;
</div>
<div id="main_menu_top">
&nbsp;
</div>
<div id="main_menu">
'
,template_menu(),'
</div>
<div id="main_menu_bot">
&nbsp;
</div>'
;

// The main content should go here.
echo'
<div id="content">'
;
if ($context['user']['is_admin'])
{
if (empty($settings['theme_version_attention']))
{
if ($forum_version != 'SMF 1.1.5')
echo '
<div style="margin: 0 2ex 2ex 2ex; padding: 2ex; border: 2px dashed #cc3344; color: black; background-color: #ffb76f;">
<div style="float: left; width: 2ex; font-size: 2em; color: red;">!!</div>
<b style="text-decoration: underline;">Attention of CS-DK theme:</b><br />
<div style="padding-left: 6ex;">
This theme doesn\'t correspond to the version of SMF that you are using. This theme is made for SMF 1.1.5 
</div>
</div>'
;
}
if (empty($txt['necessary_to_translate']))
{
echo '
<div style="margin: 0 2ex 2ex 2ex; padding: 2ex; border: 2px dashed #cc3344; color: black; background-color: #e7e7f7;">
<div style="float: left; width: 2ex; font-size: 2em; color: red;">!!</div>
<b style="text-decoration: underline;">Attention of cs-dk theme:</b><br />
<div style="padding-left: 6ex;">
You have to create &quot;<b>Modifications.<span style="color: red;"><acronym title="Name of language that you are using">' 
$language '</acronym></span>.php</b>&quot; in the &quot;<b>languages</b>&quot; directory ( <i>'$settings['theme_url'], '/languages/</i> ) of your cs-dk theme.<br /><br />
Duplicate the &quot;<i>Modifications.english.php</i>&quot; of the &quot;languages&quot; directory of cs-dk. Next, rename it according to the language for which you use the file. 
</div>
</div>'
;
}
}
}

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



// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<div id="footer">
'
theme_copyright(), '<br /><br />Theme <b>CS-DK</b> created by <a href="http://padexx.de">panic</a>
</div>'
;
echo 
'
</div>'
;
// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
</td><td id="bg-r">&nbsp;</td></tr></table></body></html>'
;
}

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

echo '<div class="breadcrumb">'$txt['you are here: '] ,'<span class="pathway">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="pathway">' $tree['name'] . '</a>' $tree['name'] , ' &raquo; ';
else
echo $tree['name'];

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

}

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

// template_menu() IS THE MAIN MENU / top_menu IS THE "TOP" MENU ( [login]... )

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

// Work out where we currently are.
$current_action 'home';
if (in_array($context['current_action'], array('admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm''forum')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action 'forum';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' 'profile' 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first 'last';
$last 'first';
}
else
{
$first 'first';
$last 'last';
}

// Start of the tab section.
echo ' <div class="seperator"><!--no content--></div>';
// Show the [home] button.
if (!empty($settings['cs_forum_button']))
echo '
<div class="maintab_back">
<a href="'
$settings['cs_forum_button'], '">' $txt[103] , '</a>
</div>
<div class="seperator"><!--no content--></div>'
;

if (!empty($settings['cs_forum_button']))
{
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
<a href="'
$scripturl'">' $txt['cs_forum_button_forum'] , '</a>
</div>' 
$current_action == 'home' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';
}
else
{
// Show the [forum] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
<a href="'
$scripturl'">' $txt[103] , '</a>
</div>' 
$current_action == 'home' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

}

// Show the [forum] button. 

echo ($current_action == 'forum' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'forum' 'active_back' 'back' '">
<a href="'
$scripturl'?action=forum">'.$txt['sp-forum'].'</a>
</div>' 
$current_action == 'forum' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';


// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'help' 'active_back' 'back' '">
<a href="'
$scripturl'?action=help">' $txt[119] , '</a>
</div>' 
$current_action == 'help' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
<a href="'
$scripturl'?action=search">' $txt[182] , '</a>
</div>' 
$current_action == 'search' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
<a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
</div>' 
$current_action == 'calendar' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
<a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
</div>' 
$current_action == 'mlist' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// The end of tab section.
}

// Show the TOP_menu up top...
function top_menu()
{
global $context$settings$options$scripturl$txt;

// Work out where we currently are.
$current_action 'home';
if (in_array($context['current_action'], array('admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' 'profile' 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first 'last';
$last 'first';
}
else
{
$first 'first';
$last 'last';
}

// Start of the tab section.

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'admin' 'active_back' 'back' '">
<a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
</div>' 
$current_action == 'admin' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// How about the [quick links] button?
if ($context['user']['is_logged'])
echo '
<div class="toptab_back"><a href="'
$scripturl'#quicklinks" onClick="return overlay(this, \'quicklinks\',\'bottomleft\')">'$txt['quicklinks'] ,'&or;</a>
<!--Do not remove outer most DIV tag with id="quicklinks"-->
<div id="quicklinks" style="position:absolute; border: 2px solid #5377a0; width: 150px; padding: 0; display:none">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">'
$txt['quicklinks'] ,'</td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=unread">'$txt['q_newposts'] ,'</a></td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=unreadreplies">'$txt['q_newreplies'] ,'</a></td>
</tr>
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">'
$txt['q_usersettings'] ,'</td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=profile">'$txt['q_viewprofile'] ,'</a></td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=profile;u='$context['user']['id'], ';sa=account">'$txt['q_accountset'] ,'</a></td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=profile;u='$context['user']['id'], ';sa=forumProfile">'$txt['q_editprofile'] ,'</a></td>
</tr>
</table>
<div align="right" style="font-size:10px;"><a href="#" onClick="overlayclose(\'quicklinks\'); return false">'
$txt['q_close'] ,'</a></div>

</div>
</div><div class="seperator_top"><!--no content--></div>'
;

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'profile' 'active_back' 'back' '">
<a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
</div>' 
$current_action == 'profile' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'pm' 'active_back' 'back' '">
<a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
</div>' 
$current_action == 'pm' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'register' 'active_back' 'back' '">
<a href="'
$scripturl'?action=register">' $txt[97] , '</a>
</div>' 
$current_action == 'register' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'login' 'active_back' 'back' '">
<a href="'
$scripturl'?action=login">' $txt[34] , '</a>
</div>' 
$current_action == 'login' '<div class="menu_end_l"><!--no content--></div>' '<div class="menu_end_l"><!--no content--></div>';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'logout' 'active_back' 'back' '">
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
</div>' 
$current_action == 'logout' '<div class="menu_end_l"><!--no content--></div>' '<div class="menu_end_l"><!--no content--></div>';

// The end of tab section.
}

// 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>';
}

?>




It should work.
I already tested it and it will surely show the forum button

Goodluck to your site  ;D

blahblahblah

 :D!!

Ty ty works perfectly now.

I can't thank you enough!

KrazyZeldaFan

#40
Quote from: fangweile on June 12, 2008, 04:28:29 AM
Hello blahblah

Use this updated code
Replace your index.template.php

<?php
// Version: 1.1; 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'] = '1.1.5';

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

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

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$forum_version$language$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'], '" />', empty($context['robot_no_index']) ? '' '
<meta name="robots" content="noindex" />'
'
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['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'], '";
// ]]></script>
<title>'
$context['page_title'], '</title>';

// The ?fin11 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'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<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']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - 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" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}

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

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

// ]]></script>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td id="bg-l">
&nbsp;
</td>
<td width="900">
<div id="top">
<div class="top_menu">'
;
top_menu();
echo'
</div>
</div>
<div id="top-r">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0;">
<input type="text" name="search" value="'
$txt[182], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt[182], '...\';" style="width: 150px; margin-left: 40px;" /> ';

// 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>
<div id="trooper">
</div>'
;
if (empty($settings['header_logo']))
echo '
<div id="logo-bg"><a href="'
.$scripturl.'" title="">'$context['forum_name'], '</a></div>';
if (!empty($settings['header_logo']))
echo '
<div id="logo"><a href="'
.$scripturl.'" title=""></a></div>';

// The main menu
echo'
<div id="main_menu_l">
&nbsp;
</div>
<div id="main_menu_top">
&nbsp;
</div>
<div id="main_menu">
'
,template_menu(),'
</div>
<div id="main_menu_bot">
&nbsp;
</div>'
;

// The main content should go here.
echo'
<div id="content">'
;
if ($context['user']['is_admin'])
{
if (empty($settings['theme_version_attention']))
{
if ($forum_version != 'SMF 1.1.5')
echo '
<div style="margin: 0 2ex 2ex 2ex; padding: 2ex; border: 2px dashed #cc3344; color: black; background-color: #ffb76f;">
<div style="float: left; width: 2ex; font-size: 2em; color: red;">!!</div>
<b style="text-decoration: underline;">Attention of CS-DK theme:</b><br />
<div style="padding-left: 6ex;">
This theme doesn\'t correspond to the version of SMF that you are using. This theme is made for SMF 1.1.5 
</div>
</div>'
;
}
if (empty($txt['necessary_to_translate']))
{
echo '
<div style="margin: 0 2ex 2ex 2ex; padding: 2ex; border: 2px dashed #cc3344; color: black; background-color: #e7e7f7;">
<div style="float: left; width: 2ex; font-size: 2em; color: red;">!!</div>
<b style="text-decoration: underline;">Attention of cs-dk theme:</b><br />
<div style="padding-left: 6ex;">
You have to create &quot;<b>Modifications.<span style="color: red;"><acronym title="Name of language that you are using">' 
$language '</acronym></span>.php</b>&quot; in the &quot;<b>languages</b>&quot; directory ( <i>'$settings['theme_url'], '/languages/</i> ) of your cs-dk theme.<br /><br />
Duplicate the &quot;<i>Modifications.english.php</i>&quot; of the &quot;languages&quot; directory of cs-dk. Next, rename it according to the language for which you use the file. 
</div>
</div>'
;
}
}
}

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



// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<div id="footer">
'
theme_copyright(), '<br /><br />Theme <b>CS-DK</b> created by <a href="http://padexx.de">panic</a>
</div>'
;
echo 
'
</div>'
;
// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
</td><td id="bg-r">&nbsp;</td></tr></table></body></html>'
;
}

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

echo '<div class="breadcrumb">'$txt['you are here: '] ,'<span class="pathway">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="pathway">' $tree['name'] . '</a>' $tree['name'] , ' &raquo; ';
else
echo $tree['name'];

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

}

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

// template_menu() IS THE MAIN MENU / top_menu IS THE "TOP" MENU ( [login]... )

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

// Work out where we currently are.
$current_action 'home';
if (in_array($context['current_action'], array('admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm''forum')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action 'forum';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' 'profile' 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first 'last';
$last 'first';
}
else
{
$first 'first';
$last 'last';
}

// Start of the tab section.
echo ' <div class="seperator"><!--no content--></div>';
// Show the [home] button.
if (!empty($settings['cs_forum_button']))
echo '
<div class="maintab_back">
<a href="'
$settings['cs_forum_button'], '">' $txt[103] , '</a>
</div>
<div class="seperator"><!--no content--></div>'
;

if (!empty($settings['cs_forum_button']))
{
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
<a href="'
$scripturl'">' $txt['cs_forum_button_forum'] , '</a>
</div>' 
$current_action == 'home' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';
}
else
{
// Show the [forum] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
<a href="'
$scripturl'">' $txt[103] , '</a>
</div>' 
$current_action == 'home' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

}

// Show the [forum] button. 

echo ($current_action == 'forum' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'forum' 'active_back' 'back' '">
<a href="'
$scripturl'?action=forum">'.$txt['sp-forum'].'</a>
</div>' 
$current_action == 'forum' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';


// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'help' 'active_back' 'back' '">
<a href="'
$scripturl'?action=help">' $txt[119] , '</a>
</div>' 
$current_action == 'help' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
<a href="'
$scripturl'?action=search">' $txt[182] , '</a>
</div>' 
$current_action == 'search' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
<a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
</div>' 
$current_action == 'calendar' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '' '' '
<div class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
<a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
</div>' 
$current_action == 'mlist' '<div class="seperator"><!--no content--></div>' '<div class="seperator"><!--no content--></div>';

// The end of tab section.
}

// Show the TOP_menu up top...
function top_menu()
{
global $context$settings$options$scripturl$txt;

// Work out where we currently are.
$current_action 'home';
if (in_array($context['current_action'], array('admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' 'profile' 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first 'last';
$last 'first';
}
else
{
$first 'first';
$last 'last';
}

// Start of the tab section.

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'admin' 'active_back' 'back' '">
<a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
</div>' 
$current_action == 'admin' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// How about the [quick links] button?
if ($context['user']['is_logged'])
echo '
<div class="toptab_back"><a href="'
$scripturl'#quicklinks" onClick="return overlay(this, \'quicklinks\',\'bottomleft\')">'$txt['quicklinks'] ,'&or;</a>
<!--Do not remove outer most DIV tag with id="quicklinks"-->
<div id="quicklinks" style="position:absolute; border: 2px solid #5377a0; width: 150px; padding: 0; display:none">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">'
$txt['quicklinks'] ,'</td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=unread">'$txt['q_newposts'] ,'</a></td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=unreadreplies">'$txt['q_newreplies'] ,'</a></td>
</tr>
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">'
$txt['q_usersettings'] ,'</td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=profile">'$txt['q_viewprofile'] ,'</a></td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=profile;u='$context['user']['id'], ';sa=account">'$txt['q_accountset'] ,'</a></td>
</tr>
<tr>
<td align="left" valign="middle" class="windowbg"><a href="'
$scripturl'?action=profile;u='$context['user']['id'], ';sa=forumProfile">'$txt['q_editprofile'] ,'</a></td>
</tr>
</table>
<div align="right" style="font-size:10px;"><a href="#" onClick="overlayclose(\'quicklinks\'); return false">'
$txt['q_close'] ,'</a></div>

</div>
</div><div class="seperator_top"><!--no content--></div>'
;

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'profile' 'active_back' 'back' '">
<a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
</div>' 
$current_action == 'profile' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'pm' 'active_back' 'back' '">
<a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
</div>' 
$current_action == 'pm' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'register' 'active_back' 'back' '">
<a href="'
$scripturl'?action=register">' $txt[97] , '</a>
</div>' 
$current_action == 'register' '<div class="seperator_top"><!--no content--></div>' '<div class="seperator_top"><!--no content--></div>';

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'login' 'active_back' 'back' '">
<a href="'
$scripturl'?action=login">' $txt[34] , '</a>
</div>' 
$current_action == 'login' '<div class="menu_end_l"><!--no content--></div>' '<div class="menu_end_l"><!--no content--></div>';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '' '' '
<div class="toptab_' 
$current_action == 'logout' 'active_back' 'back' '">
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
</div>' 
$current_action == 'logout' '<div class="menu_end_l"><!--no content--></div>' '<div class="menu_end_l"><!--no content--></div>';

// The end of tab section.
}

// 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>';
}

?>




It should work.
I already tested it and it will surely show the forum button

Goodluck to your site  ;D

Hello i am having the same problem as him. I put your code in, but the text in the button will not show. Can someone help me out please

www.wiifps.atzend.com

ccbtimewiz

Add this into index.english.php.

Find:
Code (index.english.php) Select
?>

Add Before:
$txt['sp-forum'] = 'Forum';

KrazyZeldaFan

Quote from: ccbtimewiz on June 24, 2008, 10:52:56 PM
Add this into index.english.php.

Find:
Code (index.english.php) Select
?>

I don not see  index.english.php in my theme folder. :(

Add Before:
$txt['sp-forum'] = 'Forum';

[SiNaN]

It in the ../Themes/default/languages/ directory.
Former SMF Core Developer | My Mods | SimplePortal

Guitardeth

Quote from: [SiNaN] on June 25, 2008, 03:53:08 AM
It in the ../Themes/default/languages/ directory.

The zip file that contains the theme, or do i find it in the admin contorls?   i'm having the same problem, i looked in both and can't locate the english.index.php file.

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

firepack84

lol it's my turn I guess. I added that link, but doesn't work right for some reason? Here is the site hxxp:packersboard.com/forumtest/index.php [nonactive] You can see what happen to the top bar.


Quote from: desidude on June 12, 2008, 02:02:17 AM
look 4
// Show the [help] button.

and add dis code above it

// Show the [forum] button.
   echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '' : '' , '
            <div class="maintab_' , $current_action == 'forum' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '">' , $txt[103] , '</a>
            </div>' , $current_action == 'forum' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

Dante63s

I also have the same problema, I have zero clues on how fixing it!

I am using MC Dilber theme.

h4rvey

im also having this same issue with this theme http://custom.simplemachines.org/themes/index.php?lemma=731

can anyone assist me in adding a Forum button to the nav bar? ive tired to edit the .php files myself as stated in this forum but i just break it every time.

thanks in advance.

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

GeoO

Hey fangweile

Can you do this same for my smf theme , it name is Black_Berry_v2 please!  ;)

EDIT: I must have just portal and forum , so when i go on home,ther is a Simple Portal,and i can see the forum  :-\

Arantor

Hivzo: Please open a new topic. This is months old, and in any case we need to know what version of SMF.

speedrider

I have added the code.

The FORUM tab appears, but not in a nice way.
The embossed effect is not good as the original templates.

Im using MegaPolis template



Please guide me. Thank you.


Arantor

Quote from: Arantor on December 08, 2009, 10:11:50 AM
Hivzo: Please open a new topic. This is months old, and in any case we need to know what version of SMF.

And with you, speedrider.

Advertisement: