how to show a 3rd banner type

I have this code that displays banners of two types.

a banner that shows 468x60 and then two random banners of 120x240 & 120x600 sizes

the banners are called by the script

 <?=show_banner("1");?> & <?=show_banner("2");?>

I want to have a 3rd banner location of 728x90 and call it like this

<?=show_banner("3");?>

how would I change the code below to do this?

Thanks

[php]
function banner_sizes($s) {
$sizes_array = array(“468x60”, “120x240”, “120x600”);
$select = “<select name=“BannerSize”>\n\t”;
foreach($sizes_array as $b)
{
if($s == $b)
{
$select .= “<option value=”$b" selected>$b\n\t";
}
else
{
$select .= “<option value=”$b">$b\n\t";
}
}
$select .= “”;
return $select;
}
function show_banner($bs) {
/*
$bs = 1 (468x60) and 2 (random from 120x240, 120x600)
*/
global $dir;
if($bs == ‘1’)
{
$new_bs = “(‘468x60’)”;
}
else
{
$new_bs = “(‘120x240’, ‘120x600’)”;
}
$q1 = “select * from games_banners where BannerSize in $new_bs order by rand() limit 0,1 “;
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);
if($a1[BannerType] == “link_code”)
{
$banner_html = $a1[LinkCode];
}
else
{
$size = explode(“x”, $a1[BannerSize]);
$banner_html = “<a href=”$a1[BannerURL]” target=”_top"><img src="$dir/bfiles/$a1[BannerFile]]http://$_SERVER[HTTP_HOST]$dir/bfiles/$a1[BannerFile]" alt="$a1[BannerAlt]" border=0 width="$size[0]" height="$size[1]">";
}
return $banner_html;
}

[/php]

[font=courier new]if($bs == ‘1’[/font])
{
$new_bs = “(‘468x60’)”[font=courier new];
}
elseif($bs == ‘2’)
{
$new_bs = “([/font]‘728x90’, ‘728x90’)”[font=courier new];
}
else[/font]
[font=courier new]{[/font]
[font=courier new]$new_bs = “(‘120x240’, ‘120x600’)”;[/font]
[font=courier new]}[/font]

Sponsor our Newsletter | Privacy Policy | Terms of Service