本文整理汇总了PHP中openfile函数的典型用法代码示例。如果您正苦于以下问题:PHP openfile函数的具体用法?PHP openfile怎么用?PHP openfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了openfile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetOnlineUser
function GetOnlineUser()
{
global $db_online, $db;
$onlineuser = array();
if ($db_online == 1) {
$query = $db->query("SELECT username,uid FROM pw_online WHERE uid>0");
while ($rt = $db->fetch_array($query)) {
$onlineuser[$rt['uid']] = $rt['username'];
}
} else {
$onlinedb = openfile(D_P . 'data/bbscache/online.php');
if (count($onlinedb) == 1) {
$onlinedb = array();
} else {
unset($onlinedb[0]);
}
foreach ($onlinedb as $key => $value) {
if (trim($value)) {
$dt = explode("\t", $value);
$onlineuser[$dt[8]] = $dt[0];
}
}
}
return $onlineuser;
}
示例2: rs_game
function rs_game($xmode)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
$chprocess($xmode);
$sqldir = GAME_ROOT . './gamedata/sql/';
eval(import_module('sys'));
if ($xmode & 32) {
//echo " - 商店初始化 - ";
$sql = file_get_contents("{$sqldir}shopitem.sql");
$sql = str_replace("\r", "\n", str_replace(' bra_', ' ' . $tablepre, $sql));
$db->queries($sql);
$file = __DIR__ . '/config/shopitem.config.php';
$shoplist = openfile($file);
$qry = '';
foreach ($shoplist as $lst) {
if (!empty($lst) && strpos($lst, ',') !== false) {
list($kind, $num, $price, $area, $item, $itmk, $itme, $itms, $itmsk) = explode(',', $lst);
if ($kind != 0) {
$qry .= "('{$kind}','{$num}','{$price}','{$area}','{$item}','{$itmk}','{$itme}','{$itms}','{$itmsk}'),";
}
}
}
if (!empty($qry)) {
$qry = "INSERT INTO {$tablepre}shopitem (kind,num,price,area,item,itmk,itme,itms,itmsk) VALUES " . substr($qry, 0, -1);
}
$db->query($qry);
}
}
示例3: activate430
function activate430()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('skill430', 'player', 'logger', 'sys', 'itemmain'));
\player\update_sdata();
if (!\skillbase\skill_query(430) || !check_unlocked430($sdata)) {
$log .= '你没有这个技能!<br>';
return;
}
$st = check_skill430_state($sdata);
if ($st == 0) {
$log .= '你不能使用这个技能!<br>';
return;
}
if ($st == 2) {
$log .= '技能冷却中!<br>';
return;
}
\skillbase\skill_setvalue(430, 'lastuse', $now);
$file = GAME_ROOT . "./include/modules/base/itemmain/config/mapitem.config.php";
//真是丑陋!
$itemlist = openfile($file);
$in = sizeof($itemlist);
$i = rand(1, $in - 1);
list($iarea, $imap, $inum, $iname, $ikind, $ieff, $ista, $iskind) = explode(',', $itemlist[$i]);
$itm0 = $iname;
$itme0 = $ieff;
$itms0 = $ista;
$itmsk0 = $iskind;
$itmk0 = $ikind;
addnews(0, 'bskill430', $name, $iname);
\itemmain\itemget();
}
示例4: weaponswap
function weaponswap()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'player', 'logger'));
if (strpos($wepsk, 'j') === false) {
$log .= '你的武器不能变换。<br>';
$mode = 'command';
return;
}
$oldw = $wep;
$file = __DIR__ . '/config/wepchange.config.php';
$wlist = openfile($file);
$wnum = count($wlist) - 1;
for ($i = 0; $i <= $wnum; $i++) {
list($on, $nn, $nk, $ne, $ns, $nsk) = explode(',', $wlist[$i]);
if ($wep == $on) {
$wep = $nn;
$wepk = $nk;
$wepe = $ne;
$weps = $ns;
$wepsk = $nsk;
$log .= "<span class=\"yellow\">{$oldw}</span>变换成了<span class=\"yellow\">{$wep}</span>。<br>";
return;
}
}
$log .= "<span class=\"yellow\">{$oldw}</span>由于改造或其他原因不能变换。<br>";
}
示例5: itemuse
function itemuse(&$theitem)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'player', 'itemmain', 'logger'));
$itm =& $theitem['itm'];
$itmk =& $theitem['itmk'];
$itme =& $theitem['itme'];
$itms =& $theitem['itms'];
$itmsk =& $theitem['itmsk'];
if (strpos($itmk, 'p') === 0) {
$log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
$file = __DIR__ . '/config/present.config.php';
$plist = openfile($file);
$rand = rand(0, count($plist) - 1);
list($in, $ik, $ie, $is, $isk) = explode(',', $plist[$rand]);
$itm0 = $in;
$itmk0 = $ik;
$itme0 = $ie;
$itms0 = $is;
$itmsk0 = $isk;
addnews($now, 'present', $name, $itm, $in);
\itemmain\itms_reduce($theitem);
\itemmain\itemget();
return;
} elseif (strpos($itmk, 'ygo') === 0) {
$log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
$file = __DIR__ . '/config/ygobox.config.php';
$plist1 = openfile($file);
$rand1 = rand(0, count($plist1) - 1);
list($in, $ik, $ie, $is, $isk) = explode(',', $plist1[$rand1]);
$itm0 = $in;
$itmk0 = $ik;
$itme0 = $ie;
$itms0 = $is;
$itmsk0 = $isk;
addnews($now, 'present', $name, $itm, $in);
\itemmain\itms_reduce($theitem);
\itemmain\itemget();
return;
} elseif (strpos($itmk, 'fy') === 0) {
$log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
$file = __DIR__ . '/config/fybox.config.php';
$plist1 = openfile($file);
$rand1 = rand(0, count($plist1) - 1);
list($in, $ik, $ie, $is, $isk) = explode(',', $plist1[$rand1]);
$itm0 = $in;
$itmk0 = $ik;
$itme0 = $ie;
$itms0 = $is;
$itmsk0 = $isk;
addnews($now, 'present', $name, $itm, $in);
\itemmain\itms_reduce($theitem);
\itemmain\itemget();
return;
}
$chprocess($theitem);
}
示例6: get_shoplist
function get_shoplist()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys'));
$file = __DIR__ . '/config/shopitem.config.php';
$sl = openfile($file);
return $sl;
}
示例7: loadForm
public function loadForm($formFile){
if(is_file(bizmTpl.'form'.$formFile.suffix)){
return openfile('Template/form'.$formFile.suffix,'bizm');
}else{
if(is_file($File = bizmForm.$formFile.'.ini.php')) {
include_once $File;
return $form;
}else die("The lack of a {$formFile} file!");
}
return array();
}
示例8: get_shoplist
function get_shoplist()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'instance5'));
if ($gametype == 15) {
$file = __DIR__ . '/config/shopitem.config.php';
$sl5 = openfile($file);
return $sl5;
} else {
return $chprocess();
}
}
示例9: get
function get($key)
{
$this->_file = $this->get_file($key, 'get');
if (!file_exists($this->_file)) {
return false;
}
$D = openfile($this->_file);
$D = str_replace('<?php exit;?>', '', $D);
$value = unserialize($this->_have_zlib && $this->_compress_enable ? gzuncompress($D) : $D);
if ($value['Expires'] == 0) {
return $value['Data'];
} else {
$_time = time();
return $_time - $value['Time'] < $value['Expires'] ? $value['Data'] : false;
}
}
示例10: writeMessage
function writeMessage($message)
{
$filename = 'log.txt';
$filemode = 'a';
if (file_exists($filename)) {
$modded = date("dmY", filemtime($filename));
$today = date("dmY");
if ($today != $modded) {
$filemode = 'w';
}
}
$fp = openfile($filename, $filemode);
fwrite($fp, $message);
fwrite($fp, "\n");
fclose($fp);
}
示例11: rs_game
function rs_game($xmode)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
$chprocess($xmode);
eval(import_module('sys', 'map', 'itemmain', 'trap'));
if ($xmode & 16) {
//地图陷阱初始化
$plsnum = sizeof($plsinfo);
$iqry = '';
$file = __DIR__ . '/config/trapitem.config.php';
$itemlist = openfile($file);
$in = sizeof($itemlist);
$an = $areanum ? ceil($areanum / $areaadd) : 0;
for ($i = 1; $i < $in; $i++) {
if (!empty($itemlist[$i]) && strpos($itemlist[$i], ',') !== false) {
list($iarea, $imap, $inum, $iname, $ikind, $ieff, $ista, $iskind) = explode(',', $itemlist[$i]);
if ($iarea == $an || $iarea == 99) {
for ($j = $inum; $j > 0; $j--) {
if ($imap == 99) {
do {
$rmap = rand(0, $plsnum - 1);
} while (in_array($rmap, $map_noitemdrop_arealist));
} else {
$rmap = $imap;
}
$iqry .= "('{$iname}', '{$ikind}','{$ieff}','{$ista}','{$iskind}','{$rmap}'),";
}
}
}
}
if (!empty($iqry)) {
$iqry = "INSERT INTO {$tablepre}maptrap (itm,itmk,itme,itms,itmsk,pls) VALUES " . substr($iqry, 0, -1);
$db->query($iqry);
}
}
}
示例12: fclose
}
} else {
echo "ERROR : File Not Found.";
}
fclose($file);
//finished processing all rows; if we're connected to the google packages then render the graph
echo "<script text=\"text/javascript\">\n\t\t\t\t\t\tif(doneLoadingGoogle)\n\t\t\t\t\t\t\tdrawChart();\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdoneLoadingRows = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t </script>";
}
?>
</head>
<body>
<script type="text/javascript">
loadPackages();
</script>
<?php
openfile("cacheConanOBrien.txt");
?>
<br />
<img src = 'https://pbs.twimg.com/profile_images/1132696610/securedownload_normal.jpeg' />
<span id="chart_div"></span>
<br />
<br />
<ul id="tweets">
<li id="negMsg">
</li>
<ul>
<li id="negScore"></li>
</ul>
<li id="posMsg">
</li>
示例13: openfile
$itmk[5] = 'HB';
$itme[5] = 70;
$itms[5] = 15;
if ($wingames <= 1) {
$itm[6] = '银白盒子';
$itmk[6] = 'p';
$itme[6] = 1;
$itms[6] = 1;
$itmsk[6] = 'ps';
}
$weplist = openfile(config('stwep', $gamecfg));
do {
$index = rand(1, count($weplist) - 1);
list($wep, $wepk, $wepe, $weps, $wepsk) = explode(",", $weplist[$index]);
} while (!$wepk);
$stitemlist = openfile(config('stitem', $gamecfg));
do {
$index = rand(1, count($stitemlist) - 1);
list($itm[3], $itmk[3], $itme[3], $itms[3], $itmsk[3]) = explode(",", $stitemlist[$index]);
} while (!$itmk[3]);
do {
$index = rand(1, count($stitemlist) - 1);
list($itm[4], $itmk[4], $itme[4], $itms[4], $itmsk[4]) = explode(",", $stitemlist[$index]);
} while (!$itmk[4] || $itmk[3] == $itmk[4]);
if (strpos($wepk, 'WG') === 0) {
$itm[3] = '手枪子弹';
$itmk[3] = 'GB';
$itme[3] = 1;
$itms[3] = 12;
$itmsk[3] = '';
}
示例14: fread
$afname = $_FILES['addfile']['name'];
$aftmp = $_FILES['addfile']['tmp_name'];
$showsucc = (int)$_POST['showsucc'];
$showfail = (int)$_POST['showfail'];
if ($afname && is_uploaded_file($aftmp)) {
// it's a file upload, so read it
$fp = @fopen($aftmp, 'r');
if ($fp === false) die ('Uploaded file could not be opened.');
$add = fread($fp, filesize ($aftmp)); // just replace existing add value
}
if ($add == '') $err = 'No addresses specified.';
if (!$err) {
$f = openfile($cfg['listfile']); // open list
$existing = array();
$succ = array();
$fail = array(); $done = false; $i = 0;
while ($item = readitem($f)) $existing[$item['addr']] = true; // read existing addresses
if (!$parse) {
// we're doing CSV-style parsing
$adds = explode($sep, $add); // split into addresses
foreach ($adds as $email) {
$email = fixemail($email);
if ($email == '') continue;
// check address is not already in list
if (isset($existing[$email])) {
$fail[$i]['addr'] = htmlspecialchars($email);
$fail[$i]['reason'] = 'Already in list';
}
示例15: str_repeat
echo str_repeat(" ", 1024);
echo '<script language="javascript">
$z=setInterval(function() { window.scroll(0,document.body.scrollHeight); },100);
function stop() { window.scroll(0,document.body.scrollHeight); clearInterval($z); }</script>
<body onload=stop(); ></body>';
echo '<br><font size=4 color="red">请务必阅读以下运行日志,确定没有错误。</font><br><br>';
ob_end_flush();
flush();
if ($___MOD_CODE_ADV1) {
echo '<font color="blue">正在进行代码预处理CODE_ADV1..</font><br>';
ob_end_flush();
flush();
global $___TEMP_DRY_RUN, $___TEMP_DRY_RUN_COUNTER;
$___TEMP_DRY_RUN = 0;
$file = GAME_ROOT . './gamedata/modules.list.pass.php';
$content = openfile($file);
$in = sizeof($content);
$___TEMP_MOD_LIST_n = 0;
for ($i = 0; $i < $in; $i++) {
list($modname, $modpath, $inuse) = explode(',', $content[$i]);
if ($inuse == 1) {
$___TEMP_MOD_LIST_n++;
$___TEMP_MOD_LOAD_CMD[$___TEMP_MOD_LIST_n] = GAME_ROOT . './include/modules/' . $modpath . 'module.inc.php';
$___TEMP_MOD_LOAD_NAME[$___TEMP_MOD_LIST_n] = $modname;
$___TEMP_MOD_LOAD_PATH[$___TEMP_MOD_LIST_n] = $modpath;
}
unset($modname);
unset($modepath);
unset($inuse);
}
unset($i);