News:

Wondering if this will always be free?  See why free is better.

Main Menu

SMF 2.0.1 Logo URL change

Started by concienned, December 07, 2011, 01:28:27 AM

Previous topic - Next topic

concienned

I can't find any help on the SMF 2.0.1 Forum header logo URL.
What I am trying to do is change all the logo URL's, for the different themes, to go to the site root, instead of the forum index.. For some reason I can't find where exactly to do this.
Any help would be appreciated.

Bigguy

Line 198 of the index.template.php file has this line:

                <a href="', $scripturl, '">

Change it to:

                <a href="http://www.yoursite.com">

That should do it for you.

BaghdadGhost

Quote from: Bigguy on December 07, 2011, 01:48:23 AM
Line 198 of the index.template.php file has this line:

                <a href="', $scripturl, '">

Change it to:

                <a href="http://www.yoursite.com">

That should do it for you.


thanks for helping others man.



Bigguy

Is this solved for you concienned ???

BaghdadGhost

no actually mine is different. its explained here

http://www.simplemachines.org/community/index.php?topic=461397.msg3221941#msg3221941


I just felt that you at least deserve a thank you  :)

concienned

Actually, No, I still can't find where to do this.
I looked where you said, but it's not there.

Also, can this be done globally? Because I think it has to be done for every theme individually.

Suki

What theme are you using?

perhaps a link to your forum may help.

if you want to do this globally then create a global variable  on Settings.php  something like:

$rooturl = 'http://yoururlhere';


then whenever you want to use it just need to globalize it:

function something()
{
   global $rooturl;

echo '<a href="',$rooturl,'">root index</a> ';

}
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

concienned

I have a bunch of themes installed.
The forum is located @ hxxp:clanrwc.com/forum [nonactive]
I don't know coding well enough to implement such a variable. I just need to know where to change it within the various themes.

Suki

It depends on the theme, some themes do make variations and it's not possible to write a guide to cover all themes.

You don't really need any coding skills to make a global variable, you just need to define your variable in Settings.php file:

$rooturl = 'your root url here';


then on every theme you will add that variable, every theme has this part:

// Initialize the template... mainly little settings.
function template_init()
{
   global $context, $settings, $options, $txt;


you will add $rooturl there, like this:


// Initialize the template... mainly little settings.
function template_init()
{
   global $context, $settings, $options, $txt, $rooturl;




and thats all you need to do, now you can use $rooturl to replace the <a href="', $scripturl, '">  part:


<a href="', $rooturl, '">
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Bigguy

That's very nice. I didn't know that. Better then my way. :)

GirlinGray

You guys realize this is all insane right? That there should just be an easy simple command to change the home link that doesn't involve reading 50 lines of code and rewriting the code?

Maybe it is just me.

*edited for typo, ahhh!
That Adams Girl

margarett

Not trying to be funny, but why would someone dig out a 4-years old topic for those comments?

The logo is hard-coded to link to the forum's URL. If you want to change that, 2 alternatives were given, one that changes 1 line of code in a single file, other that changes 3 lines of code in 2 files. Kinda different from 50, not? ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

GirlinGray

I go looking for answers doing searches. It may be an old post, but lots of times I find old answers questions and don't have to post the question over again. (shrug)
That Adams Girl

GirlinGray

PS: I did find the logo id url in the theme's index template and changed it out and it's working so this did help. Thanks to previous posters.

I just get a little crazy when it's so complex to do one simple thing that should probably be a simple command in forum layout or settings control panel or something. But hey, I can't write a forum from scratch and it's a good forum so a headache once in a while is worth it.
That Adams Girl

Kindred

but why do you think it would be an admin setting in the control panel?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

KurtS

Actually, I thought it would be a variable in the control panel too. Why not? You can change the logo image, why not the link?

And thanks for the clear instructions BigGuy. Worked fine. :)
Kurt S
CRG  - www.camaros.org

Kindred

because the link -- like almost every site out there -- is assumed to be just like a "home" link -- and given that this post has been touched twice (now three times) in 4 years, it looks like the assumption is correct for 99.99% of the sites.   for that other .01%, you can change it in the code (making a setting for .01% is not a reasonable action)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: