I am trying to center my jpg in my header and can not find were in the code to change it from a LEFT to a CENTER. Any help Please.
http://ultimateaircooled.com/simplemachinesforum/index.php
Looks a bit too wide, to me.
Anyway, try <center><img src="Banner.jpg" usemap="#Banner" alt="" style="border-style:none" /></center>
Anyway, try <center><img src="Banner.jpg"></center> might even do it.
Is that in the index.template.php and about what line ?
Thanks for the help
I put mine just below
</head>
<body>';
I didn't put it in the index.template, though. Because I have quite a few themes, I made a seperate file named "banner.php" and called it from each theme's template. That way, if I alter it, I only have to modify one file, instead of loads.
I just went into the admin, logo, image, url and tried it there and it did not work either. I was thinking there was a place in the index.template.php that I could just change it from left to center.
We only run the default template.
Try the code I put, modifying it to the path and name of your banner, just after the
</head>
<body>';
bit of the index.template.
and before the 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">';
bit.
It certainly works, for me.
Keep a copy of the original file, so you can replace it, should things go wrong.
This is what mine shows
</head>
<body>';
// The logo, user information, news, and menu.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
<tr style="background-color: #ffffff;">
<td valign="middle" align="left"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td>
<td valign="middle">';
// If the user is logged in, display stuff like their name, new messages, etc.
Still not sure were to put it....
</head>
<body>';
JUST HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// The logo, user information, news, and menu.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
<tr style="background-color: #ffffff;">
<td valign="middle" align="left"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td>
<td valign="middle">';
// If the user is logged in, display stuff like their name, new messages, etc.
Tried that and it still did not work. It said there was an error in line111
Gimme a clue, here. "An error" doesn't tell me much.
Did you put the graphic in the root of public_html?
</head>
<body>';
echo 'the html code';
// The logo, user information, news, and menu.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
<tr style="background-color: #ffffff;">
<td valign="middle" align="left"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td>
<td valign="middle">';
// If the user is logged in, display stuff like their name, new messages, etc.
<center><img src="FULL PATH TO YOUR IMAGE"></center>
If it's in the root of public_html, you just need the filename.
This how I put it
</head>
<body>';
<center><img src="Banner.jpg" usemap="#Banner" alt="" style="border-style:none" /></center>
// The logo, user information, news, and menu.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
<tr style="background-color: #ffffff;">
<td valign="middle" align="left"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td>
<td valign="middle">';
And
</head>
<body>';
<center><img src="http://www.ultimateaircooled.com/imagefolder/newforumheader.jpg" usemap="#Banner" alt="" style="border-style:none" /></center>
// The logo, user information, news, and menu.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
<tr style="background-color: #ffffff;">
<td valign="middle" align="left"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td>
<td valign="middle">';
Your graphic isn't named newforumheader.jpg, in that first one.
Want to give me your ftp details, via PM, so I can have a go?
Looking at it, you might want to shrink the banner. If you get it centred, the page might look weird.
I sent you a PM
Looking at it, you might find that, if you make the image the same width as the forum, it'll centre itself.
Without ftp access, it's gonna be tricky.
Neh. I resized it and you get that annoying blue bit, on the right-hand side.
It'll have to be via ftp, I'm afraid.
<body>';
<center><img src="Banner.jpg" usemap="#Banner" alt="" style="border-style:none" /></center>
Should be:
<body>';
echo '<center><img src="Banner.jpg" usemap="#Banner" alt="" style="border-style:none" /></center>';
Well, the way I had it works on mine. Odd, huh?
He's not got ftp access, at the moment, though. When he has, he's gonna give me a shout and I'll see what I can do.
Ta, mate.
I tried
</head>
<body>';
echo '<center><img src="http://www.ultimateaircooled.com/imagefolder/newforumheader.jpg" usemap="#Banner" alt="" style="border-style:none" /></center>';
// The logo, user information, news, and menu.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
<tr style="background-color: #ffffff;">
<td valign="middle" align="left"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td>
<td valign="middle">';
It stills is to the left
Link to site? I don't see this code on your site.
Yeah, sorry. The usemap bit's superfluous. You don't need that.
<center><img src="http://www.ultimateaircooled.com/imagefolder/newforumheader.jpg"></center>';
should be enough.
http://ultimateaircooled.com/simplemachinesforum/index.php
Are you talking about your logo? If that's true, you need to fix the rowspan. I don't see any other image code in the header.
Yes sir , all I want is this centered on the header.....
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ultimateaircooled.com%2Fimagefolder%2Fnewforumheader.jpg&hash=45b0575f053b4553c74d9e705133c4d9e1da9c4c)
Oh I see now. What Kat was pointing out was something you didn't need to edit at all.
Open index.template.php
Find:
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
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>';
Replace with:
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 colspan="2" align="center" 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>';
Therein lies the pronlem. No ftp access, at the moment.
So I do have to go in through the ftp or can I go in through ADMIN ?
For edits to the default theme, it is required to go through FTP.
How do I use FTP? / What is FTP? (http://docs.simplemachines.org/index.php?topic=480)
Thank you ccbtimewiz it works for me, ive been looking how to do this for ages. You really have made my day. *virtual hug*