Sveiki, visus su šventėm.
Tai va, parsisiunčiau Banner_System mod'ą ir norėjau pasidaryt, kad rodytų iškart dvi reklamas, tai redagavau view.php failą štai taip:
<?php
//Be sure to alter this to suit your site
//if you uncomment this code the banners will be this size in all areas top,center,side
if (!isset($bannerheight)){$bannerheight='60';}
if (!isset($bannerwidth)){$bannerwidth='468';}
global $db_prefix, $userdata, $locale;
$bresult = dbquery("select * from ".$db_prefix."banner WHERE status='1'");
$gotbanners = dbrows($bresult);
if($gotbanners > "0")
{
$numrows = dbrows($bresult);
//Randomize
if ($numrows > 1)
{
$numrows = $numrows-1;
mt_srand((double)microtime()*1000000);
$bannum2 = mt_rand(0, $numrows);
}
else
{
$bannum2 = 0;
}
$bresult2 = dbquery("select * from ".$db_prefix."banner WHERE status='1' LIMIT $bannum2,1");
$banner1 = dbarray($bresult2);
$bannum3 = $bannum2 - 1;
if ($bannum3 <0)
{ $bannum3 = $bannum2 + 1;
}
$bresult3 = dbquery("select * from ".$db_prefix."banner WHERE status='1' LIMIT $bannum3,1");
$banner2 = dbarray($bresult3);
if($numrows > 0)
{
$banner_display = '<a target="_banner" href="'.INFUSIONS.'banner_panel/click.php?bid='.$banner1['bid'].'"><img src="'.$banner1['imageurl'].'" border="1" height="'.$bannerheight.'" width="'.$bannerwidth.'"></a><br><a target="_banner" href="'.INFUSIONS.'banner_panel/click.php?bid='.$banner2['bid'].'"><img src="'.$banner2['imageurl'].'" border="1" height="'.$bannerheight.'" width="'.$bannerwidth.'"></a>';
//check ownership user to client id
if($banner1['cid']!=$userdata['user_id'])
{
//add the impression
dbquery("UPDATE ".$db_prefix."banner set impmade=impmade+1 where bid='$banner1[bid]'");
}//if($cid==$userdata['user_id'])
//check if it should be ended
//add a date and set status to 0
if($banner1['impmade'] >= $banner1['imptotal'] && $banner1['imptotal']!='0')
{
dbquery("UPDATE ".$db_prefix."banner SET enddate=NOW( ) , status = '0' WHERE bid =$banner1[bid] LIMIT 1");
}//if($imptotal>$impmade)
if($banner2['cid']!=$userdata['user_id'])
{
//add the impression
dbquery("UPDATE ".$db_prefix."banner set impmade=impmade+1 where bid='$banner2[bid]'");
}//if($cid==$userdata['user_id'])
//check if it should be ended
//add a date and set status to 0
if($banner2['impmade'] >= $banner2['imptotal'] && $banner2['imptotal']!='0')
{
dbquery("UPDATE ".$db_prefix."banner SET enddate=NOW( ) , status = '0' WHERE bid='$banner2[bid]' LIMIT 1");
}//if($imptotal>$impmade)
}//if($numrows > 0)
}//if($bresult != "")
?>
atvaizduoja gerai, tačiau blogai prideda parodymus (dažniausiai sudvigubina). Gal kas žino, kame "replės" ?
|