News:

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

Main Menu

[tip/trick] Logo and Banners in 1.1.x

Started by coucnilhomeswap, February 14, 2009, 08:54:03 AM

Previous topic - Next topic

andy40

i want my own banner at the top but i have mods installed and cant find this code in index.template.php can anyone help

H

andy40, do you still need help with this? Which theme are you using? Please attach your index.template.php

Quote from: Geargarious on May 11, 2009, 02:14:08 PM
I want to do this for my forum but when I go to the adminsection it doesn't give me the option to mod core, only classic yabb and babylon. Am  i missing something here, I'm pretty new at this.

When modifying the default theme, you need to use the option in the admin area to create a copy of the default theme. This is so that if you break your theme you can still revert to the default and fix the problem
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Pinball Nation

Hello everyone,Im kinda new at this stuff.Does this code remove just the part where the smf logo an the name of your site.Or does it remove that an the search an news also.I would like to add a banner but i want to keep the enhanced profile an news an search.Thanks

Pinball Nation

hello again, i have done everything except.But what admin url do i need to add.I have added some but the image is centered but no banner just an red x.Im using smf 1.1.10.

Banthe

Hi all, I've got the same problem as many others...I can't seem to center my logo! :-[ I've tried to change the code in my index.template but it doesn't seem to be the same as described in these suggestions? I am using the SMF default - core theme, which  has quite a few mods installed (I would think thats why the code is slightly different). The code in question is:
<body onload="PreloadFlag = true;">';

echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">';

if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">', $context['forum_name'], '</span>';
else

{
$domain = parse_url($scripturl);
$domain = $domain['scheme'].'://'.$domain['host'];
echo '
<a href="', $domain, '"><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $domain, '" /></a>';
}

echo '
</td>

</tr>
</table>';

Any help would be greatly appreciated, as I have no idea what I'm doing!!!

Arantor

You should be able to do it thus:
<body onload="PreloadFlag = true;">';

echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">';

if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">', $context['forum_name'], '</span>';
else

{
$domain = parse_url($scripturl);
$domain = $domain['scheme'].'://'.$domain['host'];
echo '
<div align="center"><a href="', $domain, '"><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $domain, '" /></a></div>';
}

echo '
</td>

</tr>
</table>';

Banthe

Arantor, you are a legend!  :D Thanx so much...worked like a charm!!!!!!!!

nycrican2

This worked for me and I am using SMF version 1.1.10 and the default template. Thanks for much for the hint.

sharks

This is the best piece of advice that i've found in a long time. It's a very accurate post, simple and with proper English.

Tested both code edits. Definitely amazing work!


BTW, i want to add some text under my now centered banner. How to do that?

coucnilhomeswap

Quote from: sharks on August 12, 2010, 02:57:48 PM
This is the best piece of advice that i've found in a long time. It's a very accurate post, simple and with proper English.

Tested both code edits. Definitely amazing work!


BTW, i want to add some text under my now centered banner. How to do that?

Hi sharks. Im glad my tip/trick was helpful to you. Im not sure how to add text under the banner. Id have to set up a test copy of smf 1.1.11 to try it out

coucnilhomeswap

Quote from: nycrican2 on September 23, 2009, 12:30:12 PM
This worked for me and I am using SMF version 1.1.10 and the default template. Thanks for much for the hint.

Hi nycrican2 im glad i could help.

coucnilhomeswap

Quote from: sharks on August 12, 2010, 02:57:48 PM
This is the best piece of advice that i've found in a long time. It's a very accurate post, simple and with proper English.

Tested both code edits. Definitely amazing work!


BTW, i want to add some text under my now centered banner. How to do that?

Ok sharks ive sussed how to put text under your newly centered logo using the default theme.

Find the code you used to center your logo. if you have used the tip/trick code i gave you in the first post it should look like this.

<div   style="text-align: center;"><img src="',   $settings['header_logo_url'], '" style="margin: 4px;" alt="',   $context['forum_name'], '" /></div>';

At the end of that line create a new blank line and add this

<center><font color=red>your text goes here</font></center>

you can add edit or remove what you want to make it what you want.

sharks

Thanks a lot, my S-M-F mods. :D

Another great job, as expected of you.

coucnilhomeswap


IRFletcher

In order to place a banner on my site at the top, what file do I alter and what code do I change in the file, is it the index.template.php in the Default Themes folder?

Is the banner pic supposed to be named Banner.gif and placed in the Default Themes folder of the root?

Thanks.

coucnilhomeswap

Quote from: IRFletcher on September 02, 2010, 11:43:53 AM
In order to place a banner on my site at the top, what file do I alter and what code do I change in the file, is it the index.template.php in the Default Themes folder?

Is the banner pic supposed to be named Banner.gif and placed in the Default Themes folder of the root?

Thanks.

for the banner at the top you need to edit the index.template.php file of what ever theme your using.

as for the banner pic it can be named anything and can be placed in either the root folder of the site or the images folder of the theme your using

IRFletcher

Okay, can you please post the code that I am to edit in the index.template.php and what code I am to replace it with?
Thanks.

coucnilhomeswap

Quote from: IRFletcher on September 02, 2010, 12:36:35 PM
Okay, can you please post the code that I am to edit in the index.template.php and what code I am to replace it with?
Thanks.

if you look at the first post it gives you the general area to look

IRFletcher

I placed the Banner.gif into the the Default Themes image folder and edited the index.template.php file in the Default Themes folder and located the code:

<img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';

and replaced it with:

<div style="text-align: center;"><img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" /></div>';

and nothing happened?

So I am not sure what I am doing wrong here as I also went into
Admin>Current Theme> and under 'This theme's images URL:'
put the path to the Banner.gif file:

http: //www.yourwebsite.com/Themes/default/images/Banner

and still no change...

JoeMumme


Advertisement: