News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How to Change Title / Logo part in Default theme

Started by Ivan Minic, August 01, 2005, 08:42:20 AM

Previous topic - Next topic

Ivan Minic

I see some people need help with this, so, here is a little tutorial.

Open /Themes/default/index.template.php

Part 1: Kill logo

Find:
// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="', $settings['images_url'], '/smflogo.gif" width="250" style="float: right;" alt="" />
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';

Replace
// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>'



Part 2: Change color of title:

Find:
// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="', $settings['images_url'], '/smflogo.gif" width="250" style="float: right;" alt="" />
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';

Replace
// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<span style="font-family: Georgia, sans-serif; font-size: xx-large;"><font color="#FF0000">', $context['forum_name'], '</font></span>';

This example is with Red
My suggestion is to use colors from Few colors that look very nice with SMF default template
Part 3: Center title:

Find:
// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="', $settings['images_url'], '/smflogo.gif" width="250" style="float: right;" alt="" />
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';

Replace
// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<center><span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span></center>';


tunedmagazine

i must really be doing sumtin wrong because i keep getting this white screen that pops up saying server error..what did i do if that happends??

xenovanis

Quote from: tunedmagazine on September 12, 2005, 04:04:48 PM
i must really be doing sumtin wrong because i keep getting this white screen that pops up saying server error..what did i do if that happends??

A wild guess, but try this:

Having problems with mod_security?
"Insanity: doing the same thing over and over again and expecting different results."

dtm.exe

Quote from: tunedmagazine on September 12, 2005, 04:04:48 PM
i must really be doing sumtin wrong because i keep getting this white screen that pops up saying server error..what did i do if that happends??

Server error or parse error?

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

tunedmagazine


nokonium




tunedmagazine

haha for real though..whats that mean..servor error

xenovanis

"Insanity: doing the same thing over and over again and expecting different results."

abhikumar

i am facing some diffrent i try to make some chaneges in \Themes\default\index.template.php
for modifying top part of forum but its not working at all
even i tried to put error but its not showing any (something likke deleting ; )
but i guess control is not going there or thre may be some caching problem can anyone help me to stop caching and customising top part of this wonderful form
thanks in advance
best regards
AbhiKumar

Bern

Hello Ivan,
this didn't really help me. I changed the logo already, but would like to have it sanned over the entire page width and centered.
How do I do this?

Confusimo

I already have no logo, just a title.  But I tried  the first part to kill the title anyway.

I got the parse error.  I found the problem.  You say look for    blahbla...   '</span>';

and replace with     '</span>'

so you left out the ; symbol at the end od '</span>'

After adding ; it worked.

Thanks,
Confusimo

clemenzo

How can I add a banner into the blank space in the header of the 1.1RC2 default theme beside the 3 lines:

Show unread posts since last visit.
Show new replies to your posts.
Total time logged in: x hours and y minutes.

Vinspire


higherauthority

#14
I did this   find the above code and delete everything before up to the </td> bla bla bla   so it looks like this


// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '

</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url(', $settings['images_url'], '/box_bg.gif);">


This will get rid of the logo and the Forum name then you can insert your logo

insert this for a logo with a hyperlink

echo '
<center><a href="http://www.your domain name.com/"><img border="0" src="', $settings['images_url'], '/yourlogo.gif" width="500" style="float: center;" alt="" /></center>';


upload your logo and thats it. 

so the code will look like this when its done


// This part is the logo and forum name.  You should be able to change this to whatever you want...

echo '
<center><a href="http://www.yourdomain.com/"><img border="0" src="', $settings['images_url'], '/yourlogo.gif" width="500" style="float: center;" alt="" /></center>';
echo '

</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url(', $settings['images_url'], '/box_bg.gif);">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/userinfo.gif" style="position: absolute; left: ', $context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' : '-1px', '; top: -16px; clear: both;" alt="" />
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';

if (!empty($context['user']['avatar']))
echo '<td valign="middle">', $context['user']['avatar']['image'], '</td>';

echo '<td valign="top" class="smalltext" style="width: 100%; font-family: verdana, arial, sans-serif;">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '.<br />';



I am not an expert but this seemed to work using 1.1RC2


RiderRaghav

Quote from: higherauthority on May 30, 2006, 05:56:22 PM
I did this   find the above code and delete everything before up to the </td> bla bla bla   so it looks like this


// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '

</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url(', $settings['images_url'], '/box_bg.gif);">


This will get rid of the logo and the Forum name then you can insert your logo

insert this for a logo with a hyperlink

echo '
<center><a href="http://www.your domain name.com/"><img border="0" src="', $settings['images_url'], '/yourlogo.gif" width="500" style="float: center;" alt="" /></center>';


upload your logo and thats it. 

so the code will look like this when its done


// This part is the logo and forum name.  You should be able to change this to whatever you want...

echo '
<center><a href="http://www.yourdomain.com/"><img border="0" src="', $settings['images_url'], '/yourlogo.gif" width="500" style="float: center;" alt="" /></center>';
echo '

</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url(', $settings['images_url'], '/box_bg.gif);">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/userinfo.gif" style="position: absolute; left: ', $context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' : '-1px', '; top: -16px; clear: both;" alt="" />
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';

if (!empty($context['user']['avatar']))
echo '<td valign="middle">', $context['user']['avatar']['image'], '</td>';

echo '<td valign="top" class="smalltext" style="width: 100%; font-family: verdana, arial, sans-serif;">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '.<br />';



I am not an expert but this seemed to work using 1.1RC2

thanks man......
i was not able to make the right script to keep my banner in the center...
i tried ur way and it worked on SMF 1.1.3 :)

olufemo

How do I alter the background color the default theme , SMF 1.14

higherauthority

find the style.css file located in themes\default\

look for

/* The main body of the entire forum. */
body
{
background-color: #ffffff;
margin: 0px;
padding: 12px 30px 4px 30px;


Alter FFFFFF to whatever color you want

Color lists can be found here  http://www.w3schools.com/html/html_colors.asp

harmoni

logo in table...edit index.template.php

</head>
<body>';
//----------my addition
    echo '
   <div align="center">
   <table id="widthConrol" cellpadding="0" cellspacing="0" border="0">
   <tr> <td>
   <img src=/mylogo.gif></td></tr>
   </table> </div>';
//----------end my edition

// change width to 100% if you it fluid


Advertisement: