Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: jake1981 on May 19, 2007, 04:03:26 PM

Title: Website Button
Post by: jake1981 on May 19, 2007, 04:03:26 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=814)

..------=================================
Website Button (wsbutton)
Version 1.1.1

Author: Oskari Rauta/Jake Irons
-----------=======================-------------..

What's new in 1.1.1?
- Fixed couple of typos in readme :)

This mod adds a new button to your forum's navigation bar: website (text can be changed from language file).

It also adds section website to your forum's settings where you can set URL for it.

What is this kind of mod good for? Well, if you have a portal/forum is integrated to site, for e.g. with mkportal, you might want to exit forum to website WITHOUT logging out as you might have there features that require that user is logged on. Most other forums have this feature but smf did miss it. Apply this mod if you need such feature.

It's designed to mimic other forum buttons so it fits very nicely. This mod includes also image buttons for babylon and classic themes in 2 languages: english and finnish.

This mod supports multiple languages and offers out of the box support for english and finnish (if board has finnish language installed). Also if you use core/default theme(buttons without images) and other language than english or finnish, this mod detects that it has not been translated yet for that language and defaults to english. (Not for admin panel though, admin panel part supports english and finnish and if you use other language, you need to add support for your language by changing language files)

Language support: yes, provided: english & finnish
Skin support: yes, provided: core/default, classic and babylon

Works just great with portals / site-integration.
Title: Re: Website Button
Post by: rehan on May 20, 2007, 07:52:49 AM
Firstly Thanks for sucha great MOD.. i was looking for it..
I installed it with city scape theme.. i can set the url from "features and options" but its not appearing..
any suggetions...
Title: Re: Website Button
Post by: samozin on May 20, 2007, 08:55:57 AM
man. thats  good  work but it still needs more work ....ur mod just can add one button ..... and u cant customize the name of the website button

and u need to to tell from where one can change the website url
i couldnt  know it untill rehan told where to get it
Title: Re: Website Button
Post by: rehan on May 20, 2007, 09:55:58 AM
but mine is not showing.. i think its disabled frm somewhere... :S :S
Title: Re: Website Button
Post by: TEOC2 on May 20, 2007, 11:22:16 AM
Here is the settings menu.

Title: Re: Website Button
Post by: rehan on May 21, 2007, 01:14:15 AM
i did it but still its not showing.. is it coz of my theme (city scape)??
Title: Re: Website Button
Post by: TEOC2 on May 21, 2007, 07:22:23 PM
In the default theme, this is the settings page,

(http://i5.photobucket.com/albums/y185/binkles/th_website.jpg) (http://i5.photobucket.com/albums/y185/binkles/website.jpg)
^click to enlarge^
Title: Re: Website Button
Post by: nitsua on May 22, 2007, 07:11:33 PM
is there a way that instead of it saying "website" can I make it say something else?
Title: Re: Website Button
Post by: axlarry on May 23, 2007, 05:04:10 PM
Quote from: binklespup on May 21, 2007, 07:22:23 PM
In the default theme, this is the settings page,

(http://i5.photobucket.com/albums/y185/binkles/th_website.jpg) (http://i5.photobucket.com/albums/y185/binkles/website.jpg)
^click to enlarge^

I can't see the "website" button. I'm using default theme.
any clue?
Title: Re: Website Button
Post by: Greengoat on May 25, 2007, 12:08:52 AM
Is there a way to duplicate the button and rename the new one?

For instance one website button labeled "website 1", and another button labeled "website 2".  I will probably give this one a try even for just one button, but having two would be even better.

Thanks.
Title: Dutch Translation
Post by: forumnet.be on May 25, 2007, 11:09:40 AM
If you need help translating to Dutch give me a yell ...  ;D
Send me the files that need a translation. I'm not good in browsing, uploading, and stuff... only in translation.  ;)

Patrick.
Title: Re: Website Button
Post by: nitsua on May 26, 2007, 11:28:38 AM
i really am not one to double post but can someone answer this question?

Is there a way that instead of it saying "website" can I make it say something else?
Title: Re: Website Button
Post by: Davey D. on May 28, 2007, 12:15:30 AM
Looks like the developer made this and then ran for the border.
Title: Re: Website Button
Post by: bolo1122 on May 29, 2007, 11:43:55 PM
so it seems...... :(
Title: Re: Website Button
Post by: celijakija on June 01, 2007, 04:17:48 AM
Quote from: axlarry on May 23, 2007, 05:04:10 PM
Quote from: binklespup on May 21, 2007, 07:22:23 PM
In the default theme, this is the settings page,

(http://i5.photobucket.com/albums/y185/binkles/th_website.jpg) (http://i5.photobucket.com/albums/y185/binkles/website.jpg)
^click to enlarge^

I can't see the "website" button. I'm using default theme.
any clue?
Quote from: axlarry on May 23, 2007, 05:04:10 PM
Quote from: binklespup on May 21, 2007, 07:22:23 PM
In the default theme, this is the settings page,

(http://i5.photobucket.com/albums/y185/binkles/th_website.jpg) (http://i5.photobucket.com/albums/y185/binkles/website.jpg)
^click to enlarge^

I can't see the "website" button. I'm using default theme.
any clue?

change the default forum language to english...it worked for me...then change the url and return to your normal language....
Title: Re: Website Button
Post by: gffb on June 04, 2007, 02:04:26 PM
Quote from: nitsua on May 22, 2007, 07:11:33 PM
is there a way that instead of it saying "website" can I make it say something else?

Try this...
look for file boarddir/Themes/default/languages/ModSettings.english.php
then look for $txt['websiteButton_title'] = 'Website';
and chnage the word Website to suit your needs.
Title: Re: Website Button
Post by: TimL on June 06, 2007, 03:57:38 PM
Quote from: gffb on June 04, 2007, 02:04:26 PM
Try this...

Try this means, "it might work. It doesn't.
Title: Re: Website Button
Post by: gffb on June 08, 2007, 01:54:58 AM
Should work :)
Title: Re: Website Button
Post by: Anafiel on June 10, 2007, 08:04:31 PM
Mod works fine, and was able to modify text to be more consistent with my site, but I DO have an issue.

I would like a new window spawned, instead of opening the "website" in the same window.  I don't want to replace the forum with the website as it does now.

Can this be done?

Anafiel
Title: Re: Website Button
Post by: gffb on June 11, 2007, 12:47:11 PM
Try looking for <a href="', isset($modSettings['websiteButton_url' and place target="_blank" before the href so you end up with something like this <a target="_blank" href="', isset($modSettings['websiteButton_url'.

There are a few instances of the in index.template I am not sure which one it is but always make a backup of any file you change .
Title: Re: Website Button
Post by: ShadowStriker on June 16, 2007, 02:52:40 PM
Works great thanks!
Title: Re: Website Button
Post by: jake1981 on June 16, 2007, 07:07:23 PM
Okay, it seems that there has been a lot of speak about my MOD, sorry I've been coding new MODs..
Yeah, I haven't escaped from country, I've just been busy while creating more stuff..

Let's answer some questions now:

1) I cannot see website button
It has been designed to work ONLY on themes default, classic and babylon. Themes that do not come with "stock" SMF are not supported, support is easy to add for other themes, but you need to do this hand and I'm far too busy to help you out with this, if you have knowledge of PHP you should be able to do this really easily, just check what my MOD added to stock themes and copy similar stuff to your custom theme..

2) I cannot see website button settings in "Features and settings" of admin center!!
Setup has initially been only for supported languages, check out my MOD's page to see what languages are supported.. For non supported languages my button will show (but uses english) but setup won't show to other languages than supported. You can add support for other languages by copying and translating stuff added by my MOD from file modSettings.english.php. Check out what my MOD added to there and translate it to your own language file modSettings.swedish.php for e.g. if you use swedish as your boards language.. File is located in boarddir/Themes/default/languages

3) I want it to say something else than "Website"
Okay, for default theme, go to boarddir/Themes/defaut/languages and open up file index.english.php (or index.yourlanguage.php) and find


$txt['websiteButton_txt'] = 'Website';
$txt['websiteButtonAlt_txt'] = 'Website';


from near end of file. Change 'Website' on both to what you want it to say..

And if you use classic or babylon, go to boarddir/Themes and then babylon or classic(which one you use) and there images and english(or what is chosen language). There you find file websiteButton.gif, edit this image or replace it with button image of your choice (you need to keep same name and picture must be in GIF format)

4) I want to add more buttons
Try my chatroom button MOD. It adds another button and gives even more settings (you can hide it from guests and you can make link to open into new window) and can be manipulated like this button, when you edit language texts, just find chatroom instead of website to change settings of chatroom button :)

5) I want my website button to open to new window
Open index.template.php in your theme's directory and find function show_websitebutton()
from there and edit text where it creates the link (looks similar to this <a href="'..).
Before > in section starting with <a href add this:

target="_blank"


Okay, and before anyone edits their files: take backup, if you mess it, it's a lot easier to return backups instead of fixing a mess..

And someone sayed that people should change texts in modSettings.english.php to change text "Website", changing texts there will change titles used in "Features and settings", the look of button will not change..
Title: Re: Website Button
Post by: AdrenalineRider on July 26, 2007, 07:48:26 AM
Amazing Mod, works for me. Would work on the "Website" & change the name of it, may be "Home"
Title: Re: Website Button
Post by: ApplianceJunk on August 04, 2007, 04:19:19 PM
Looks just like what I want to do, thanks!

Now if I can get it to work.
I did download it and then tried to install it.
Then I got this message.
I am running SMF 1.1.3 is that why?


Quote
Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.


   Type     Action     Description
1.    Execute Modification    ./Themes/babylon/index.template.php    Test successful
2.    Execute Modification    ./Themes/classic/index.template.php    Test successful
3.    Execute Modification    ./Themes/default/index.template.php    Test successful
4.    Execute Modification    ./Sources/ModSettings.php    Test successful
5.    Execute Modification    ./Themes/default/languages/Help.english.php    Test successful
6.    Execute Modification    ./Themes/default/languages/Help.finnish.php    Skipping file
7.    Execute Modification    ./Themes/default/languages/Help.german.php    Skipping file
8.    Execute Modification    ./Themes/default/languages/ModSettings.english.php    Test successful
9.    Execute Modification    ./Themes/default/languages/ModSettings.finnish.php    Skipping file
10.    Execute Modification    ./Themes/default/languages/ModSettings.german.php    Skipping file
11.    Execute Modification    ./Themes/default/languages/index.english.php    Test successful
12.    Execute Modification    ./Themes/default/languages/index.finnish.php    Skipping file
13.    Execute Modification    ./Themes/default/languages/index.german.php    Test failed
14.    Extract Tree    ./Themes    
15.    Execute Code    add_settings.php
Title: Re: Website Button
Post by: jake1981 on August 24, 2007, 12:16:29 AM
Quote from: ApplianceJunk on August 04, 2007, 04:19:19 PM
Looks just like what I want to do, thanks!

Now if I can get it to work.
I did download it and then tried to install it.
Then I got this message.
I am running SMF 1.1.3 is that why?


Quote
Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.


   Type     Action     Description
1.    Execute Modification    ./Themes/babylon/index.template.php    Test successful
2.    Execute Modification    ./Themes/classic/index.template.php    Test successful
3.    Execute Modification    ./Themes/default/index.template.php    Test successful
4.    Execute Modification    ./Sources/ModSettings.php    Test successful
5.    Execute Modification    ./Themes/default/languages/Help.english.php    Test successful
6.    Execute Modification    ./Themes/default/languages/Help.finnish.php    Skipping file
7.    Execute Modification    ./Themes/default/languages/Help.german.php    Skipping file
8.    Execute Modification    ./Themes/default/languages/ModSettings.english.php    Test successful
9.    Execute Modification    ./Themes/default/languages/ModSettings.finnish.php    Skipping file
10.    Execute Modification    ./Themes/default/languages/ModSettings.german.php    Skipping file
11.    Execute Modification    ./Themes/default/languages/index.english.php    Test successful
12.    Execute Modification    ./Themes/default/languages/index.finnish.php    Skipping file
13.    Execute Modification    ./Themes/default/languages/index.german.php    Test failed
14.    Extract Tree    ./Themes    
15.    Execute Code    add_settings.php

Are you using possibly german language on your forum? You can safely apply mod even with this error, but I'll check my mod back later, it seems that test is failed with german translation that should be optional, but I might have been sloppy with it :)
Title: Re: Website Button
Post by: Jade Elizabeth on October 08, 2007, 09:47:10 PM
it installed fine on 1.1.4 but i cannot see the website tab
i set up the link right...but it doesnt show.

ive scoured my admin panel and cant find anything that says "allow website button" or the like lol
im aware that its for 1.1.3 but there really cant be so much coding difference as to stop the mod without showing an error message.
anything i can do? lol

EDIT: works now...kinda weird...lol
Title: Re: Website Button
Post by: eleven0 on October 28, 2007, 01:15:33 AM
Fatal error: Cannot redeclare show_websitebutton() (previously declared in /home/*****/public_html/forum/Sources/Load.php(1735) : eval()'d code:653) in /home/*****/public_html/forum/Sources/Load.php(1735) : eval()'d code on line 662

I need help solving this problem.  My forum is down.
Title: Re: Website Button
Post by: eleven0 on October 28, 2007, 01:16:24 AM
Fatal error: Cannot redeclare show_websitebutton() (previously declared in /home/*****/public_html/forum/Sources/Load.php(1735) : eval()'d code:653) in /home/****/public_html/forum/Sources/Load.php(1735) : eval()'d code on line 662


I need help solving this problem. My forum is down.
Title: Re: Website Button
Post by: shadow82x on October 28, 2007, 01:19:53 AM
Delete the repeating code in index.template.php  that file starting with show_websitebutton() or post the file here..

How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)
Title: Re: Website Button
Post by: eleven0 on October 28, 2007, 08:25:39 PM
Thank you, already fixed it.
Title: Re: Website Button
Post by: romuba on November 09, 2007, 06:59:43 AM
Worked first time and perfectly for me - thank you very much.
Title: Re: Website Button
Post by: romuba on November 10, 2007, 10:52:56 AM
Quote from: gffb on June 04, 2007, 02:04:26 PM
Quote from: nitsua on May 22, 2007, 07:11:33 PM
is there a way that instead of it saying "website" can I make it say something else?

Try this...
look for file boarddir/Themes/default/languages/ModSettings.english.php
then look for $txt['websiteButton_title'] = 'Website';
and chnage the word Website to suit your needs.
I also tried it and nothing changed. Is there something that I am missing? I changed it to read: $txt['websiteButton_title'] = 'St Matthew's Website';
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 01:52:48 PM
try 'St Matthew/'s Website'

Title: Re: Website Button
Post by: romuba on November 10, 2007, 02:05:51 PM
I made the change as you, Alundra, suggested but still the button shows as Website.
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 02:17:09 PM
Quote from: romuba on November 10, 2007, 02:05:51 PM
I made the change as you, Alundra, suggested but still the button shows as Website.

hold on lemme see where i changed mine
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 02:18:40 PM
$txt['websiteButton_txt'] = 'Jades-World';  <found it

/Themes/default/languages/index.english.php

:D
Title: Re: Website Button
Post by: romuba on November 10, 2007, 02:21:43 PM
Correct, that's where I changed it too, as mentioned above; "I changed it to read: $txt['websiteButton_title'] = 'St Matthew's Website';" but the tab on the forum didn't change, even after I added the / .
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 02:24:48 PM
$txt['websiteButton_txt'] = 'Jades-World';
$txt['websiteButton_title'] = 'St Matthew's Website';

well now i see the difference ;)
you edited the wrong part darls lol
Title: Re: Website Button
Post by: romuba on November 10, 2007, 02:29:06 PM
Thanks, I will see if I can fix it...
Title: Re: Website Button
Post by: romuba on November 10, 2007, 02:34:56 PM
Alundra, there is no $txt['websiteButton_txt'] in my index.english.php file, must I add it in, and if so exactly where?
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 03:09:22 PM
are you sure? it should be right down the bottom...


$txt['websiteButton_txt'] = 'Jades-World';
$txt['websiteButtonAlt_txt'] = 'The forums website'
;
?>



http://www.bartwebsites.com/forum/index.php?  ....i dont even see a website BUTTON lol

send me the file and ill take a look

Title: Re: Website Button
Post by: romuba on November 10, 2007, 03:12:03 PM
Sorry, it is not that website. The one I am busy with is http://www.stmatthews.co.za/hp_smf/index.php
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 03:20:25 PM
okay well i see a button now ;)

send me the index.english.php file
Title: Re: Website Button
Post by: romuba on November 10, 2007, 03:32:39 PM
I found the file eventually. I have been changing in the ModSettings.english.php file. I changed what I thought was the stuff in the index.english.php now but it just gave me errors.
I have attached it.
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 03:42:38 PM
did you change the modsettings file back?
Title: Re: Website Button
Post by: romuba on November 10, 2007, 03:45:54 PM
No, do you want me to?
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 03:48:28 PM
yes, change it back to how it was before you put your website name in there!

Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 03:50:06 PM
try this one...
Title: Re: Website Button
Post by: romuba on November 10, 2007, 03:55:54 PM
I uploaded the file, refreshed and got this;

orum Website Homepage' ; ?>

at the top of the page and then the rest as before...
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 04:12:09 PM
yeah...i see it...did you change the mod settings back to exactly how it was before you edited it??

$txt['websiteButton_title'] = 'Website';
$txt['websiteButton_url'] = 'Website URL';


try this file
Title: Re: Website Button
Post by: romuba on November 10, 2007, 04:16:38 PM
Yes I had - your latest change has done it. Amazing how small things mess things up. Thank you very much for your help.
Title: Re: Website Button
Post by: Jade Elizabeth on November 10, 2007, 04:18:04 PM
hey, i needed an ego fix ;)

naw kidding, i had to change it too....i couldnt handle "website" i HAD to have "jades-world" as per the name of my site :D
Title: Re: Website Button
Post by: romuba on November 10, 2007, 04:20:05 PM
You have exceeded my expectation for a young girl. You have made me very happy - I also didn't find Website very inspiring.
Title: Re: Website Button
Post by: rehan on November 13, 2007, 02:22:11 PM
hi..
i have installed it.. its appeating in admin panel too. but not on forum links
my theme is city scape.. any suggetions?
Title: Re: Website Button
Post by: romuba on November 13, 2007, 02:37:36 PM
Have you read all the posts in this thread rehan - I had to do it with another website forum and when I followed all the info here I eventually managed to get it right. I found that the file to edit is the index.english.php found in the Language Folder of the Theme file. From what I have read I think that it actually only works with the Default Theme but I might be wrong on that.

At the bottom of this file you will find $txt['websiteButton_txt'] = 'Website';  Simply change the word Website to what you want.
e.g. $txt['websiteButton_txt'] = 'rehan';

I must admit that fiddling with php files is not easy when you don't know what you are doing, so be careful and make sure that you backup first.
Title: Re: Website Button
Post by: rehan on November 14, 2007, 02:53:43 AM
thanks.. But my problem is not changing the webiste button text..
its just not appearing.. I can't see it in my forum navigation.. :)
Thats what i am asking about.. whichfiles i need to edit so it will show in the navigation bar...
Title: Re: Website Button
Post by: romuba on November 14, 2007, 03:15:06 AM
On the first post - where the mod is linked to the following is stated:
QuoteLanguage support: yes, provided: english & finnish - Skin support: yes, provided: core/default, classic and babylon
Title: Re: Website Button
Post by: TrueSatan on November 14, 2007, 05:02:17 AM
@ rehan

Please consider using the search function before posting as this query is the most common one of all on all the mod topics and has been answered countless thousands of times.

Very few mods install into anything but the SMF default theme...this particular one handles two additional custom themes. For all other themes on almost all other mods you will have to perform manual installations into your chosen custom theme.
Title: Re: Website Button
Post by: Jade Elizabeth on November 14, 2007, 05:12:56 PM
im curious...did you type all that out when you could have just linked him or do you have a javascript?

if you have the java shame on you, you could have made it longer and more annoying :P

rehan i had the same problem, put the right code in the board index template :)
Title: Re: Website Button
Post by: rehan on November 15, 2007, 12:19:18 AM
right code.???
wat is this right code.../??
Title: Re: Website Button
Post by: Jade Elizabeth on November 15, 2007, 12:29:25 AM
use one of the below

http://www.smfhacks.com/packageparser/package.php
http://sleepycode.com/PackageParser/index.php

select the mod from your computer, and then look for whats needed in the display and board templates and make sure its there :D
Title: Re: Website Button
Post by: rehan on November 15, 2007, 11:30:04 AM
thX...
It was asking to edit few files which dont exist in my theme folder of city scape..
so i edited my theme file manually and was able to add the new button.. I added 2 buttons doing this.. one for my gallery and other for arcade section...
Title: Re: Website Button
Post by: romuba on November 16, 2007, 12:44:52 AM
That is very good, which file and what did you edit?
Title: Re: Website Button
Post by: rehan on November 16, 2007, 01:03:00 AM
i edited index.template.php file inside my theme folder..

it wasn't hard to understand the button's code...


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

// add buttons here
$context['menubox'] = array();

/*
'title' - the string the link will have
'link' - the actual link
'chosen' - which "current_action" this button belongs to.
'memberonly' - show it JUST for members
'guestonly' - show it JUST for guests
'permission' - any permission you want to check before displaying the button

*/

// home button
$context['menubox'][]=array(
'title' => $txt[103],
'link' => $scripturl,
'chosen' => '',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);

// Arcade button
$context['menubox'][]=array(
'title' => 'Arcade',
'link' => $scripturl.'?action=arcade',
'chosen' => 'Arcade',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);

// Gallery button
$context['menubox'][]=array(
'title' => 'Gallery',
'link' => 'http://www.circlebakote.com/gallery/index.php',
'chosen' => 'Arcade',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);



I just copy pasted the home button code for arcade and gallery..
Title: Re: Website Button
Post by: romuba on November 16, 2007, 02:19:13 AM
Thanks a stack, I will give it a go.
Title: Re: Website Button
Post by: chrishicks on February 11, 2008, 10:41:36 AM
anyone care to give me a tip on how to move the location of the button? its located all the way to the left but I'd like it at the right. dp I just take this code and place it after the code for the button I want it next to?

// Show the [website] button.

   show_websiteButton();
   
   


or is there something else I need to do as well?
Title: Re: Website Button
Post by: Jade Elizabeth on February 11, 2008, 11:43:57 AM
Yeah, thats how you do it :D
If it fails, try again untill you get it right :D
Title: Re: Website Button
Post by: djfermin on February 14, 2008, 02:56:22 AM
spanish gif ....
Title: Re: Website Button
Post by: christinedlrp on March 14, 2008, 05:21:52 AM
I'm having trouble adding the website button code to the Exodus theme.  Can someone please add it for me?  :D
Title: Re: Website Button
Post by: 58tbird on March 29, 2008, 03:40:15 PM
Quote from: chrishicks on February 11, 2008, 10:41:36 AM
anyone care to give me a tip on how to move the location of the button? its located all the way to the left but I'd like it at the right. dp I just take this code and place it after the code for the button I want it next to?

// Show the [website] button.

   show_websiteButton();
   
or is there something else I need to do as well?

I have the same question - but I don't know what file to make these changes to.  I would like to move it just to the right of the Home tab. Nevermind - I found it in the index.template.php

However, I would like some help on this: when I click the Website tab, it works just fine, but the Home tab remains highlighted.  This give the impression one is still on the Home page.  Any way to make the Home tab return to normal size and dark blue, and make the Website tab enlarge and turn light blue after it's selected?

I noticed that the code for the other tabs (aside from the actual names of the tabs) appear this way:
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

...versus the code I quoted from chrischicks above for the Website Button.  I thought maybe I could simply copy this and change the names to match my new Website tab, but I noticed all the standard tabs contain their own unique number.  In the example shown here for the Home tab, it references "$txt[103]";  Help is "$txt[119]"; Search in "$txt[182]", etc.  Otherwise, they are all the same. 

Does anyone know how to make the new Website tab behave the same way all the other tabs do?
Title: Re: Website Button
Post by: perplexed on March 31, 2008, 06:52:44 PM
$txt['websiteButton_title']   - have you tried adding this in place of the $txt[103]etc?  I haven't tried it myself as I don't have this mod, but in lieu of a better reply...  I would say you need all of what is quoted in your post for the tabs to behave correctly as they have the maintab_active, active_back image references in them
Title: Re: Website Button
Post by: 58tbird on April 01, 2008, 01:00:44 AM
Thank you my friend!

I hadn't thought of that - I don't really understand code much at all.  I tried your suggestion by replacing:
// Show the [website] button.

   show_websiteButton();


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


Then when I clicked on my News Alert tab I got the attached error.

The url for the custom action page I created is: http://mywebsite.com/index.php?action=News%20Alerts
So I figured I should put "News%20Alerts" after "action=" to match the other buttons (except Home, which has a different url).  I'm not sure at all if I should put "$txt['websitebutton_News Alerts']" or "$txt['websitebutton_News%20Alerts']" or some other variation.

Also, I don't know if I should replace this
// Show the [website] button.

   show_websiteButton();
or add the new code before/after it.

