News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Logo Url

Started by Prophatt, January 21, 2012, 09:27:31 AM

Previous topic - Next topic

Prophatt

Hi guys. I'm having trouble getting the logo image in the upper left hand corner to link back to the main website. I'm using SMF 2.0.2. The theme I am using is Blackstorm2. So far, my research into the issue has turned up these links/threads, which I am not allowed to post. :) They are on the smf forums though, post titles,

Help changing forum logo to link back to main website -- topic=436027.0

SMF 2.0.1 Logo URL change -- topic=461707.0

And this next thread, which suggests scripting in a $rooturl that you can drop in and replace the $scripturl without replacing anything.

Where can I change $scripturl variable?  -- topic=461707.0

To my understanding this is the chunk of code I am looking for,

echo '
<div id="logo">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="'. $settings['images_url']. '/theme/logo.png" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />', '</a>
</div>';
echo '

So every time I change scripturl, the website has a hard time parsing the index.template.php.
If I wipe out most of the a href and make it more manageable like,

<a href="mywebsite.com">

essentially html, I get a funny output on the link. The link starts out looking like this

mywebsite.com/forum/index.php

After changing the a href I get this,

mywebsite.com/forum/mywebsite.com and I would really just like the link to be hxxp:mywebsite.com [nonactive]

So I know I am on the right track but I just can not seem to put 2 and 2 together on this. Any help would be appreciated. :)

Arantor

You need to put http:// in front of it, otherwise it thinks you're trying to link to somewhere you're not.

Prophatt

So my code should look like this?

echo '
<div id="logo">
<a href="'http://mywebsite.com '">', empty($context['header_logo_url_html_safe']) ? '<img src="'. $settings['images_url']. '/theme/logo.png" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />', '</a>
</div>';
echo '


Just double checking, when I turned it to straight html this time, it took away my logo image and I've been trying to make this work for roughly two weeks now. :)

Prophatt

Thank you Arantor. That nudge you gave me enabled me to figure it out :D I went with a straight  html solution.

I replaced this entire chunk of code


<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="'. $settings['images_url']. '/theme/logo.png" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" title="' . $context['forum_name'] . '" />', '</a>


With this...

<a href="http://mywebsite.com"><img src="http://mywebsite.com/forum/Themes/Blackstorm2/images/theme/logo.png"></a>

Nice and simple. :D

Advertisement: