Fatal error: Call to undefined function: acl_..........
Får denne fejl når php siden åbnes:Fatal error: Call to undefined function: acl_check() in phpAds/view.inc.php3 on line 115
Siden som melder fejlen kommer her:
<html>
<head>
<title>L O C A L E H O S T</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<?
require(\"phpAds/config.inc.php3\");
require(\"phpAds/view.inc.php3\");
?>
<body bgcolor=\"#FFFFCC\" background=\"gfx/pixel-bg.GIF\" text=\"#000000\" margin=0 marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">
<tr>
<td>
<div align=\"center\">
<? $id = view(\"160x37\");
?></div>
</td>
</tr>
</table>
</body>
</html>
og her er det script hvor linie 115 er:
<?
/* $Id: view.inc.php3,v 1.22 2000/04/24 14:58:37 tobias Exp $ */
// Get a banner
function get_banner($what, $clientID, $context=0)
{
global $phpAds_db, $REMOTE_HOST, $phpAds_tbl_banners, $REMOTE_ADDR, $HTTP_USER_AGENT;
$where = \"\";
if($context == 0)
{
$context = array();
}
for($i=0; $i<count($context); $i++)
{
list($key, $value) = each($context[$i]);
{
switch($key)
{
case \"!=\": $exclusive[] = \"bannerID <> $value\"; break;
case \"==\": $inclusive[] = \"bannerID = $value\"; break;
}
}
}
$where_exclusive = !empty($exclusive) ? implode(\" AND \", $exclusive): \"\";
$where_inclusive = !empty($inclusive) ? implode(\" OR \", $inclusive): \"\";
$where = sprintf(\"$where_inclusive %s $where_exclusive\", (!empty($where_inclusive) && !empty($where_exclusive)) ? \"AND\": \"\");
$where = trim($where);
if(!empty($where))
{
$where .= \" AND \";
}
$select = \"SELECT
bannerID,
banner,
format,
width,
height,
alt,
bannertext,
url
FROM
$phpAds_tbl_banners
WHERE
$where
active = \'true\' \";
if($clientID != 0)
{
$select .= \" AND clientID = $clientID \";
}
if(is_string($what) && !ereg(\"[0-9]x[0-9]\", $what))
{
switch($what)
{
// Get all HTML banners
case \"html\":
$select .= \" AND format = \'html\' \";
break;
//Not any of the special words (i.e. \'html\'), So, must be a keyword
default:
$select .= \" AND (\";
$what_array = explode(\",\",$what);
for($k=0; $k<count($what_array); $k++)
{
$select .= \"keyword = \'\".trim($what_array[$k]).\"\' OR \";
}
/*
The special \'global\' keyword allows you to define a banner as global and
show up under all keywords. I put this in so that if I didn\'t have any banners
for a particular keyword, instead of being blank, it would show one of the global
banners - Weston Bustraan <weston@infinityteldata.net>
*/
$select .= \"keyword = \'global\') \";
} //switch($what)
}
elseif(is_int($what))
{
$select .= \" AND bannerID = $what \";
}
else
{
list($width, $height) = explode(\"x\", $what);
// Get all banners with the specified width/height
$select .= \" AND width = $width
AND height = $height \";
}
// print($select);
$res = @mysql_db_query($phpAds_db, $select);
if(!$res)
return(false);
$rows = array();
while ($tmprow = @mysql_fetch_array($res)) {
$rows[] = $tmprow;
}
$date = getdate(time());
$request = array(\'remote_host\' => $REMOTE_ADDR,
\'user_agent\' => $HTTP_USER_AGENT,
\'weekday\' => $date[\'wday\']);
srand((double)microtime()*1000000);
shuffle($rows);
for ($i = 0; $i < count($rows); $i++) {
if (acl_check($request, $rows[$i])) {
$row = $rows[$i];
break;
}
}
return($row);
}
// Log an adview for the banner with $bannerID
function log_adview($bannerID)
{
global $phpAds_log_adviews, $phpAds_ignore_hosts, $phpAds_reverse_lookup, $phpAds_insert_delayed;
global $row, $phpAds_tbl_adviews;
global $REMOTE_HOST, $REMOTE_ADDR;
if(!$phpAds_log_adviews)
{
return(false);
}
if($phpAds_reverse_lookup)
{
$host = isset($REMOTE_HOST) ? $REMOTE_HOST : @gethostbyaddr($REMOTE_ADDR);
}
else
{
$host = $REMOTE_ADDR;
}
// Check if host is on list of hosts to ignore
$found = 0;
while(($found == 0) && (list($key, $ignore_host)=each($phpAds_ignore_hosts)))
{
if(eregi($ignore_host, $host)) // host found in ignore list
{
$found = 1;
}
}
if($found == 0)
{
$res = @mysql_db_query($GLOBALS[\"phpAds_db\"], sprintf(\"
INSERT %s
INTO $phpAds_tbl_adviews
VALUES
(
\'$bannerID\',
null,
\'$host\'
)
\", $phpAds_insert_delayed ? \"DELAYED\": \"\"));
}
}
// view a banner
function view($what, $clientID=0, $target = \"\", $withtext=0, $context=0)
{
global $phpAds_db, $REMOTE_HOST;
if(!is_int($clientID))
{
$target = $clientID;
$clientID = 0;
}
@mysql_pconnect($GLOBALS[\"phpAds_hostname\"], $GLOBALS[\"phpAds_mysqluser\"], $GLOBALS[\"phpAds_mysqlpassword\"]);
$row = get_banner($what, $clientID, $context);
if(!empty($row[\"bannerID\"]))
{
if(!empty($target))
{
$target = \" target=\\\"$target\\\"\";
}
if($row[\"format\"] == \"html\")
{
if(!empty($row[\"url\"]))
{
echo \"<a href=\\\"$GLOBALS[phpAds_url_prefix]/click.php3?bannerID=$row[bannerID]\\\"$target>\";
}
echo $row[\"banner\"];
if(!empty($row[\"url\"]))
{
echo \"</a>\";
}
}
else
{
echo \"<a href=\\\"$GLOBALS[phpAds_url_prefix]/click.php3?bannerID=$row[bannerID]\\\"$target><img src=\\\"$GLOBALS[phpAds_url_prefix]/viewbanner.php3?bannerID=$row[bannerID]\\\" width=$row[width] height=$row[height] alt=\\\"$row[alt]\\\" border=0></a>\";
if($withtext && !empty($row[\"bannertext\"]))
{
echo \"<BR>\\n<a href=\\\"$GLOBALS[phpAds_url_prefix]/click.php3?bannerID=$row[bannerID]\\\"$target>\".$row[\"bannertext\"].\"</a>\";
}
}
}
log_adview($row[\"bannerID\"]);
return($row[\"bannerID\"]);
}
function view_t($what, $target = \"\")
{
view ($what, $target, 1);
}
?>
Har vi nogen php hajer til stede??!!!!
Jeg vil give drikkepoint for hurtigt svar :-)
