function doUploadNewSplash($p) { $extend = get_extend($p["name"]); $filename = "file_" . date("YYmmddhhiiss") . "." . $extend; move_uploaded_file($p["tmp_name"], "../splash/" . $filename); $db = openConnection(); $sql = "update root_tools_splash set filename='{$filename}' where id=0"; $result = query($db, $sql); closeConnection($db); return $result; }
function doAddRecommand($n, $jm, $ju, $jt, $img, $qr) { $extend = get_extend($img["name"]); if ($extend === "") { return "0"; } $filename = "file_" . date("YYmmddhhiiss") . "." . $extend; move_uploaded_file($img["tmp_name"], "./recommand/" . $filename); $qr_extend = get_extend($qr["name"]); $qr_filename = ""; if ($qr_extend != "") { $qr_filename = "qr_" . date("YYmmddhhiiss") . "." . $qr_extend; move_uploaded_file($qr["tmp_name"], "./recommand/" . $qr_filename); } $id = generateId("yugioh_recommand", "id"); $sql = "insert into yugioh_recommand (id,name,jump_mode,jump_url,jump_text,image_name,big_qr) values ({$id},'{$n}',{$jm},'{$ju}','{$jt}','{$filename}','{$qr_filename}')"; $db = openConnection(); $result = query($db, $sql); closeConnection($db); return $result; }
$filemtime = filemtime($k); if ($filemtime && $filemtime > $last_modified_time) { $last_modified_time = $filemtime; } } } // 检查请求头的if-modified-since,判断是否304 if (isset($request_headers['If-Modified-Since']) && strtotime($request_headers['If-Modified-Since']) == $last_modified_time) { // 如果客户端带有缓存 header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $last_modified_time . ' GMT'), true, 304); exit; } // 拼接文件,并应用通用规则 foreach ($a_files as $k) { if (empty($type)) { $type = get_extend($k); } //文件存在 if (file_exists($k)) { $R_files[] = file_get_contents($k); } else { //文件不存在 try { //php4不支持try catch,如果基于php4的话,删掉try catch语句 $R_files[] = '/***** http://a.tbcdn.cn/' . $k . ' *****/'; $R_files[] = join('', file($CDN . $k)); //$R_files[] = join('', get_contents($CDN.$k)); //如果apache不支持file抓取远程文件,打开这个注释,然后注释掉上一句 } catch (Exception $e) { } } }
<?php if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) { exit('Access Denied'); } $dir = DISCUZ_ROOT . './source/plugin/yinxingfei_zzza/extend/'; showtableheader(); showtagheader('tbody class="psetting"', '', true); showtitle('未安装的扩展'); $extend = get_extend($dir); $extend = array_filter($extend); foreach ($extend as $key => $value) { if ($value['name']) { showtablerow('class="hover hover yincang_' . $value['identifier'] . '" style="overflow: hidden;"', array(), array(' <div style="float:left;width:20%;padding-bottom: 10px;"> <p><span class="bold">' . $value['name'] . '</span></p> <p><span class="sml"></span></p> </div> <div style="float:left;width:80%;padding-bottom: 10px;"> <p>说明:' . $value['description'] . '</p> <p style="overflow: hidden;"> <div style="float:left;width:50%;">版本:' . $value['version'] . '<em style="color:#ddd;padding: 0px 5px;">|</em>作者:' . $value['copyright'] . '<em style="color:#ddd;padding: 0px 5px;">|</em>类型:' . $value['type'] . '<em style="color:#ddd;padding: 0px 5px;">|</em>文件夹:' . $value['identifier'] . '</div> <div style="text-align: right;float:right;width:50%;"> <a href="' . ADMINSCRIPT . '?action=plugins&operation=config&identifier=yinxingfei_zzza&pmod=extend&caozuo=anzhuang&file=' . $value['file'] . '">安装</a> </div> </p> </div> ')); } } showtagfooter('tbody');