include_once XOOPS_ROOT_PATH.'/include/functions.php';
global $xoopsConfig;
$db =& Database::getInstance();
$bannerobject = '';
$bresult = $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner"));
list ($numrows) = $db->fetchRow($bresult);
if ( $numrows > 1 ) {
$numrows = $numrows-1;
mt_srand((double)microtime()*1000000);
$bannum = mt_rand(0, $numrows);
} else {
$bannum = 0;
}
if ( $numrows > 0 ) {
$bresult = $db->query("SELECT * FROM ".$db->prefix("banner"), 1, $bannum);
list ($bid, $cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $date, $htmlbanner, $htmlcode) = $db->fetchRow($bresult);
if ($xoopsConfig['my_ip'] == xoops_getenv('REMOTE_ADDR')) {
// EMPTY
} else {
$db->queryF(sprintf("UPDATE %s SET impmade = impmade+1 WHERE bid = %u", $db->prefix("banner"), $bid));
}
/* Check if this impression is the last one and print the banner */
if ( $imptotal == $impmade ) {
$newid = $db->genId($db->prefix("bannerfinish")."_bid_seq");
$sql = sprintf("INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, %u)", $db->prefix("bannerfinish"), $newid, $cid, $impmade, $clicks, $date, time());
$db->queryF($sql);
$db->queryF(sprintf("DELETE FROM %s WHERE bid = %u", $db->prefix("banner"), $bid));
}
if ($htmlbanner){
$bannerobject = $htmlcode;
}else{
$bannerobject = '.XOOPS_URL.'/banners.php?op=click&bid='.$bid.'" target="_blank">';
if (stristr($imageurl, '.swf')) {
$bannerobject = $bannerobject
.'.'.$imageurl.'">'
.''
.' ';
}
echo $bannerobject;
}
|
这意味着我可以创建不同尺寸的横幅吗?
上述描述的块意味着我可以有不同尺寸的横幅吗?
如果可以,我如何将横幅分配到不同的框中?
或者,是否只有一种尺寸的横幅框供所有横幅广告共享?