I see what the error highlights, but does that mean that's the only problem?
Title: Re: Website Button
Post by: perplexed on April 01, 2008, 07:07:02 AM
I think it might be easier just to add the tab manually this way http://www.simplemachines.org/community/index.php?topic=63203.0
Title: Re: Website Button
Post by: 58tbird on April 01, 2008, 11:34:22 AM
Thank you for the suggestion to use the Add a Tab Mod.  I already tried that (http://www.simplemachines.org/community/index.php?topic=63203.msg1486844#msg1486844), however, but I couldn't figure out a way to make the new tab open the News Alerts page (created using the Custom Action Mod).  I agree, however, that seems like the more logical approach to this dilemma, and I would prefer to use that solution in case I need to do something this again in the future.
Title: Re: Website Button
Post by: perplexed on April 01, 2008, 11:58:41 AM
@ 58tbird I used to do this for one of my sites and the tab opened the external site no probs.

I have installed the website button again and I have moved italong the tab bar, and tried linking it to various internal forum pages and it works ok.  If you are linking to something inside the forum though then the home tab will stay highlighted probably because you are still there.  I tried linking it to the profile page and that took you to profile and then highlighted the profile tab since that's where I now was.  I think it's working the way it should be.

What page did you want to link it to, something internal or external?  If it's a page within the forum then I think that tab will stay highlighted to indicate you are still on the forum.
Title: Re: Website Button
Post by: 58tbird on April 01, 2008, 01:18:13 PM
Wow, perplexed, I hope you're not going to too much trouble here for me.  I appreciate all your help on this.

I believe you can view my page here (http://auditbible.com/index.php?action=News%20Alerts).  It's internal to my forum.  I was hoping to have the tab indicate to members and guests that they are currently on the News Alerts page.  Instead, when they're on this page, it appears by the highlighted Home tab that they're on the Home page.

I'm wondering if $txt[103], etc. refers to a file somewhere that lists the various pages and assigns them a number.  If so, maybe I could assign a number to my News Alerts page so the code will call it just like all the others.  I guess not...according to  How do you add custom tabs (http://docs.simplemachines.org/index.php?topic=564)   
Quote* $current_action=='home' - is what sets the tab for the current actions.  As you can see it is defined in 3 instances.  You will need to change it for all three of them.
    * ' , $txt[103] , ' - is the text string that prints Home on the Main menu.  As you see the variable is inside ' , , '.  The reason for this is because it's inside an echo.  If you are going to hard code the name in the menu you do not need to put ' , , ' around it.

I wonder what I need to do to hard code this, and if that's the solution I'm looking for.
Title: Re: Website Button
Post by: 58tbird on April 02, 2008, 02:15:59 AM
Well, I tried using $txt['websiteButtonAlt_txt'] in the code in place of ' , $txt[103] , ' but it seems the code is ignored and only the // Show the [website] button.

   show_websiteButton();
works.  I tried eliminating it but the result is that clicking on the News Alerts tab has no effect (stays on Home page).

I suspect it must have something to do with the preceding section of the code which seems to define the operation:
// Show WebsiteButton
function show_websiteButton()
{
global $context, $txt, $modSettings;

echo $context['browser']['is_ie4'] ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '', '
<td valign="top" class="maintab_back">
<a href="', isset($modSettings['websiteButton_url']) ? $modSettings['websiteButton_url'] : 'http://www.roadrunner.cx', '" alt="', isset($txt['websiteButtonAlt_txt']) ? $txt['websiteButtonAlt_txt'] : 'Website', '">',
isset($txt['websiteButton_txt']) ? $txt['websiteButton_txt'] : 'Website', '</a>
</td>';
}
// 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', 'bookmarks', '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'] == 'news')
$current_action = 'news';
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';
}

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


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

// Show the [website] button.

show_websiteButton();

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


I just don't know how to read this stuff. :(
Title: Re: Website Button
Post by: ccbtimewiz on April 02, 2008, 03:10:04 PM
Here, I've taken the liberty to make my own small modification in the code.

Uninstall the website button modification and place this instead. Please note I am in no way affiliated with the mod author of the Website Button modification and I don't intend to "rival" them. This is just a solution to solve your problem.

Replace the code you posted above with this:

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

// Website Button modification.
// --- Main override of the modification. Use "Yes" to enable, use "No" to disable.
$enable_website_button = 'Yes';
// --- Replace this with your own link. Only works if "Yes" is put into the enable_website_button field.
$website_button_link = 'http://www.roadrunner.cx';
// --- The actual text of the button. Only works if "Yes" is put into the enable_website_button field.
$website_button_text = 'Road Runner';
//--------

// 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', 'bookmarks', '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'] == 'news')
$current_action = 'news';
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';
}

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


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

// Your [website] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="'.$website_button_link.'" target="_blank">'.$website_button_text.'</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: Website Button
Post by: 58tbird on April 03, 2008, 02:30:31 AM
Thank you ccbtimewiz!  I'm eager to try your solution, however, I'm a little stuck.

I've been trying to uninstall the Website Button mod but two files fail the test.  After using the package parser and making several unsuccessful attempts to locate and correct the manual changes I may have made that are causing the test failure, I dug down through previous backups to my themes/default/index.template.php, and finally found one to revert back to that passes the test. 

