trafix
04-05-2003, 02:05 AM
I am building a new banner hack to allow targeted sponsorship of nominated forums :)
If a forum is sponsored the approiate banner will be displayed with link.........THIS WORKS!
However if a forum is not sponsored then a random banner is to be selected from the list....THIS IS NOT WORKING :(
I have added this to forumdisplay.php
//############### start advertising / sponsorship banner #############
$showad = $DB_site->query_first("SELECT * FROM ads WHERE forumidnum='$forumid'");
if (empty($showad[forumidnum])) {
$randomad=$DB_site->query("SELECT * FROM ads ORDER BY rand() LIMIT 1");
eval("\$showthisad .= \"".gettemplate("ads_bannerbank")."\";");
} else {
eval("\$showthisad .= \"".gettemplate("ads_forum_sponsor")."\";");
}
Here is the ads_bannerbank template
<center><smallfont>Please support our sponsors<br>
<a target='blank' href='http://www.atmyparty.com/network/click.php?bannerid=$randomad[id]'>
<img border='0' width='$randomad[width]' heigth='$randomad[heigth]' alt='$randomad[banner_text]'
src='http://www.atmyparty.com/network/view.php?bannerid=$randomad[id]'></a>
<br>Please contact us to sponsor area of the site.<br><br></smallfont><center>
here is the source code of the non-sponsored page
<center><font face="verdana,arial,helvetica" size="1" >Please support our sponsors<br>
<a target='blank' href='http://www.atmyparty.com/network/click.php?bannerid='>
<img border='0' width='' heigth='' alt='' src='http://www.atmyparty.com/network/view.php?bannerid='>
</a><br>Please contact us to sponsor area of the site.<br><br></font><center>
What am i doing wrong?
thanks in advance
If a forum is sponsored the approiate banner will be displayed with link.........THIS WORKS!
However if a forum is not sponsored then a random banner is to be selected from the list....THIS IS NOT WORKING :(
I have added this to forumdisplay.php
//############### start advertising / sponsorship banner #############
$showad = $DB_site->query_first("SELECT * FROM ads WHERE forumidnum='$forumid'");
if (empty($showad[forumidnum])) {
$randomad=$DB_site->query("SELECT * FROM ads ORDER BY rand() LIMIT 1");
eval("\$showthisad .= \"".gettemplate("ads_bannerbank")."\";");
} else {
eval("\$showthisad .= \"".gettemplate("ads_forum_sponsor")."\";");
}
Here is the ads_bannerbank template
<center><smallfont>Please support our sponsors<br>
<a target='blank' href='http://www.atmyparty.com/network/click.php?bannerid=$randomad[id]'>
<img border='0' width='$randomad[width]' heigth='$randomad[heigth]' alt='$randomad[banner_text]'
src='http://www.atmyparty.com/network/view.php?bannerid=$randomad[id]'></a>
<br>Please contact us to sponsor area of the site.<br><br></smallfont><center>
here is the source code of the non-sponsored page
<center><font face="verdana,arial,helvetica" size="1" >Please support our sponsors<br>
<a target='blank' href='http://www.atmyparty.com/network/click.php?bannerid='>
<img border='0' width='' heigth='' alt='' src='http://www.atmyparty.com/network/view.php?bannerid='>
</a><br>Please contact us to sponsor area of the site.<br><br></font><center>
What am i doing wrong?
thanks in advance