PDA

View Full Version : Question about GABS


powerful_rogue
02-29-2008, 09:59 AM
Hi,

On my forum at present, I have two random banners showing at the bottom of everypage. >> LINK (http://www.doverlocals.co.uk).

Although it currently shows them at random, Im looking for a mod that will make each banner random.

EG (at present)

Banner one | Banner two
Banner three | Banner four
Banner five | Banner six

Im looking for it to do:(all random)

Banner five | Banner two
Banner six | Banner three
Banner four | Banner one

Will this be possible with GAB and will it be possible to keep the box which currently surrounds them?

Thanks

Dave

Morgan
03-02-2008, 05:39 AM
Untested but try editing the 'GAB - Fetch Forum Ads' plugin located at the global_start hook. Find:

$GAB_ads = $gab->fetch_ads();

Afterwards add the following:

function gab_shuffle(&$arr)
{
if (is_array($arr) && count($arr) > 1)
{
$keys = array_keys($arr);
shuffle($keys);
$arr = array_combine($keys, $arr);
}
}
gab_shuffle($GAB_ads);

But as this is custom code, if it doesn't work, I won't offer further support for it. :eek: :)

powerful_rogue
03-02-2008, 03:41 PM
Thanks for your reply morgan.

I'll leave it for the time being as this is they only way ive got the ads on my site. Looks like a great mod though :)

powerful_rogue
03-18-2008, 12:54 AM
Before I purchase GABs, would anyone be kind enough to give the above a test for me please :)

If it works, it should show two random banners side by side in the advertising box!