I have written my own code to randomly display a banner that is PHP/mySQL based. What I am trying to figure out is how to get the code which works great when I call it myself to work with Vbulletin.
The code is
PHP Code:
<?
include("include/dbconnect.php");
$result = mysql_query("SELECT * FROM $table where active = 'Y' ORDER BY RAND() LIMIT 0,1",$db);
$row = mysql_fetch_array($result);
$did = $row["did"];
$image_url = $row["image_url"];
$url = $row["url"];
$alt_text = $row["alt_text"];
$target = $row["target"];
$width = $row["width"];
$height = $row["height"];
$active = $row["active"];
$richtext = $row["richtext"];
$code = $row["code"];
if ($richtext == 'Y') { $banner = "$code"; } ELSE { $banner = "<a href='$url' target='$target'><img src='$image_url' border='0' alt='$alt_text' width='$width' height='$height'></a>"; }
echo "$banner";
?>
I tried calling this in my forum header template by saying
<script src="http://www.newcelica.org/banners/display.php"></script>
But it does not display anything. Any help is truly appreciated as I'm stumped on this one.