News:

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

Main Menu

How Do I Add A "Forum" Button To My Navigation Menu?

Started by XtcruleZ, January 05, 2010, 05:54:42 PM

Previous topic - Next topic

XtcruleZ

I know this topic has been discussed in other posts, but i cannot find one using my theme. I am using the Efsane Atomic theme. SMF v1.1.7 with the Simple Portal Mod. I have virtually no coding experience but i understand where/how everything works. Im looking to add a "Forum" button to my navigation bar and i have found other posts saying to copy this code and that code, but i am scared to try these on my site as the themes are completely different. I can post my current index.template.php code if needed. Can anyone help me out please?

Costa

Welcome to SMF communty Forum
Maybe this could help you? :)
How do you add custom tabs to the Core (default) theme menu?

Or attach your index.template.php and someone will help you :)
Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

Matthew K.

First of all, it's very highly suggested you update to 1.1.11 as a lot of security issues have been resolved since 1.1.7.

Second of all, yes, posting your index.template.php, or even better attaching it to your post is the quickest way to get support. If you'd also add the button information you want added. If you don't have the code written up for the button, including things like, who does the button show to and when, placement compared to other buttons in the navigation bar as well as smaller details like target of the URL would be great.

Labradoodle-360

XtcruleZ

I am stuck with my current SMF version as i get this error when i try and update it. The person who originally created the site has quit on us so i no longer have him to help me out. Here is the error i get:

Forbidden

You don't have permission to access /forum/index.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.7igaming.com Port 80



I have also attached my index.template.php file, thanks for the fast replies.

Matthew K.


Matthew K.

Please also add information on the button you want added and I'll do it for you.

XtcruleZ

Quote from: Labradoodle-360 on January 05, 2010, 06:04:38 PM
So you don't have server access? :-\

I have FULL FTP access to the server, thats why i dont understand why i get this error.

XtcruleZ

#7
Quote from: Labradoodle-360 on January 05, 2010, 06:05:11 PM
Please also add information on the button you want added and I'll do it for you.

I want the button to say Forum and link to this url: EDITED

Matthew K.

In the ACP, what is ScriptURL defined as? hxxp:www.7igaming.com/forum/index.php?

XtcruleZ

#9
Quote from: Labradoodle-360 on January 05, 2010, 06:18:48 PM
In the ACP, what is ScriptURL defined as? hxxp:www.7igaming.com/forum/index.php?

Im sorry, it should be http not hxxp. And ACP means Admin Control Panel right? I do not see ScriptURL, i see Forum URL, and it is :
http://www.7igaming.com/forum

Matthew K.

Yes, that's what defines scripturl, I believe.

Okay, I'll get back to you in a minute.

Arantor

$scripturl is defined in QueryString.php as being $boardurl plus "/index.php" on the end.
Holder of controversial views, all of which my own.


Matthew K.

Placement - Where in the menu would you like it to be placed?
Requirements - Will this button be visible to everyone?

XtcruleZ

Quote from: Labradoodle-360 on January 05, 2010, 08:11:40 PM
Placement - Where in the menu would you like it to be placed?
Requirements - Will this button be visible to everyone?

I would like it to the right of "Home" if thats possible. If not, i guess anywhere in the Nav Bar would be fine. Please see the Pic below for reference.


XtcruleZ

Quote from: Arantor on January 05, 2010, 08:02:18 PM
$scripturl is defined in QueryString.php as being $boardurl plus "/index.php" on the end.

Im getting confused now, lol, why do we need this information? Like i said, i dont have any experience in coding. I know thats not very helpful, sorry.

Matthew K.

No, I was just talking with Arantor, no bother :P

I'll get back to you shortly with the result.


Matthew K.

Are you aware of this already being in index.template.php as a button // Show the [forum] button.
    global $modSettings;
    if (in_array($modSettings['sp_portal_mode'], array(1, 3)))
      echo '<li', $current_action=='forum' ? ' id="active"' : '', '><a href="', $scripturl . ($modSettings['sp_portal_mode'] == 1 ? '?action=forum' : ''), '">', empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'], '</a></li>';

Should that be removed?

XtcruleZ

I think that is our current Forum button, right above "Home". That should be removed when the new one is in the Nav Bar yes.

Matthew K.

What is wrong with the current "Forum" button? What does/doesn't it do that you want it to/don't want it to?

Advertisement: