Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: naoko15 - kesäkuu 28, 2011, 01:41:18 IP

Otsikko: Removing forum_name from Core Theme
Kirjoitti: naoko15 - kesäkuu 28, 2011, 01:41:18 IP
Hello, i've got a really simple problem. I thought it'd be easy to sort out but i've been looking around and can't find the answer anywhere.

How can i remove forum name from Core Theme? I want it only to show the forum's logo.

Thank you so much!
Otsikko: Re: Removing forum_name from Core Theme
Kirjoitti: Sir Osis of Liver - kesäkuu 28, 2011, 10:21:11 IP
Forum title is in Admin -> Server Settings

Logo image url is in Admin -> Current Theme
Otsikko: Re: Removing forum_name from Core Theme
Kirjoitti: naoko15 - kesäkuu 29, 2011, 04:45:03 AP
Thank you so much for your reply, but if i remove the forum's name in admin i get a "no image" kind of thing in the header. I've attached a picture so you know what i mean.

What i'd like is to know how can i effectively remove/change it from the index.template.php file.
Otsikko: Re: Removing forum_name from Core Theme
Kirjoitti: Sir Osis of Liver - kesäkuu 29, 2011, 02:03:34 IP

Which version and theme are you running?

Can you post/pm a link to your board?
Otsikko: Re: Removing forum_name from Core Theme
Kirjoitti: naoko15 - kesäkuu 29, 2011, 05:53:12 IP
I'm running Core Theme, SMF 2.0 Gold

This is the link to my forum:

http://sinfomusic.net.previewdns.com/foros/SMF/index.php (http://sinfomusic.net.previewdns.com/foros/SMF/index.php)

Otsikko: Re: Removing forum_name from Core Theme
Kirjoitti: Sir Osis of Liver - kesäkuu 29, 2011, 08:00:22 IP
Without seeing your index.template.php, you're code is loading two logos in consecutive lines - logo.png, which is your legit logo, and logo.jpg, which was probably the default logo and no longer exists.  Looks like this in View Source:



<div id="mainframe" style="width: 90%">
<div class="tborder">
<div class="catbg" >
<img class="floatleft" id="smflogo" src="http://www.sinfomusic.net.previewdns.com/foros/SMF/Themes/core/images/logo.png" alt=" " />
<h1 id="forum_name">
<img src="http://www.sinfomusic.net.previewdns.com/foros/SMF/Themes/default/images/logo.jpg" alt="" />
</h1>



If you can find it in index.template.php, comment out the line that calls logo.jpg, so it looks like this:



<div id="mainframe" style="width: 90%">
<div class="tborder">
<div class="catbg" >
<img class="floatleft" id="smflogo" src="http://www.sinfomusic.net.previewdns.com/foros/SMF/Themes/core/images/logo.png" alt=" " />
<!--h1 id="forum_name">
<img src="http://www.sinfomusic.net.previewdns.com/foros/SMF/Themes/default/images/logo.jpg" alt="" />
</h1-->



If it doesn't cause any problems, you can delete the commented line.



Otsikko: Re: Removing forum_name from Core Theme
Kirjoitti: naoko15 - kesäkuu 30, 2011, 04:04:46 AP
I can't find that line...looks like the template is loading that line from somewhere else, which is very strange.

I'm attaching the index.template.php file

Thanks a lot for your help Krash
Otsikko: Re: Removing forum_name from Core Theme
Kirjoitti: Sir Osis of Liver - kesäkuu 30, 2011, 10:51:39 IP
That doesn't look like the original index.template.php.  Try this -

Find:



function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
<div id="mainframe"', !empty($settings['forum_width']) ? ' style="width: ' . $settings['forum_width'] . '"' : '', '>
<div class="tborder">
<div class="catbg" >
<img class="floatleft" id="smflogo" src="', $settings['images_url'], '/logo.png" alt=" " />
<h1 id="forum_name">';

if (empty($context['header_logo_url_html_safe']))
echo $context['forum_name_html_safe'];
else
echo '
<img src="', $context['header_logo_url_html_safe'], '" alt="', $context['forum_name_html_safe'], '" />';




Change to this:



function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
<div id="mainframe"', !empty($settings['forum_width']) ? ' style="width: ' . $settings['forum_width'] . '"' : '', '>
<div class="tborder">
<div class="catbg" >
<img class="floatleft" id="smflogo" src="http://www.sinfomusic.net.previewdns.com/foros/SMF/Themes/core/images/logo.png" alt=" " />
<h1 id="forum_name">';

/// if (empty($context['header_logo_url_html_safe']))
// echo $context['forum_name_html_safe'];
// else
// echo '
// <img src="', $context['header_logo_url_html_safe'], '" alt="', $context['forum_name_html_safe'], '" />';


Otsikko: Re: Removing forum_name from Core Theme
Kirjoitti: naoko15 - heinäkuu 01, 2011, 05:02:47 AP
Excelllent!, it worked great! Thank you so much!  :D