Posted on: 01/12/04 03:22am
By: Anonymous (CDC)
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>
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 03:53am
By: Dirk
Hmm? The HTML you quoted should already do what you want ...
bye, Dirk
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 04:14am
By: Anonymous (CDC)
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.
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 04:31am
By: Dirk
<img src="{site_logo}" alt="{site_name}">
Plain ol' HTML ...
bye, Dirk
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 05:59am
By: Anonymous (CDC)
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.
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 09:48am
By: Turias
Use Dirk's HTML code above.
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 12:53pm
By: Anonymous (CDC)
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}">
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 01:41pm
By: Dirk
[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...[/QUOTE]
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
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 03:17pm
By: Anonymous (CDC)
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
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 04:53pm
By: geKow
Hmmm.... I'm not sure what your point is. Do you mean you don't want an image as logo and a text instead, or do do you bother what happens when the image mysteriously disappears from your server?
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 06:01pm
By: Anonymous (CDC)
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.
Re:Use Sitename if no LOGO image
Posted on: 01/12/04 06:58pm
By: vegeta9870
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.
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 05:23am
By: Anonymous (CDC)
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!
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 08:33am
By: squatty
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'].
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 09:07am
By: Anonymous (CDC)
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...
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 09:07am
By: squatty
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>';
}
?>
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 09:43am
By: Anonymous (CDC)
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.
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 09:48am
By: Anonymous (CDC)
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
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 09:50am
By: squatty
$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.
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 10:05am
By: Anonymous (CDC)
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
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 11:10am
By: squatty
Try this:
<?php
global $_CONF;
$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>';
}
?>
If the above doesn't work, replace the print with echo. This should return the code to your browser. Reply back with what you see.
Re:Use Sitename if no LOGO image
Posted on: 01/13/04 01:43pm
By: Anonymous (CDC)
This is the place of my logo:
http://www.internetsider.dk/internetsider/public_html/layout/CDCblues/images/logo.gif
This is what i se when using the code above with and without echo: http://www.internetsider.dk/internetsider/public_html/test-1.jpg