
02-09-2003, 06:40 PM
|
|
|
Join Date: Jan 2002
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally posted by NanoEntity
nice one Mist!
Mist! I would just forget about global.php, why not just insert this code to the phpinclude, it will be easy to mod if you need to add a new banner.
Also why list them as
$banner[1]="banner1.gif";
$banner[2]="newthread.gif";
Why not make an Array.
$banners=array('banner1', 'banner2');
Here is a simple way to do it, only takes 3 lines
PHP Code:
//?hololith.com(NanoEntity)
$banners=array('banner1', 'banner2'); //images names
$shuffle=$banners[rand(0,count($banners)-1)]; //shuffle images
$adbanner="<img src=\"https://vborg.vbsupport.ru/greentek/adbanners/$shuffle.gif\" border=\"0\" alt=\"\">\n"; //images output
//END ?hololith.com(NanoEntity)
Was that easy 
DEMO:
http://artwork.hololith.com/sigs.php - random
http://artwork.hololith.com/sigs.php?show=draco v1 - static
http://artwork.hololith.com/sigs.php?show=magal v1 - static
http://artwork.hololith.com/sigs.php?show=kinght v1 - static
This generates random signature, same way it would a banner ad, but its more advanced when it comes to code, about 13 lines.
--------------------------
EDIT - Addon
I am geting PMs from people that want diffrent urls to diffrent banners, here is the code
This was tested and it works.
PHP Code:
//?hololith.com(NanoEntity)
$banner1="<a href=\"http://url1\"><img src=\"{ imagesfolder }/adbanners/banner1.gif\" border=\"0\" alt=\"\"></a>";
$banner2="<a href=\"http://url2\"><img src=\"{ imagesfolder }/adbanners/banner2.gif\" border=\"0\" alt=\"\"></a>";
$banners=array($banner1,$banner2); //banner array
$shuffle=$banners[rand(0,count($banners)-1)]; //shuffle banners
$adbanner="$shuffle\n"; //banners output
//END ?hololith.com(NanoEntity)
Enjoy.
|
NanoEntity, could you please explain how one would add a flash banner (*.swf)
thanks Mist
|