Download This Theme

Author Topic: [Tutorial] Placing own logo at top (1.1.8)  (Read 25182 times)

Offline Runic

  • Co-Founder
  • Hero Member
  • *****
  • Posts: 933
  • Metal!!
[Tutorial] Placing own logo at top (1.1.8)
« on: April 17, 2009, 09:52:35 AM »
While doing support, a large question we get asked is "How do I make my banner fit at top"

Well this is simple.


For SMF 1.1.X

open your index.template.php file and search for

Code: [Select]
<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
echo '
<img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';

echo '
</td>
<td align="right" class="catbg">
<img src="', $settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
</td>
</tr>
</table>';

Now we need to remove the excess coding

Code: [Select]
<td align="right" class="catbg">
<img src="', $settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
</td>

Remove this code to remove the smflogo (you dont need to display this) so what we have left is


Code: [Select]
<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
echo '
<img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';

echo '
</td>
</tr>
</table>';

now we dont really need this code:

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

Nor do we need the
Code: [Select]
';

echo'

That comes after the image line, we also dont want the catbg at the back nor do we wish to force the height to be 32px high so lets remove all that and we have:

Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />
</td>
</tr>
</table>';

Now for me if im wanting the whole top bar to be my logo I dont want a padding so lets change

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

this will give us:

Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<img src="', $settings['header_logo_url'], '" alt="', $context['forum_name'], '" />
</td>
</tr>
</table>';

Now just change the ',$settings['header_logo_url'],' to url of your image.

so we have:

Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<img src="http://www.examplelink.com/example.jpg" alt="', $context['forum_name'], '" />
</td>
</tr>
</table>';
« Last Edit: April 21, 2009, 08:45:33 AM by Runic »
Bryan "Runic" Deakin
Co-founder SMF Themes.org
Customiser Simple Machines LLC

Offline Yeiangelo

  • Newbie
  • *
  • Posts: 1
Re: [Tutorial] Placing own logo at top (1.1.8)
« Reply #1 on: June 05, 2009, 11:53:25 PM »
          Thanks for sharing this tutorial in placing logo in top.
« Last Edit: June 06, 2009, 04:05:17 AM by Runic »

Offline ashish

  • Newbie
  • *
  • Posts: 1
    • Email
Re: [Tutorial] Placing own logo at top (1.1.8)
« Reply #2 on: July 13, 2009, 09:12:52 AM »
gr8 tutorial ... runic warrior ... 8)
thanks a lot for sharing this tutorial on the net...
Cheers.

Offline ScottDB

  • Newbie
  • *
  • Posts: 2
Re: [Tutorial] Placing own logo at top (1.1.8)
« Reply #3 on: August 11, 2009, 11:33:57 PM »
That was one heck of a tutorial for 1.x but what about 2.0rc1.2?

 

SMFThemes.org would like to thank Network Redux for providing us with our hosting.
Templates: 3: index (Paper), Site (site_template), Display (default).
Sub templates: 10: init, html_above, site_outside_above, body_above, site_inside_above, main, site_inside_below, body_below, site_outside_below, html_below.
Language files: 1: index+Site+Modifications.english (Paper).
Style sheets: 0: .
Files included: 22 - 622KB. (show)
Cache hits: 13: 0.00638s for 13,072 bytes (show)
Queries used: 17.

[Show Queries]