Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 07:09 am EST
Geeklog Forums
Use Sitename if no LOGO image
Page navigation
CDC
Anonymous
How can i modify all my theme header.thtml to if there is no public_html/images/LOGO.gif it will use the SITENAME:
<a href="{site_url}/index.php"><font size="6" color="#FF0000">{site_name}</font></a>
<a href="{site_url}/index.php"><font size="6" color="#FF0000">{site_name}</font></a>
37
29
Quote
CDC
Anonymous
No, The HTML i quoted is just using the SITE name.
I need some code to tell if there is no LOGO.gif it will use the SITENAME.
I need some code to tell if there is no LOGO.gif it will use the SITENAME.
44
32
Quote
CDC
Anonymous
Sorry for my definition.
But what i need is !
In the theme header of ex. WebBadAss_White you can specify if you will use a image or the site name as top logo...
Thats were i need some code to tell if there is no LOGO.gif it will use the SITENAME.
But what i need is !
In the theme header of ex. WebBadAss_White you can specify if you will use a image or the site name as top logo...
Thats were i need some code to tell if there is no LOGO.gif it will use the SITENAME.
34
38
Quote
CDC
Anonymous
I dont understand!
If there is no image called logo.gif in the images map, will the header use the site name as a top logo with this code...
<img src="{site_logo}" alt="{site_name}">
If there is no image called logo.gif in the images map, will the header use the site name as a top logo with this code...
<img src="{site_logo}" alt="{site_name}">
25
33
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by CDC: If there is no image called logo.gif in the images map, will the header use the site name as a top logo with this code...
As I said above, this is just plain HTML. The text within the alt attribute will be displayed when the image is not there (or the user has decided to not load images).
Unless what you really want is something fancy (although I don't see the point), which would mean to use some PHP code (
file_exists
would come to mind) and an if
statement ...bye, Dirk
28
23
Quote
CDC
Anonymous
Sorry but i cannot get it working.
This is the toptable in my header:
<tr>
<td bgcolor="#FFFFFF" class="outerborder">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<form action="{site_url}/search.php" method="get">
<tr width="100%" cellspacing="0" cellpading="0">
<td align="left">
<a href="{site_url}"><img src="{site_logo}" alt="{site_name}"></a>
</td>
With the logo.gif it is ok.
When i remove the logo.gif -take a look: http://www.internetsider.dk
This is the toptable in my header:
<tr>
<td bgcolor="#FFFFFF" class="outerborder">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<form action="{site_url}/search.php" method="get">
<tr width="100%" cellspacing="0" cellpading="0">
<td align="left">
<a href="{site_url}"><img src="{site_logo}" alt="{site_name}"></a>
</td>
With the logo.gif it is ok.
When i remove the logo.gif -take a look: http://www.internetsider.dk
32
50
Quote
CDC
Anonymous
My point is...
I have this complet GeekLog site with all the installations Forum, Chat, etc. and maybe 25 different theme.
When someone need at new site i can copy this complet GeekLog site to a new domain, and use the text or image for TopLogo and i am done.
I have this complet GeekLog site with all the installations Forum, Chat, etc. and maybe 25 different theme.
When someone need at new site i can copy this complet GeekLog site to a new domain, and use the text or image for TopLogo and i am done.
32
36
Quote
Status: offline
vegeta9870
Forum User
Newbie
Registered: 11/07/03
Posts: 8
Text Formatted Code
if
file_exists({site_logo})
<a href="{site_url}/index.php"><img src={site_logo} alt={sitename}></a>
} else {
<center><font color="#whatever" size="whatever">{sitename}</center></font>
I believe thats it. If not i might be wrong on a small part.
If you wish to taste the ground feel free to attack me.
30
38
Quote
CDC
Anonymous
No its not working.
i have tryed:
<?php
if
file_exists({site_logo})
<a href="{site_url}/index.php"><img src={site_logo} alt={sitename}></a>
} else {
print '<font size="6" color="#BEA982">{site_name}</font>';
?>
and:
<?php
if
file_exists($site_logo) {
print "<a href="{$site_url}/index.php"><img src="{$site_logo}" alt="{$sitename}"></a>";
} else {
print "<center><font color="#FF0000" size="6">{$sitename}</center></font>";
}
?>
It gives me an error to!
i have tryed:
<?php
if
file_exists({site_logo})
<a href="{site_url}/index.php"><img src={site_logo} alt={sitename}></a>
} else {
print '<font size="6" color="#BEA982">{site_name}</font>';
?>
and:
<?php
if
file_exists($site_logo) {
print "<a href="{$site_url}/index.php"><img src="{$site_logo}" alt="{$sitename}"></a>";
} else {
print "<center><font color="#FF0000" size="6">{$sitename}</center></font>";
}
?>
It gives me an error to!
28
35
Quote
Status: offline
squatty
Forum User
Full Member
Registered: 01/21/02
Posts: 269
That code won't work. You can't evaluate template variables inside a php statement.
Try substituting {site_url} (and all other template variables) with the $_CONF global. For example, $_CONF['site_url'].
In a world without walls and fences, who needs Windows and Gates?
Try substituting {site_url} (and all other template variables) with the $_CONF global. For example, $_CONF['site_url'].
In a world without walls and fences, who needs Windows and Gates?
25
33
Quote
CDC
Anonymous
I am not sure about this:
<?php
if
file_exists($_CONF['site_url']) {
print "<a href="{$_CONF['site_url']/index.php"><img src="{$site_logo}" alt="{$sitename}"></a>";
} else {
print "<center><font color="#FF0000" size="6">{$sitename}</center></font>";
}
?>
its not working...
<?php
if
file_exists($_CONF['site_url']) {
print "<a href="{$_CONF['site_url']/index.php"><img src="{$site_logo}" alt="{$sitename}"></a>";
} else {
print "<center><font color="#FF0000" size="6">{$sitename}</center></font>";
}
?>
its not working...
34
25
Quote
Status: offline
squatty
Forum User
Full Member
Registered: 01/21/02
Posts: 269
One more thing...there is no $_CONF['site_logo'] definition in config.php. You need to use the full path of the image.
For example:
<?php
$filename = '/path/to/logo.gif';
if (file_exists($filename)) {
print '<a href="'.$_CONF['site_url'].'/index.php"><img src="$filename" alt="'.$_CONF['site_name'].'"></a>';
} else {
print '<font size="6" color="#BEA982">'.$_CONF['site_name'].'</font>';
}
?>
In a world without walls and fences, who needs Windows and Gates?
For example:
Text Formatted Code
<?php
$filename = '/path/to/logo.gif';
if (file_exists($filename)) {
print '<a href="'.$_CONF['site_url'].'/index.php"><img src="$filename" alt="'.$_CONF['site_name'].'"></a>';
} else {
print '<font size="6" color="#BEA982">'.$_CONF['site_name'].'</font>';
}
?>
In a world without walls and fences, who needs Windows and Gates?
38
35
Quote
CDC
Anonymous
This is how i did it:
<?php
$filename = '{site_url}/images/logo.gif';
if (file_exists($filename)) {
print '<a href="'.$_CONF['site_url'].'/index.php"><img src="{site_url}/images/logo.gif" alt="'.$_CONF['site_name'].'"></a>';
} else {
print '<font size="6" color="#BEA982">'.$_CONF['site_name'].'</font>';
}
?>
But no.
<?php
$filename = '{site_url}/images/logo.gif';
if (file_exists($filename)) {
print '<a href="'.$_CONF['site_url'].'/index.php"><img src="{site_url}/images/logo.gif" alt="'.$_CONF['site_name'].'"></a>';
} else {
print '<font size="6" color="#BEA982">'.$_CONF['site_name'].'</font>';
}
?>
But no.
32
28
Quote
CDC
Anonymous
Sorry this way, but no:
<?php
$filename = '{site_url}/images/logo.gif';
if (file_exists($filename)) {
print '<a href="'.$_CONF['site_url'].'/index.php"><img src="$filename" alt="'.$_CONF['site_name'].'"></a>';
} else {
print '<font size="6" color="#BEA982">'.$_CONF['site_name'].'</font>';
}
?>
http://www.internetsider.dk/internetsider/public_html/layout/CDCblues/header.thtml
<?php
$filename = '{site_url}/images/logo.gif';
if (file_exists($filename)) {
print '<a href="'.$_CONF['site_url'].'/index.php"><img src="$filename" alt="'.$_CONF['site_name'].'"></a>';
} else {
print '<font size="6" color="#BEA982">'.$_CONF['site_name'].'</font>';
}
?>
http://www.internetsider.dk/internetsider/public_html/layout/CDCblues/header.thtml
25
32
Quote
Status: offline
squatty
Forum User
Full Member
Registered: 01/21/02
Posts: 269
$filename = '{site_url}/images/logo.gif';
That won't work!!!! I can't make it any clearer...you can't evaluate template variables inside of a php statement.
You need to give the full system level path to the image. For example:
$filename='/var/www/html/geeklog/public_html/layout/Yahoo/images/logo.gif';
You will need to customize the above for each theme you have on your Geeklog site.
In a world without walls and fences, who needs Windows and Gates?
25
40
Quote
CDC
Anonymous
won't work...
<?php
$filename = '/var/www/html/internetsider/public_html/layout/CDCblues/images/logo.gif';
if (file_exists($filename)) {
print '<a href="'.$_CONF['site_url'].'/index.php"><img src="$filename" alt="'.$_CONF['site_name'].'"></a>';
} else {
print '<font size="6" color="#BEA982">'.$_CONF['site_name'].'</font>';
}
?>
I give up
<?php
$filename = '/var/www/html/internetsider/public_html/layout/CDCblues/images/logo.gif';
if (file_exists($filename)) {
print '<a href="'.$_CONF['site_url'].'/index.php"><img src="$filename" alt="'.$_CONF['site_name'].'"></a>';
} else {
print '<font size="6" color="#BEA982">'.$_CONF['site_name'].'</font>';
}
?>
I give up
31
36
Quote
Page navigation
All times are EST. The time is now 07:09 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content