Me baje el phpbannerechange como modulo para phpnuke.
Mi phpnuke es el 6.0, todo funciona perfecto, pero cuando tiene que mostrar el banner me muestra el siguiente error y va refrescando la página:
Código:
Warning: shuffle() expects parameter 1 to be array, null given in /home/webencat/public_html/modules/bannerexchange/ban.php on line 30 Warning: shuffle() expects parameter 1 to be array, null given in /home/webencat/public_html/modules/bannerexchange/ban.php on line 30 Fatal error: Cannot break/continue 1 level in /home/webencat/public_html/modules/bannerexchange/ban.php on line 32
El codigo fuente de ban.php:
Código PHP:
<?
/////////////////////////////////////////////////
// phpBannerExchange //
// A Free Script by: //
// //
// darkrose - [email][email protected][/email] //
// lazurus - [email][email protected][/email] //
// //
// Updates and future versons can be found at: //
// [url]http://www.internetunderground.com/scripts/[/url] //
// //
// This script is covered under the GNU GPL. //
// //
// If you modify this script, please make your //
// code available to us! We are not programmers//
// by trade, so there's bound to be bugs and //
// inefficient code, but we're trying! //
/////////////////////////////////////////////////
require_once("../../config.php");
require_once("../../includes/sql_layer.php");
include("config.php");
//echo $module_name;
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
if ($func=="view"){
$update_uid=sql_query("update ".$prefix."_exchange set credits=credits+1 where id='$uid'",$dbi);
$eligable=sql_query("select id from ".$prefix."_exchange where approved='1' and credits >= 1 and id != '$uid'",$dbi);
$get_number=sql_num_rows($eligable);
if($get_number == 0){ $eligable=sql_query("select id from ".$prefix."_exchange where defaultacct='1' and id != '$uid'",$dbi);}
while($rand_rows = sql_fetch_array($eligable)){$id_array[] = $rand_rows[id];}
srand((double)microtime()*1000000);shuffle($id_array);srand((double)microtime()*1000000);shuffle($id_array);$pick = $id_array[0];
$get_banner = sql_query("select bannerurl from ".$prefix."_exchange_urls where uid='$pick'",$dbi);
$get_number=sql_num_rows($get_banner);if($get_number == 0){echo "<meta http-equiv=\"refresh\" content=\"0;URL=?func=view&uid=$uid\">";break;}
while($rand_ban = mysql_fetch_array($get_banner)){$ban_array[] = $rand_ban[bannerurl];}
srand((double)microtime()*1000000);shuffle($ban_array);srand((double)microtime()*1000000);shuffle($ban_array);$banner=$ban_array[0];
$update_bid=sql_query("update ".$prefix."_exchange set exposures=exposures+1, credits=credits-1 where id='$pick'",$dbi);
echo "<a href=\"http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/ban.php?func=click&uid=$uid&bid=$pick\" target=_blank><img src=\"$banner\" border=0 width=$banner_width height=$banner_height></a>";
Break;
}
if ($func=="click"){
$update_clicks=sql_query("update ".$prefix."_exchange set clicks=clicks+1 where id='$bid'",$dbi);
$update_clickfrom=sql_query("update ".$prefix."_exchange set siteclicks=siteclicks+1 where id='$uid'",$dbi);
$get_rows=sql_query("select url from ".$prefix."_exchange where id='$bid'",$dbi);
$get_url=@sql_fetch_array($get_rows);
$clickurl=$get_url[url];
header("Location: $clickurl");
}
?>
Que es lo que falla?
Gracias.