本文整理汇总了PHP中openfile函数的典型用法代码示例。如果您正苦于以下问题:PHP openfile函数的具体用法?PHP openfile怎么用?PHP openfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了openfile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:25,代码来源:getonlineuser.php
示例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);
}
}
开发者ID:DTS-China,项目名称:dts,代码行数:30,代码来源:main.php
示例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();
}
开发者ID:hikawiier,项目名称:dtsmod-campfire,代码行数:35,代码来源:main.php
示例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>";
}
开发者ID:winddramon,项目名称:dts,代码行数:29,代码来源:main.php
示例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);
}
开发者ID:winddramon,项目名称:dts,代码行数:59,代码来源:main.php
示例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;
}
开发者ID:nahakyuu,项目名称:dts,代码行数:10,代码来源:main.php
示例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();
}
开发者ID:BGCX261,项目名称:zhwphp-svn-to-git,代码行数:11,代码来源:BizmForm.class.php
示例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();
}
}
开发者ID:winddramon,项目名称:dts,代码行数:14,代码来源:main.php
示例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;
}
}
开发者ID:jonycookie,项目名称:projectm2,代码行数:16,代码来源:cache.class.php
示例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);
}
开发者ID:noshbar,项目名称:SimpleAjaxChat,代码行数:16,代码来源:file.php
示例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);
}
}
}
开发者ID:nahakyuu,项目名称:dts,代码行数:38,代码来源:main.php
示例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>
开发者ID:abapat,项目名称:Tweemo-PHP,代码行数:31,代码来源:graph.php
示例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] = '';
}
开发者ID:jiangtiandao,项目名称:phpdts,代码行数:31,代码来源:valid.php
示例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';
}
开发者ID:sempretaniec,项目名称:sempretaniec.github.io,代码行数:31,代码来源:admin_newsub.inc.php
示例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);
开发者ID:winddramon,项目名称:dts,代码行数:31,代码来源:modulemng_activate.php
示例16: fish
function fish($uid, $cate, $money)
{
global $db, $timestamp, $tddays;
$time = get_date($timestamp, 'Y-m-d A:H:i:s');
$club_list = openfile(D_P . "data/bbscache/fish/fishlog{$tddays}.php");
$num = count($club_list);
for ($r = 0; $r < $num; $r++) {
$detail = explode("|", $club_list[$r]);
if (trim($detail[0]) == $uid) {
unset($club_list[$r]);
$ichack = 1;
} else {
$ichack = 1;
}
}
$club_list = implode("", $club_list);
@writeover(D_P . "data/bbscache/fish/fishlog{$tddays}.php", $club_list, w);
if ($ichack == 1) {
$club_list = file(D_P . "data/bbscache/fish/fishlog{$tddays}.php");
$num = count($club_list) - 1;
$club_list = "{$uid}|{$time}|{$cate}|{$money}\r\n";
@writeover(D_P . "data/bbscache/fish/fishlog{$tddays}.php", $club_list, "a");
}
}
开发者ID:adi00,项目名称:wumaproject,代码行数:24,代码来源:job.php
示例17: runquery
<div class="btn"><div class="btn_right"><a hidefocus="true" href="../">进入首页</a></div></div>
<div class="btn"><div class="btn_right"><a hidefocus="true" href="../sysadmin/login.php">直接进入管理后台</a></div></div>
</div>
<?php
}
?>
</form>
<div class="clear"></div>
</div>
<div class="bottom"></div>
</div>
<strong>Powered by iweb_sns V1.0 © 2010 </strong>
<br /><br />
<?php
if ($step == '3' && $creatable) {
runquery(openfile($installSQL), $tablePreStr);
?>
<script type="text/javascript">showMsg('');showMsg('共创建了<?php
echo $tablenum;
?>
个数据表.');</script>
<script type="text/javascript">$('createTables').disabled = '';$('createTables').value = '完 成';$('createTables').style.color = '#4e4e4e';$('createTables').style.cursor = 'pointer';</script>
<?php
$sql = "INSERT INTO isns_admin(`admin_name`,`admin_password`,`admin_group`,`active_time`,`is_pass`) VALUES('{$admin}','" . md5($password) . "','superadmin',NOW(),1)";
$sql = str_replace('isns_', $tablePreStr, $sql);
if (!$db->query($sql)) {
echo '创建后台管理员失败!';
exit;
}
}
?>
开发者ID:omusico,项目名称:Social,代码行数:31,代码来源:index.php
示例18: get_item_place
function get_item_place($which)
{
global $plsinfo, $gamecfg;
//获取某物品的获取方式,如刷新地点或商店是否有卖等
$result = "";
$file = config('mapitem', $gamecfg);
$itemlist = openfile($file);
$in = sizeof($itemlist);
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 ($iname == $which) {
if ($iarea == 99) {
$result .= "每禁";
} else {
$result .= "{$iarea}禁";
}
if ($imap == 99) {
$result .= "全图随机";
} else {
$result .= "于{$plsinfo[$imap]}";
}
$result .= "刷新{$inum}个 ";
}
}
}
$file = config('shopitem', $gamecfg);
$shoplist = openfile($file);
foreach ($shoplist as $lst) {
if (!empty($lst) && strpos($lst, ',') !== false) {
list($kind, $num, $price, $area, $item) = explode(',', $lst);
if ($item == $which) {
$result .= "{$area}禁起在商店中出售({$price}元) ";
}
}
}
include_once config('mixitem', $gamecfg);
global $mixinfo;
foreach ($mixinfo as $lst) {
if ($lst['result'][0] == $which || $lst['result'][0] == $which . ' ') {
$result .= "通过合成获取 ";
break;
}
}
$file = config('synitem', $gamecfg);
$synlist = openfile($file);
foreach ($synlist as $lst) {
if (!empty($lst) && strpos($lst, ',') !== false) {
list($item, $kind) = explode(',', $lst);
if ($item == $which) {
$result .= "通过同调合成获取 ";
break;
}
}
}
$file = config('overlay', $gamecfg);
$ovllist = openfile($file);
foreach ($ovllist as $lst) {
if (!empty($lst) && strpos($lst, ',') !== false) {
list($item, $kind) = explode(',', $lst);
if ($item == $which) {
$result .= "通过超量合成获取 ";
break;
}
}
}
$file = config('present', $gamecfg);
$prslist = openfile($file);
foreach ($prslist as $lst) {
if (!empty($lst) && strpos($lst, ',') !== false) {
list($item, $kind) = explode(',', $lst);
if ($item == $which) {
$result .= "打开礼品盒时有概率获得 ";
break;
}
}
}
$file = config('box', $gamecfg);
$boxlist = openfile($file);
foreach ($boxlist as $lst) {
if (!empty($lst) && strpos($lst, ',') !== false) {
list($item, $kind) = explode(',', $lst);
if ($item == $which) {
$result .= "打开游戏王卡包时有概率获得 ";
break;
}
}
}
if ($which == "悲叹之种") {
$result .= "通过使用『灵魂宝石』强化物品失败获得 ";
}
return $result;
}
开发者ID:jiangtiandao,项目名称:phpdts,代码行数:93,代码来源:itemplace.func.php
示例19: itemmix
function itemmix($mlist, $itemselect = -1)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'player', 'logger', 'itemmix'));
$sks_count = 0;
$sum_star = 0;
$mixitem = array();
foreach ($mlist as $val) {
$mitm = ${'itm' . $val};
foreach (array('/锋利的/', '/电气/', '/毒性/', '/-改$/') as $value) {
$mitm = preg_replace($value, '', $mitm);
}
$mitm = str_replace('钉棍棒', '棍棒', $mitm);
$mixitem[] = $mitm;
$z = ${'itmk' . $val};
$star = 0;
for ($i = 0; $i < strlen($z); $i++) {
if ('0' <= $z[$i] && $z[$i] <= '9') {
$star = $star * 10 + (int) $z[$i];
}
}
if ($star == 0) {
return $chprocess($mlist, $itemselect);
}
//所有道具都有星数
$sum_star += $star;
if (strpos(${'itmsk' . $val}, 's') !== false) {
$sks_count++;
}
}
//恰有一个调整属性
if ($sks_count != 1) {
return $chprocess($mlist, $itemselect);
}
$file = __DIR__ . '/config/sync.config.php';
$slist = openfile($file);
$num = count($slist);
$sync = -1;
$syncn = $synck = $synce = $syncs = $syncsk = array();
for ($i = 0; $i < $num; $i++) {
$t = explode(',', $slist[$i]);
$tn = $t[0];
$tk = $t[1];
$te = $t[2];
$ts = $t[3];
$tsk = $t[4];
$tstar = $t[5];
$treq = $t[6];
//检查星数是否符合
if ($sum_star != $tstar) {
continue;
}
//检查是否满足了要求的合成来源
$lis = explode('+', $treq);
$flag = 1;
foreach ($lis as $key) {
if ($key != '') {
if (!in_array($key, $mixitem)) {
$flag = 0;
break;
}
}
}
if (!$flag) {
continue;
}
$sync++;
$syncn[$sync] = $tn;
$synck[$sync] = $tk;
$synce[$sync] = $te;
$syncs[$sync] = $ts;
$syncsk[$sync] = $tsk;
}
//无满足条件的同调结果,失败
if ($sync == -1) {
return $chprocess($mlist, $itemselect);
}
if ($itemselect == -1) {
$mask = 0;
foreach ($mlist as $k) {
if (1 <= $k && $k <= 6) {
$mask |= 1 << (int) $k - 1;
}
}
$cmd .= '<input type="hidden" id="mode" name="mode" value="itemmain">';
$cmd .= '<input type="hidden" id="command" name="command" value="itemmix">';
$cmd .= '<input type="hidden" id="mixmask" name="mixmask" value="' . $mask . '">';
$cmd .= '<input type="hidden" id="itemselect" name="itemselect" value="999">';
$cmd .= "请选择同调结果<br><br>";
for ($i = 0; $i <= $sync; $i++) {
$tn = $syncn[$i];
$cmd .= "<input type=\"button\" class=\"cmdbutton\" style=\"width:200\" value=\"" . $tn . "\" onclick=\"\$('itemselect').value='" . $i . "';postCmd('gamecmd','command.php');this.disabled=true;\">";
}
$cmd .= "<input type=\"button\" class=\"cmdbutton\" style=\"width:200\" value=\"返回\" onclick=\"postCmd('gamecmd','command.php');this.disabled=true;\">";
return;
} else {
$i = (int) $itemselect;
if ($i < 0 || $i > $sync) {
//.........这里部分代码省略.........
开发者ID:winddramon,项目名称:dts,代码行数:101,代码来源:main.php
示例20: 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) {
//现在所有的礼物盒类道具都应该使用类别'p',依靠属性来判断究竟是什么礼物盒
//每个属性对应的文件名
$p_arr = array('^999^' => 'present', '^998^' => 'ygobox', '^997^' => 'fybox', '^996^' => 'ugabox', '^995^' => 'ugcbox');
//这样写的问题就是,礼盒的属性里不能再有其他内容了,否则就会爆炸,保险起见加一个判定
$pi_flag = false;
foreach (array_keys($p_arr) as $p_sk) {
$isk = \itemmain\get_itmsk_array($itmsk);
if (in_array($p_sk, $isk) && sizeof($isk) == 1) {
$pi_flag = true;
}
}
if (!$pi_flag) {
$log .= "这个盒子看起来已经坏掉了,还是扔了吧。<br>";
return;
}
$p_path = '/config/' . $p_arr[$isk[0]] . '.config.php';
$log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
$file = __DIR__ . $p_path;
$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;
} elseif(strpos ( $itmk, 'GA' ) === 0){
$log.="你打开了<span class=\"yellow\">$itm</span>。<br>";
$file = __DIR__.'/config/ugabox.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, 'GC' ) === 0){
$log.="你打开了<span class=\"yellow\">$itm</span>。<br>";
$file = __DIR__.'/config/ugcbox.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);
}
开发者ID:hikawiier,项目名称:dtsmod-campfire,代码行数:90,代码来源:main.php
注:本文中的openfile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论