But I also fail Themes/default/languages/index.english.php.  I don't remember altering this file manually at all, like I did the index.template.php.  Using the package parser, I see the only thing needed for uninstalling is to delete $helptxt['websiteButton_url'] = 'This is URL where you want your website button to point to, for example http://www.roadrunner.cx';however, I've searched that file and this line doesn't exist. 

Using the package parser, instructions to install show that code is to be added to the end of the file.  I tried adding it here:
$txt['websiteButton_txt'] = 'News Alerts';
$txt['websiteButtonAlt_txt'] = 'News Alerts'
;
?>

to look like this:
$txt['websiteButton_txt'] = 'News Alerts';
$txt['websiteButtonAlt_txt'] = 'News Alerts'
;
$helptxt['websiteButton_url'] = 'This is URL where you want your website button to point to, for example http://www.roadrunner.cx';
?>
but it still fails the test.  Since I'm new, I don't know if it's safe to go ahead with the uninstall or not.  Can you advise me how I should proceed?
Title: Re: Website Button
Post by: ccbtimewiz on April 03, 2008, 12:22:14 PM
Proceed with uninstalling.
Title: Re: Website Button
Post by: 58tbird on April 04, 2008, 02:42:39 AM
ccbtimewiz - I really appreciate all your help on this!

I finally got enough time to revert back to an earlier index.template, uninstall the Website Button mod, and manually insert your code into the index.template.

Now, the News Alerts tab is highlighted simultaneously whenever the Home tab is selected.  I checked, and both tabs appear normal when any of the other tabs are selected.

Also, when I select the News Alerts tab, it opens my News Alerts page in a new window (and the Home & News Alerts tabs are highlighted in the new window).

I think if these are my only choices, I would prefer to have my page open within the same window and not have the tab highlight properly as it was before.

You've done quite a bit of work on this so I don't mean to wear out my welcome.  But would it be difficult to correct these two issues?

Again, I truly appreciate you for your help. :)
Title: Re: Website Button
Post by: ccbtimewiz on April 04, 2008, 12:25:20 PM
The website button opens in a new page because I made it do so. I can make it so it opens in the same window, but I cannot make the tab bold. That is impossible because the link you are linking to with the button is an external site.

Replace this
// Your [website] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="'.$website_button_link.'" target="_blank">'.$website_button_text.'</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


With this:
// Your [website] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="'.$website_button_link.'" target="_'.$website_button_type.'">'.$website_button_text.'</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Replace this:
// --- The actual text of the button. Only works if "Yes" is put into the enable_website_button field.
$website_button_text = 'Road Runner';


With this:
// --- The actual text of the button. Only works if "Yes" is put into the enable_website_button field.
$website_button_text = 'Road Runner';
// --- The way the button opens when clicked. Use "blank" to open in a new page or use "self" to open in the same page/tab.
$website_button_type = 'self';

Title: Re: Website Button
Post by: 58tbird on April 04, 2008, 01:18:35 PM
Sorry about that ccbtimewiz - I noticed you had it linking to an external site, and I think I remember that being in the code for the Website Button mod, but I replaced it with this: http://mywebsite.com/index.php?action=News%20Alerts which is the link I got from using the Custom Action mod (I went over all this in previous posts, but I failed to mention it in my correspondences with you - I apologize).

So, in your code where you had the link to roadrunner, I replaced it with the link created by the Custom Action mod.

Does this make any difference in being able to make the tab behave like the other tabs?  Thank you very much for all you help on this - I really do appreciate you. :)
Title: Re: Website Button
Post by: ccbtimewiz on April 04, 2008, 02:57:57 PM
Find:
Code (index.template.php) Select
if (in_array($context['current_action'], array(

Replace with:
Code (index.template.php) Select
if (in_array($context['current_action'], array('News%20Alerts',

Please only replace the code I told you. Don't replace the entire array. Easier terms, add 'News%20Alerts' into that array.

Then, using the code I gave you earlier, do this:

Find:
Code (index.template.php) Select
// Your [website] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="'.$website_button_link.'" target="_'.$website_button_type.'">'.$website_button_text.'</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Replace with:
// Your [website] button.
echo ($current_action=='News%20Alerts' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'News%20Alerts' ? 'active_back' : 'back' , '">
<a href="'.$website_button_link.'" target="_'.$website_button_type.'">'.$website_button_text.'</a>
</td>' , $current_action == 'News%20Alerts' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: Website Button
Post by: 58tbird on April 04, 2008, 03:02:47 PM
Okay - thank you! :)  I'm got to leave right now, but I'll try it later this evening if I don't get a chance sooner.

P.S. In which array do I insert the code? "if (in_array($context['current_action'], array(" occurs twice:
// 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', 'bookmarks', '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'] == 'news')
$current_action = 'news';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
Title: Re: Website Button
Post by: 58tbird on April 04, 2008, 05:22:26 PM
...oh, never mind - now that I look closer at it, it appears the second occurrence contains code relating to tabs.:-[  I'll insert it into the second array.
Title: Re: Website Button
Post by: 58tbird on April 04, 2008, 08:19:34 PM
Okay, I've made the changes in your last post, but it works the same way it did before: it opens in a new window, and the Home tab still highlights - not the News Alerts tab.  I also have 3 pages of errors. 

If there's no way to accomplish this, I can revert back to using the Website Button mod.

I appreciate your help on this ccbtimewiz - thank you very much. :)
Title: Re: Website Button
Post by: FerociousSM on May 08, 2008, 11:02:16 AM
I've installed this mod on SMF 1.1.5. I see the "Features and Options > Website" but nothing appears onmy main page. I'm using the Musiconica theme. Is there any other place to turn it on?

Thx
Title: Re: Website Button
Post by: ccbtimewiz on May 08, 2008, 09:26:23 PM
mm, go through your index.template.php file in your theme and make sure the hacks for the mod are in there.

That's most likely the problem.
Title: Re: Website Button
Post by: elforoof on July 05, 2008, 11:59:56 AM
the mod looks really cool,  when would it be ready for  (Powered by SMF 1.1.5)  thank you

Quote from: jake1981 on May 19, 2007, 04:03:26 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=814)

..------=================================
Website Button (wsbutton)
Version 1.1.1

Author: Oskari Rauta/Jake Irons
-----------=======================-------------..

What's new in 1.1.1?
- Fixed couple of typos in readme :)

This mod adds a new button to your forum's navigation bar: website (text can be changed from language file).

It also adds section website to your forum's settings where you can set URL for it.

What is this kind of mod good for? Well, if you have a portal/forum is integrated to site, for e.g. with mkportal, you might want to exit forum to website WITHOUT logging out as you might have there features that require that user is logged on. Most other forums have this feature but smf did miss it. Apply this mod if you need such feature.

It's designed to mimic other forum buttons so it fits very nicely. This mod includes also image buttons for babylon and classic themes in 2 languages: english and finnish.

This mod supports multiple languages and offers out of the box support for english and finnish (if board has finnish language installed). Also if you use core/default theme(buttons without images) and other language than english or finnish, this mod detects that it has not been translated yet for that language and defaults to english. (Not for admin panel though, admin panel part supports english and finnish and if you use other language, you need to add support for your language by changing language files)

Language support: yes, provided: english & finnish
Skin support: yes, provided: core/default, classic and babylon

Works just great with portals / site-integration.
Title: Re: Website Button
Post by: Joe N on April 22, 2009, 01:16:01 PM
Could this be updated to smf 1.1.8?
Title: Re: Website Button
Post by: Jade Elizabeth on April 22, 2009, 04:45:04 PM
Any mod for 1.1.x will most likely work on 1.1.8 :).
Title: Re: Website Button
Post by: Joe N on April 23, 2009, 08:00:48 AM
Quote from: Jade Elizabeth on April 22, 2009, 04:45:04 PM
Any mod for 1.1.x will most likely work on 1.1.8 :).

I mean is it comp with 1.1.8?
Title: Re: Website Button
Post by: Jade Elizabeth on April 23, 2009, 09:24:24 AM
Quote from: Jade Elizabeth on April 22, 2009, 04:45:04 PM
Any mod for 1.1.x will most likely work on 1.1.8 :).

I just said it was :).
Title: Re: Website Button
Post by: Joe N on April 25, 2009, 02:49:25 AM
Quote from: Jade Elizabeth on April 23, 2009, 09:24:24 AM
Quote from: Jade Elizabeth on April 22, 2009, 04:45:04 PM
Any mod for 1.1.x will most likely work on 1.1.8 :).

I just said it was :).

Cool
Title: Re: Website Button
Post by: Doyne on July 07, 2009, 11:24:30 PM
I like this Mod.  The only thing is that my button is not aligned with my others.  Do you have a fix for that?

Here is my Mods code in he Index_template file

// Show the start of the tab section.
echo '
  <ul>';

// Show the [website] button.

show_websiteButton();
       

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

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

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

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

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

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

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

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

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

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


Any ideas how to align the button?

Thanks,

Doyne
Title: Re: Website Button
Post by: ChaosEnergy on December 27, 2009, 11:48:29 AM
will ther ebe an update to smf 2.0 rc2?
Title: Re: Website Button
Post by: KensonPlays on January 23, 2010, 07:24:09 PM
Quote from: ChaosEnergy on December 27, 2009, 11:48:29 AM
will ther ebe an update to smf 2.0 rc2?

I SECOND THIS!!
Title: Re: Website Button
Post by: risey on August 10, 2010, 07:24:36 AM
I installed the website button, when i go to Features and Options i get the following error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in D:\Hosting\4378575\html\Forum\Sources\ModSettings.php on line 120

So i had to uninstal, looks a good mod though...

Ryan
Title: Re: Website Button
Post by: eyo on November 21, 2010, 11:55:11 PM
i installed it, found 1 error and reinstalled forum thru backup and reinstalled addbutton and it displays fine , problem is, when i click features and options to set url, i just get a refresh. help pls. im running smf 1.1.12
Title: Re: Website Button
Post by: cyberdyne on April 01, 2011, 10:40:43 AM
Quote from: nitsua on May 22, 2007, 07:11:33 PM
is there a way that instead of it saying "website" can I make it say something else?

Yes, I found this in /Themes/default/index.template.php

Look for:

isset($txt['websiteButton_txt']) ? $txt['websiteButton_txt'] : 'Website', '</a>


Replace with:

isset($txt['websiteButton_txt']) ? $txt['websiteButton_txt'] : 'TEXT OF YOUR CHOICE', '</a>