Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Removing forum_name from Core Theme

Aloittaja naoko15, kesäkuu 28, 2011, 01:41:18 IP

« edellinen - seuraava »

naoko15

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!

Sir Osis of Liver

Forum title is in Admin -> Server Settings

Logo image url is in Admin -> Current Theme
When in Emor, do as the Snamors.
                              - D. Lister

naoko15

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.

Sir Osis of Liver


Which version and theme are you running?

Can you post/pm a link to your board?
When in Emor, do as the Snamors.
                              - D. Lister

naoko15


Sir Osis of Liver

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.



When in Emor, do as the Snamors.
                              - D. Lister

naoko15

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

Sir Osis of Liver

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'], '" />';


When in Emor, do as the Snamors.
                              - D. Lister

naoko15

Excelllent!, it worked great! Thank you so much!  :D

Advertisement: