Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: reikia pagalbos dėl banner_panel
Parašė Mantas_· 2009 Sau. 5 16:01:47
#1
Sveiki reikia pagalbos dėl banner_panel Man niekaip neišeina padaryti kad rodytu 3 banerius. Va view.php failas
<?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);
$bannum = mt_rand(0, $numrows);
}
else
{
$bannum = 0;
}
$bresult2 = dbquery("select * from ".$db_prefix."banner WHERE status='1' limit $bannum,2");
$banner = dbarray($bresult2);
if($numrows > 0)
{
$banner_display = '<a target="_banner" href="'.INFUSIONS.'banner_panel/click.php?bid='.$banner['bid'].'"><img src="'.$banner['imageurl'].'" border="1" height="'.$bannerheight.'" width="'.$bannerwidth.'"></a>';
//check ownership user to client id
if($banner['cid']!=$userdata['user_id'])
{
//add the impression
dbquery("update ".$db_prefix."banner set impmade=impmade+1 where bid=$banner[bid]");
}//if($cid==$userdata['user_id'])
//check if it should be ended
//add a date and set status to 0
if($banner['impmade'] >= $banner['imptotal'] && $banner['imptotal']!='0')
{
dbquery("UPDATE ".$db_prefix."banner SET enddate=NOW( ) , status = '0' WHERE bid =$banner[bid] LIMIT 3 ;")
}//if($imptotal>$impmade)
}//if($numrows > 0)
}//if($bresult != "")
?>
Parašė InTer· 2009 Sau. 5 18:01:12
#2
tiksiai nežinau bet manau reikia LIMIT 1 pakeisti i 2?|
Parašė Mantas_· 2009 Sau. 5 19:01:54
#3
bandžiau neina
Parašė edis2· 2009 Sau. 5 19:01:04
#4
@opentable("<center>Reklama</center>");
///Banner system///
$bresult2 = dbquery("select * from ".$db_prefix."banner WHERE status='1' ORDER BY RAND() limit 0,1");
while($banner = dbarray($bresult2)) {
$banner_display = '<center><a target="_banner" href="'.INFUSIONS.'banner_panel/click.php?bid='.$banner['bid'].'"><img src="'.$banner['imageurl'].'" border="0" ></a><br></center>';
//check ownership user to client id
if($banner['cid']!=$userdata['user_id'])
{
//add the impression
dbquery("update ".$db_prefix."banner set impmade=impmade+1 where bid=$banner[bid]");
}
if($banner['impmade'] >= $banner['imptotal'] && $banner['imptotal']!='0')
{
dbquery("UPDATE ".$db_prefix."banner SET enddate=NOW( ) , status = '0' WHERE bid =$banner[bid] LIMIT 1 ;");
}
echo $banner_display;
}
@closetable();
Dėk panele kita :)
Parašė Mantas_· 2009 Sau. 5 19:01:50
#5
ne ten banner sistema ten modas o ne panele
Parašė edis2· 2009 Sau. 5 19:01:46
#6
Nu tai instaliuoji ta modą ir panaudoji tą panele :)
Parašė Mantas_· 2009 Sau. 5 19:01:21
#7
vistiek 1 rodo :|
Parašė edis2· 2009 Sau. 5 19:01:23
#8
@opentable("<center>Reklama</center>");
///Banner system///
$bresult2 = dbquery("select * from ".$db_prefix."banner WHERE status='1' ORDER BY RAND() limit 0,2");
while($banner = dbarray($bresult2)) {
$banner_display = '<center><a target="_banner" href="'.INFUSIONS.'banner_panel/click.php?bid='.$banner['bid'].'"><img src="'.$banner['imageurl'].'" border="0" ></a><br></center>';
//check ownership user to client id
if($banner['cid']!=$userdata['user_id'])
{
//add the impression
dbquery("update ".$db_prefix."banner set impmade=impmade+1 where bid=$banner[bid]");
}
if($banner['impmade'] >= $banner['imptotal'] && $banner['imptotal']!='0')
{
dbquery("UPDATE ".$db_prefix."banner SET enddate=NOW( ) , status = '0' WHERE bid =$banner[bid] LIMIT 1 ;");
}
echo $banner_display;
}
@closetable();
Limitą pasikeisk, dabar 2rodyt turetu :)
Redagavo edis2· 2009 Sau. 5 19:01:42
Parašė Mantas_· 2009 Sau. 5 19:01:18
#9
ačiū veikia;)
Parašė edis2· 2009 Sau. 5 19:01:16
#10
Nėra už ka :)