
01-15-2003, 03:39 PM
|
 |
|
|
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 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:
$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
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.
|
The reason i decided to have the variables as an array is to make it easier for newbies to add more banners  - simple as that !
- miSt
|