Warning: touch() [function.touch]: Utime failed: Permission denied in E:\Feel.com\petshop\petcenter.php on line 115
Warning: fopen(E:\Feel2u.com\/petshop/bbscache/notice.txt) [function.fopen]: failed to open stream: Permission denied in E:\Feel.com\petshop\petcenter.php on line 116
Warning: flock() expects parameter 1 to be resource, boolean given in E:\Feelu.com\petshop\petcenter.php on line 118
Warning: fwrite(): supplied argument is not a valid stream resource in E:\Feel.com\petshop\petcenter.php on line 120
Warning: ftruncate(): supplied argument is not a valid stream resource in E:\Feelu.com\petshop\petcenter.php on line 121
Warning: fclose(): supplied argument is not a valid stream resource in E:\Feel.com\petshop\petcenter.php on line 122
petcenter.php文件为:
<?php
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
require_once('./petshop/bbscache/pet_gm.php');
$marryfa = $lang['marryfa'];
$group = $db->fetch_array($db->query("SELECT * FROM " . $tablepre . "members WHERE username='$usernamepet'"));
$petsettings = $db->fetch_array($db->query("SELECT * FROM " . $tablepre . "petconfig WHERE 1"));
if ($petsettings['chaton'] == 1) {
$chatroom = "<a href=petshop.php?index=petbank>" . $lang['pet_bank'] . "</a>";
} else {
$chatroom = "<s>" . $lang['pet_bank'] . "</s>";
}
$v = substr("$petsettings[version]", -4);
$v1 = substr("$petsettings[version]", -12);
$v2 = substr("$petsettings[version]", 0, 8);
if (($one != '' && $discuz_user == $one) || ($two != '' && $discuz_user == $two) || ($three != '' && $discuz_user == $three) || ($four != '' && $discuz_user == $four)) {
$gm = 1;
} else {
$gm = 0;
}
if ($discuz_user == $manager) {
$admincheck = 1;
} elseif ($foruminfo['forumadmin'] && strpos($foruminfo['forumadmin'], ',' . $discuz_user . ',') !== false) {
$admincheck = 1;
} else {
$admincheck = 0;
}
!$discuz_user && $admincheck = 0;
if ($admincheck || $gm) {
$adminpet = "(<a href=petshop.php?index=petadmin><font color=red>" . $lang['pet_adminpanle'] . "</font></a>)";
}
$helpinfo = "<br>>><a href=petshop.php?index=pethelp><b>" . $lang['pet_help'] . "</b></a><<";
if (@filemtime(DISCUZ_ROOT . '/petshop/bbscache/notice.txt') < $timestamp-3600 * 120) {
$wget = @file("http://pet.dreahome.com/notice.php?url=$_SERVER[HTTP_HOST]$_SERVER[PHP_SELF]");
$wget = @implode('', $wget);
writenotice(DISCUZ_ROOT . '/petshop/bbscache/notice.txt', $wget);
}
$query = $db->query("SELECT * FROM " . $tablepre . "mypetdata where 1 ORDER BY mypetjob DESC,mypetexp DESC Limit 1");
$total = $db->fetch_array($query);
$mypetjob = $total[mypetjob];
$petlevel = pow (log10 ($total[mypetexp] / ($mypetjob * 0.2 + 1)), 3);
$petshowlevel = floor ($petlevel + 1);
$total[mypetlevel] = $petshowlevel;
$levelpic = intval($total['mypetlevel'] / 10);
if ($levelpic > 10) {
$levelpic = 11;
}
$levelpic2 = intval($petshowlevel / 10);
if ($levelpic2 > 10) {
$levelpic2 = 11;
}
$petjob = $total['mypetjob'];
$petpic = $total['mypetname'];
if ($petjob == 0) {
$petpic2 = "<img src=$imgpath/pet/$petpic/$petpic$levelpic.gif border=0>";
$petjobpic = " ";
} else {
$petpic2 = " ";
$petjobpic = "<img src=$total[mypetpic] border=0>";
}
if (($petjob == 1 || $petjob == 2 || $petjob == 3) && $petshowlevel < 200) {
$petpic2 = " ";
$petjobpic = " ";
$petjobpic2 = "<img src=$imgpath/pet/$petpic/$petpic$levelpic2.gif border=0>";
} else {
$petjobpic2 = " ";
}
$query = $db->fetch_array($db->query("SELECT COUNT(mypetexp) AS msgcount FROM " . $tablepre . "mypetdata"));
$allpet = $query['msgcount'];
$query = $db->query("UPDATE " . $tablepre . "mypetdata SET hack=0 WHERE username='$usernamepet'");
$members = $db->fetch_array($db->query("SELECT * FROM " . $tablepre . "mypetdata WHERE username='$usernamepet'"));
if ($members[pkround] == 1 && $members[pkagree] == 0 && $members[mypetgd] >= 0) {
pet_showmessage('你接到 ' . $members[pkname] . ' 的挑战书,是否同意战斗?<BR><BR><a href=petshop.php?index=pkf&action=atkpet>同意</a>│<a href=petshop.php?index=petbattle&action=sayno>拒绝</a>');
}
include template('petcenter');
function writenotice($filename, $data, $method = "rb+", $iflock = 1, $chmod = 1)
{
$check && strpos($filename, '..') !== false && exit('Forbidden');
touch($filename);
$handle = fopen($filename, $method);
if ($iflock) {
flock($handle, LOCK_EX);
}
fwrite($handle, $data);
if ($method == "rb+") ftruncate($handle, strlen($data));
fclose($handle);
$chmod && @chmod($filename, 0777);
}
?>
请问如何修复呢? |