Need some1 to add a extra button/tab to my theme???

Started by kris1903, March 21, 2009, 10:02:21 AM

Previous topic - Next topic

kris1903

Need some1 to add a extra button/tab to my theme???

Need some1 to add an extra button to my theme? any1 do it for me? :D

cme1st2302

I can try an help you out.  Looks like you are running 2.X so attach you subs.php file and I will give it a shot.

Chris
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

kris1903

thank you. ice attached the subs.php and also the index template. i want it after the home button. Thanks.

The button needs to say "Main Site" and link to "http://www.modified-scotland.com"

cme1st2302

Try the attached file out and see if it works for ya.  You will have to add this line of code into your modifications.english.php file which is located in the default themes language folder.

$txt['main'] = 'Main Site';

Let me know how ya make out,
Chris

SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

kris1903

Dosnt Work.

Right

ive added

'Main Site' => array(
            'title' => $txt['Main Site'],
            'href' => 'http://www.modified-scotland.com',
            'show' => true,
            'sub_buttons' => array(
            ),
         ),


to subs.php

Now what do i do?

Yağız...

Try to replace this: $txt['Main Site'] with this: $txt['main']


Yağız...

Quote from: cme1st2302 on March 21, 2009, 11:31:46 AM
You will have to add this line of code into your modifications.english.php file which is located in the default themes language folder.
$txt['main'] = 'Main Site';
Did you make this change? If not, the button will not appear.

kris1903

ive done the subs.php stuff
now i need to add it to the forum..

the code which makes home, help etc show up is this

echo '<td id="home"><a href="', $scripturl, '?action=forum"><span>' ,$txt['home'], '</span></a></td>';
echo '<td id="help"><a href="', $scripturl, '?action=help"><span>' , $txt['help'] , '</span></a></td>';
if ($context['allow_search'])
echo '<td id="search"><a href="', $scripturl, '?action=search"><span>' , $txt['search'] , '</span></a></td>';
if ($context['allow_calendar'])
echo '<td id="calendar"><a href="', $scripturl, '?action=calendar"><span>' , $txt['calendar'] , '</span></a></td>';


What do i have to add in to get "main Site" button to show?

kris1903

Quote from: Yağız... on March 21, 2009, 11:48:33 AM
Quote from: cme1st2302 on March 21, 2009, 11:31:46 AM
You will have to add this line of code into your modifications.english.php file which is located in the default themes language folder.
$txt['main'] = 'Main Site';
Did you do this change? If not, the button will not appear.

nope, ill go do it, and see if it works


kris1903

I really cant get this to work :'( :'( :'( :'( :'( :'(

If you give me a list o ffiles you need. ill upload them and you can edit them for me? is that ok? thanks 8)

Yağız...

Attach your index.template.php who is located in your theme folder.


Yağız...





Yağız...

Try to change $txt['main'] = 'Main Site'; with $txt['main'] = 'Site';


Yağız...

../Themes/default/languages/Modifications.english.php


cme1st2302

Yağız... ,
  Just so I know in the future, do you have to modify the subs.php file and then go in and add the code for the button in index.template.php?  I thought it was all handled in subs.php in 2.0.

Chris
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

kris1903

another question. How can i change the button "home" to read "Forum" 8)

Yağız...

Quote from: cme1st2302 on March 21, 2009, 12:48:05 PM
Yağız... ,
  Just so I know in the future, do you have to modify the subs.php file and then go in and add the code for the button in index.template.php?  I thought it was all handled in subs.php in 2.0.

Chris
His theme doesn't use SMF's menu template codes. So, he should modify his index.template file.

Quote from: kris1903 on March 21, 2009, 12:50:13 PM
another question. How can i change the button "home" to read "Forum" 8)
Search for ' ,$txt['home'], ' in your index.template.php file and change it to Forum

cme1st2302

Quote from: Yağız... on March 21, 2009, 12:53:50 PM
Quote from: cme1st2302 on March 21, 2009, 12:48:05 PM
Yağız... ,
  Just so I know in the future, do you have to modify the subs.php file and then go in and add the code for the button in index.template.php?  I thought it was all handled in subs.php in 2.0.

Chris
His theme doesn't use SMF's menu template codes. So, he should modify his index.template file.

Quote from: kris1903 on March 21, 2009, 12:50:13 PM
another question. How can i change the button "home" to read "Forum" 8)
Search for ' ,$txt['home'], ' in your index.template.php file and change it to Forum

So in most cases to modify the buttons in 2.0 you have to do it in subs.php?
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

Yağız...

Quote from: cme1st2302 on March 21, 2009, 12:55:46 PM
Quote from: Yağız... on March 21, 2009, 12:53:50 PM
Quote from: cme1st2302 on March 21, 2009, 12:48:05 PM
Yağız... ,
  Just so I know in the future, do you have to modify the subs.php file and then go in and add the code for the button in index.template.php?  I thought it was all handled in subs.php in 2.0.

Chris
His theme doesn't use SMF's menu template codes. So, he should modify his index.template file.

Quote from: kris1903 on March 21, 2009, 12:50:13 PM
another question. How can i change the button "home" to read "Forum" 8)
Search for ' ,$txt['home'], ' in your index.template.php file and change it to Forum

So in most cases to modify the buttons in 2.0 you have to do it in subs.php?
Yes, but not in all themes, as you can see :)

cme1st2302

Thanks for the info Yaguz...  no I can help people more efficiently.

Chris
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

Rex Zac

hi!

can anyone help me how to add mod button?  i contacted in topic of mod, but i guess they are not yet on smf2 rc1, even we tryed few things, it doesnt work. she gave me code wich work on 1.8 (smf gallery mod).
can anyone help me to make this work? i use gothic  theme.
here is link what we tryed and code which lady gave me to try.

http://www.simplemachines.org/community/index.php?topic=114291.msg1981317#msg1981317

Yağız...



Nvb

I just discovered something:

You can NOT use 2 words for the button txt:
'title' => $txt['new location'],

Or a capital letter:
'title' => $txt['Location'],

If you use one of these, your title doesn't show up.

Advertisement: