NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 01-15-2006 13:02:02

Pinkie
Member

Banners depending on the template used

I will create a banner for each layout, and upload it to http://pichu.mihopa.com/oekakis/normal/templates . Each banner will be named after the template with a .giuf extention. So far I've come up with the following:

Code:

<?

if($OekakiU == '' || ($tresult==0)){
    echo '<img src="http://www.pichu.mihopa.com/oekakis/normal/templates/'.$template.'.gif">';
} else {
    if (empty ($row['templatesel']))
        $row['templatesel'] = $template;
    echo '<img src="http://www.pichu.mihopa.com/oekakis/normal/templates/'.$row['templatesel'].'.gif">';
} 

?>

It works perfectly, and it displays it in the exact right possition that I want it to.

However, not all of templates have a banner 'assigned' to them, so I would much rather for the sript to echo nothing. I've tried the following:

Code:

 
<?



if($OekakiU == '' || ($tresult==0)){
    echo '<img src="http://www.pichu.mihopa.com/oekakis/normal/templates/'.$template.'.gif">';
} elseif {
    if (empty ($row['templatesel']))
        $row['templatesel'] = $template;
    echo '<img src="http://www.pichu.mihopa.com/oekakis/normal/templates/'.$row['templatesel'].'.gif">';
} else {
    if (!file_exists ('http://www.pichu.mihopa.com/oekakis/normal/templates/'.$template.'.gif')) || if (!file_exists ('http://www.pichu.mihopa.com/oekakis/normal/templates/'.$row['templatesel'].'.gif')) 
    echo '';

}
?>

but it doesn't seem to work. Any idea on how I can fix this up?

Thank you so much for you help big_smile

Offline

#2 01-15-2006 19:26:28

Waccoon
Administrator

Re: Banners depending on the template used

Try this:

Code:

<?php
if (empty ($OekakiU) || $tresult == 0) {
    $b_template = "./templates/{$template}.gif";
} else {
    $b_template = "./templates/{$row['templatesel']}.gif";
}
if (file_exists ($b_template)) {
    echo '<img src="'.$b_template.'" border="0" /><br />'."\n";
}
?>

Offline

#3 01-16-2006 12:56:54

Pinkie
Member

Re: Banners depending on the template used

It works like a charm. Thanks you ever so much big_smile

Offline

#4 02-21-2006 19:56:57

acwitness
Member

Re: Banners depending on the template used

I know this is probably a stupid question, but I would love to use this - where does the code go??

Offline

#5 02-22-2006 06:16:12

Waccoon
Administrator

Re: Banners depending on the template used

Go to Administration -> Edit Banner, and copy and paste the code above into the banner file.

Don't forget the special tags "<?php" and "?>", or else the code won't work.  Copy and paste it exactly from the code block above.

Make sure you have an image for each template, and the case of the filenames is exactly the same as the template.  There is a difference between "2draw" and "2Draw".

So, in your templates directory, you would upload:

2draw.gif
aoi.gif
blue-ness.gif
...

Offline

#6 02-22-2006 07:42:07

acwitness
Member

Re: Banners depending on the template used

Thanks so much - works great!!

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB