ScriptUO

General => Off Topic => Topic started by: Tidus on June 19, 2008, 01:10:31 PM

Title: TM, This is for if you want to add a link to your SMF.
Post by: Tidus on June 19, 2008, 01:10:31 PM
I am going to show you how you can manually put a link into your bar up top.  If you ever choose to go with a different look.. all you need is a style.css file in a new Theme spot and it will automatically pull from the default.  But that is besides the point.

Okay say you want to put in a new link that brings you back to your main ScriptUO site.

You would add this code into your index.template.php file in front of/behind: // Show the [home] Button.  Each designated spot in the list has a [] around it and it will then allow you to place where you want.  So for example your profile link would begin like // Show the [profile] button, the links might looks like //Show the [links] Button. and so forth. So you want this code before your home button, just copy and past this code right in front of it. If you want it in front of Links... just find the spot for links and put it right in front of it.

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

The Key is:
Code: [Select]
<a href="http://scriptuo.com">' , $txt['scriptuo'] , '</a>


Now you have that in your index.template.php    now you need to add one little thing to a language file.  I'm not sure if you run index.english-utf8.php or index.english.php   so i will have you add this code to both files at the bottom right before    ?>

Code: [Select]
$txt['scriptuo'] = 'Script UO';

you can change 'Script UO'  to whatever you would like it to say.  If you want it to say main it would be:

Code: [Select]
$txt['scriptuo'] = 'Main';
   

Also if you wanted your Home to be changed to forum you would do this in your language file also.

Find:
Code: [Select]
$txt[103] = 'Home';
and all you have to do is replace 'Home' with 'Forum'

So if you chose to do that you could actually change
Code: [Select]
$txt['scriptuo'] = 'Main';
   

to say

Code: [Select]
$txt['scriptuo'] = 'Home';
   


If you have any troubles let me know.  or you could always attach the files here and i would fix them.

ruaduck/Tidus




Title: Re: TM, This is for if you want to add a link to your SMF.
Post by: Tidus on June 19, 2008, 01:41:45 PM
I also did a similar write up on the UOGuyz forums for anyone who uses SMF.   It is under PHP Coding -> General Coding - named  How to add a link up top to an SMF board.
Title: Re: TM, This is for if you want to add a link to your SMF.
Post by: TrailMyx on June 19, 2008, 03:01:29 PM
I also did a similar write up on the UOGuyz forums for anyone who uses SMF.   It is under PHP Coding -> General Coding - named  How to add a link up top to an SMF board.

That's hilarious. I was researching how to do this exact thing a couple days ago!  You're a mind reader..  heh.  Thanks, man.
Title: Re: TM, This is for if you want to add a link to your SMF.
Post by: Tidus on June 19, 2008, 04:24:50 PM
well i just remember i wanted to be able to do that same thing when i first got my SMF forums..and i just had to break down the scripts to find out how it was done.  I couldn't find anything on it in SMF's Support Forums.  Figured i would cut that loop for ya
:)
Title: Re: TM, This is for if you want to add a link to your SMF.
Post by: TrailMyx on June 19, 2008, 05:03:58 PM
Indeed, you cut it nicely.  I'm going to fiddle with a few things like that this weekend, so that's a bit of research I don't have to do now.  Yay! Thanks much.
Title: Re: TM, This is for if you want to add a link to your SMF.
Post by: TrailMyx on July 03, 2008, 12:27:11 PM
Thanks for this, I added the "New Posts" addition to the bar up there.  Works great, Hardyz should be happy now.  ;)
Title: Re: TM, This is for if you want to add a link to your SMF.
Post by: Tidus on July 07, 2008, 07:29:14 PM
sweet...just tried it myself.  went off without a hitch. :)
Title: Re: TM, This is for if you want to add a link to your SMF.
Post by: TrailMyx on July 07, 2008, 07:33:29 PM
I was playing with putting the number of new posts in there, but I got distracted...
Title: Re: TM, This is for if you want to add a link to your SMF.
Post by: Tidus on July 08, 2008, 01:45:21 PM
It's definately easy to get distracted.  I start something and then start another thing then another thing then maybe eventually i make it back to it.... what a wonderful loop :)

Was wondering if you might want to move this to the Programming area under the PHP coding since this applies directly to PHP and SMF.