private static function getViewHtml() { if (!file_exists(self::getView())) { throw new Exception("Could not find the view " . self::$view); //return; } return fileRead(kEvent::getView(), false); }
function gobad($w) { global $tsMySqlCache; $code = fileRead('data/plugins_pubs_gobad.php'); if ($code == '') { $code = $tsMySqlCache->get('plugins_pubs_gobad'); } echo stripslashes($code[$w]); }
function gonggao() { global $tsMySqlCache; $strGonggao = fileRead('data/plugins_pubs_gogngao.php'); if ($strGonggao == '') { $strGonggao = $tsMySqlCache->get('plugins_pubs_gonggao'); } echo '<div class="gonggao">公告:<a target="_blank" href="' . $strGonggao['url'] . '">' . $strGonggao['title'] . '</a></div>'; }
private function readFromFile($filename) { if (file_exists($filename)) { // $content = file_get_contents($filename); $content = fileRead($filename); return unserialize($content); } else { return false; } }
function feedback_html() { global $tsMySqlCache; $code = fileRead('data/plugins_pubs_feedback.php'); if ($code == '') { $code = $tsMySqlCache->get('plugins_pubs_feedback'); } echo '<div class="feedback-box"> ' . stripslashes($code) . ' </div>'; }
function navs_html() { global $tsMySqlCache; $arrNav = fileRead('data/plugins_pubs_navs.php'); if ($arrNav == '') { $arrNav = $tsMySqlCache->get('plugins_pubs_navs'); } foreach ($arrNav as $item) { echo '<li class="mainlevel"><a href="' . $item['navurl'] . '">' . $item['navname'] . '</a></li>'; } }
function counter_html() { global $tsMySqlCache; $code = fileRead('data/plugins_pubs_counter.php'); if ($code == '') { $code = $tsMySqlCache->get('plugins_pubs_counter'); } $code = stripslashes($code); echo '<div style="display:none;">'; echo $code; echo '</div>'; }
function postMail($sendmail, $subject, $content) { global $TS_SITE, $tsMySqlCache; $options = fileRead('data/mail_options.php'); if ($options == '') { $options = $tsMySqlCache->get('mail_options'); } date_default_timezone_set('Asia/Shanghai'); require_once 'PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer(); //邮件配置 $mail->CharSet = "UTF-8"; $mail->IsSMTP(); //Enable SMTP debugging // 0 = off (for production use) // 1 = client messages // 2 = client and server messages $mail->SMTPDebug = 0; $mail->Debugoutput = 'html'; if ($options['ssl']) { $mail->SMTPSecure = 'ssl'; } $mail->SMTPAuth = true; $mail->Host = $options['mailhost']; $mail->Port = $options['mailport']; $mail->Username = $options['mailuser']; $mail->Password = $options['mailpwd']; //POST过来的信息 $frommail = $options['mailuser']; $fromname = $TS_SITE['site_title']; $replymail = $options['mailuser']; $replyname = $TS_SITE['site_title']; $sendname = ''; if (empty($frommail) || empty($subject) || empty($content) || empty($sendmail)) { return '0'; } else { //邮件发送 $mail->SetFrom($frommail, $fromname); $mail->AddReplyTo($replymail, $replyname); $mail->Subject = $subject; $mail->AltBody = "要查看邮件,请使用HTML兼容的电子邮件阅读器!"; //$mail->MsgHTML(eregi_replace("[\]",'',$content)); $mail->MsgHTML(strtr($content, '[\\]', '')); $mail->AddAddress($sendmail, $sendname); $mail->send(); return '1'; } }
function links_html() { global $tsMySqlCache; $arrLink = fileRead('data/plugins_home_links.php'); if ($arrLink == '') { $arrLink = $tsMySqlCache->get('plugins_home_links'); } echo '<div class="clear"></div>'; echo '<div class="panel panel-default">'; echo '<div class="panel-heading">友情链接</div>'; echo '<div class="panel-body links">'; foreach ($arrLink as $item) { echo '<a class="btn btn-link" target="_blank" href="' . $item['linkurl'] . '">' . $item['linkname'] . '</a> '; } echo '</div></div>'; }
function links_html() { global $tsMySqlCache; $arrLink = fileRead('data/plugins_home_links.php'); if ($arrLink == '') { $arrLink = $tsMySqlCache->get('plugins_home_links'); } echo '<div class="clear"></div>'; echo '<div class="bs"><div class="bbox">'; echo '<div class="btitle">合作夥伴</div>'; echo '<div class="bc links">'; foreach ($arrLink as $item) { echo '<a target="_blank" href="' . $item['linkurl'] . '">' . $item['linkname'] . '</a> '; } echo '</div></div></div>'; }
function wordad() { global $tsMySqlCache; echo '<style> .wordad{ overflow:hidden;background: none repeat scroll 0 0 #EAEAEA;border: 1px solid #DDDDDD;margin-bottom: 10px;overflow: hidden;padding:5px;} .wordad ul{} .wordad ul li{width:225px;float:left;margin:2px 5px;} </style>'; $arrData = fileRead('data/plugins_pubs_wordad.php'); if ($arrData == '') { $arrData = $tsMySqlCache->get('plugins_pubs_wordad'); } echo '<div class="wordad"><ul>'; foreach ($arrData as $key => $item) { echo '<li><a rel="nofollow" target="_blank" href="' . $item['url'] . '">' . $item['title'] . '</a></li>'; } echo '</ul><div class="clear"></div></div>'; }
public function __construct() { global $tsMySqlCache; $this->error = new ErrorCase(); //-------读取配置文件 //$incFileContents = file_get_contents(ROOT."comm/inc.php"); $arrQQ = fileRead('data/plugins_pubs_qq.php'); if ($arrQQ == '') { $arrQQ = $tsMySqlCache->get('plugins_pubs_qq'); } $callback = urlencode($arrQQ['siteurl'] . 'index.php?app=pubs&ac=plugin&plugin=qq&in=callback'); $incFileContents = '{"appid":"' . $arrQQ['appid'] . '","appkey":"' . $arrQQ['appkey'] . '","callback":"' . $callback . '","scope":"get_user_info,add_share,list_album,add_album,upload_pic,add_topic,add_one_blog,add_weibo,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idolist,add_idol,del_idol,get_tenpay_addr","errorReport":true,"storageType":"file","host":"localhost","user":"******","password":"******","database":"test"}'; $this->inc = json_decode($incFileContents); if (empty($this->inc)) { $this->error->showError("20001"); } if (empty($_SESSION['QC_userData'])) { self::$data = array(); } else { self::$data = $_SESSION['QC_userData']; } }
public function getRole($score) { global $tsMySqlCache; $arrRole = fileRead('data/user_role.php'); if ($arrRole == '') { $arrRole = $tsMySqlCache->get('user_role'); } foreach ($arrRole as $key => $item) { if ($score > $item['score_start'] && $score <= $item['score_end'] || $score > $item['score_start'] && $item['score_end'] == 0 || $score >= 0 && $score <= $item['score_end']) { return $item['rolename']; } } }
$savePos8 = $_POST['savePos8']; $aaPos8 = $_POST['aaPos8']; $saveOutput = $_POST['saveOutput']; $saveOutputAm = $_POST['saveOutputAm']; $Active = fileRead("Data/Active.illuminati"); if (!($newRecipe == NULL)) { folderCreate("Data/" . $newRecipe . ""); fileCreate("Data/" . $newRecipe . "/ItemID.illuminati"); fileCreate("Data/" . $newRecipe . "/ItemAm.illuminati"); fileCreate("Data/" . $newRecipe . "/case.illuminati"); fileCreate("Data/" . $newRecipe . "/if.illuminati"); } if (!($loadRecipe == NULL)) { fileRewrite("Data/Active.illuminati", $loadRecipe); } $caseoutput = fileRead("Data/" . $Active . "/case.illuminati"); //Yeah, looks stupid, right? //Going to fix it, so I dont get headaches, figuring out why did I do that :D if (!($savePos0 == NULL) && !($aaPos0 == NULL)) { if ($aaPos0 == 0) { fileAppend("Data/" . $Active . "/if.illuminati", "craftSlotId3[0] == " . $savePos0 . ""); fileRewrite("Data/" . $Active . "/case.illuminati", $caseoutput + $savePos0); } else { fileAppend("Data/" . $Active . "/if.illuminati", " && craftSlotId3[0] == " . $savePos0 . ""); fileRewrite("Data/" . $Active . "/case.illuminati", $caseoutput + $savePos0); } } if (!($savePos1 == NULL) && !($aaPos1 == NULL)) { if ($aaPos1 == 0) { fileAppend("Data/" . $Active . "/if.illuminati", "craftSlotId3[1] == " . $savePos1 . ""); fileRewrite("Data/" . $Active . "/case.illuminati", $caseoutput + $savePos1);
<?php defined('IN_TS') or die('Access Denied.'); $arrDouban = fileRead('data/plugins_pubs_douban.php'); if ($arrDouban == '') { $arrDouban = $tsMySqlCache->get('plugins_pubs_douban'); } define('KEY', $arrDouban['key']); define('SECRET', $arrDouban['secret']); define('REDIRECT', $TS_SITE['link_url'] . 'index.php?app=pubs&ac=plugin&plugin=douban&in=callback'); define('SCOPE', 'douban_basic_common,book_basic_r,book_basic_w'); define('STATE', 'Something');
* ini_set("error_reporting", E_ALL); * ini_set("display_errors", TRUE); * QQDEBUG = true 开启错误提示 * QQDEBUG = false 禁止错误提示 * 默认禁止错误信息 */ define("QQDEBUG", true); if (defined("QQDEBUG") && QQDEBUG) { //@ini_set("error_reporting", E_ALL); @ini_set("display_errors", TRUE); } /** * session */ include_once "session.php"; $arrQQ = fileRead('data/plugins_pubs_qq.php'); if ($arrQQ == '') { $arrQQ = $tsMySqlCache->get('plugins_pubs_qq'); } /** * 在你运行本demo之前请到 http://connect.opensns.qq.com/申请appid, appkey, 并注册callback地址 */ //申请到的appid //$_SESSION["appid"] = yourappid; $_SESSION["appid"] = $arrQQ['appid']; //申请到的appkey //$_SESSION["appkey"] = "yourappkey"; $_SESSION["appkey"] = $arrQQ['appkey']; //QQ登录成功后跳转的地址,请确保地址真实可用,否则会导致登录失败。 //$_SESSION["callback"] = "http://your domain/oauth/get_access_token.php"; $_SESSION["callback"] = $arrQQ['siteurl'] . "index.php?app=pubs&ac=plugin&plugin=qq&in=callback";
public function readTagsById($id) { $f = $this->dir . '/' . $id . '.tags'; if (file_exists($f)) { $cont = fileRead($f); if ($cont === false) { throw new DBException(); } $res = unserialize($cont); if ($res === false) { throw new DBException(); } return $res; } else { return false; } }
$new['group']->create('group_user', array('userid' => $iuserid, 'groupid' => $groupid, 'addtime' => time())); //计算小组会员数 $count_user = $new['group']->findCount('group_user', array('groupid' => $groupid)); //更新小组成员统计 $new['group']->update('group', array('groupid' => $groupid), array('count_user' => $count_user)); //发送系统消息开始 $msg_userid = '0'; $msg_touserid = $iuserid; $msg_content = '你被邀请加入一个小组,快去看看吧<br />' . tsUrl('group', 'show', array('id' => $groupid)); aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content); //发送系统消息end header('Location: ' . tsUrl('group', 'show', array('id' => $groupid))); } else { tsNotice('倒霉了吧?'); } break; //usertips //usertips case "usertips": $data = fileRead('data/user_tips.php'); if ($data == '') { $query = $db->fetch_all_assoc("select * from " . dbprefix . "user_info"); foreach ($query as $user) { $usertip[] = array('user' => $user['username'], 'name' => $user['userid']); } fileWrite('user_tips.php', 'data', json_encode($usertip)); $data = fileRead('data/user_tips.php'); } echo $data; break; }
/** * 辅助APP二级域名 */ function reurlsubdomain() { global $tsMySqlCache; $options = fileRead('data/system_options.php'); if ($options == '') { $options = $tsMySqlCache->get('system_options'); } $scriptName = explode('index.php', $_SERVER['SCRIPT_NAME']); $rurl = substr($_SERVER['REQUEST_URI'], strlen($scriptName[0])); if (strpos($rurl, '?') == false) { if (preg_match('/index.php/i', $rurl)) { $rurl = str_replace('index.php', '', $rurl); $rurl = substr($rurl, 1); $params = $rurl; } else { $params = $rurl; } if ($rurl) { if ($options['site_urltype'] == 3) { // http://group.thinksaas.cn/topic-id-1.html $params = explode('.', $params); $params = explode('-', $params[0]); foreach ($params as $p => $v) { switch ($p) { case 0: $_GET['ac'] = $v; break; default: if ($v) { $kv[] = $v; } break; } } $ck = count($kv) / 2; if ($ck >= 2) { $arrKv = array_chunk($kv, $ck); foreach ($arrKv as $key => $item) { $_GET[$item[0]] = $item[1]; } } elseif ($ck == 1) { $_GET[$kv[0]] = $kv[1]; } else { } } elseif ($options['site_urltype'] == 4) { // http://group.thinksaas.cn/topic/id-1 $params = explode('/', $params); foreach ($params as $p => $v) { switch ($p) { case 0: $_GET['ac'] = $v; break; default: $kv = explode('-', $v); if (count($kv) > 1) { $_GET[$kv[0]] = $kv[1]; } else { $_GET['params' . $p] = $kv[0]; } break; } } } elseif ($options['site_urltype'] == 5) { // http://group.thinksaas.cn/topic/1 $params = explode('/', $params); foreach ($params as $p => $v) { switch ($p) { case 0: $_GET['ac'] = $v; if (empty($_GET['ac'])) { $_GET['ac'] = 'index'; } break; case 1: if ((int) $v > 0) { $_GET['id'] = $v; break; } default: $_GET[$v] = $params[$p + 1]; break; } } } elseif ($options['site_urltype'] == 6) { // http://group.thinksaas.cn/topic/id/1 $params = explode('/', $params); foreach ($params as $p => $v) { switch ($p) { case 0: $_GET['ac'] = $v; break; default: $_GET[$v] = $params[$p + 1]; break; } } } elseif ($options['site_urltype'] == 7) { // http://group.thinksaas.cn/topic/1/ $params = explode('/', $params); foreach ($params as $p => $v) { switch ($p) { case 0: $_GET['ac'] = $v; if (empty($_GET['ac'])) { $_GET['ac'] = 'index'; } break; case 1: if ((int) $v > 0) { $_GET['id'] = $v; break; } default: $_GET[$v] = $params[$p + 1]; break; } } } else { $params = explode('/', $params); foreach ($params as $p => $v) { switch ($p) { case 0: $_GET['ac'] = $v; break; default: $kv = explode('-', $v); if (count($kv) > 1) { $_GET[$kv[0]] = $kv[1]; } else { $_GET['params' . $p] = $kv[0]; } break; } } } } } }
<?php defined('IN_TS') or die('Access Denied.'); //插件编辑 switch ($ts) { //编辑 case "set": $arrData = fileRead('data/plugins_pubs_wordad.php'); if ($arrData == '') { $arrData = $tsMySqlCache->get('plugins_pubs_wordad'); } include 'edit.html'; break; //执行编辑 //执行编辑 case "do": $arrTitle = $_POST['title']; $arrUrl = $_POST['url']; foreach ($arrTitle as $key => $item) { $title = trim($item); $url = trim($arrUrl[$key]); if ($title && $url) { $arrData[] = array('title' => $title, 'url' => $url); } } fileWrite('plugins_pubs_wordad.php', 'data', $arrData); $tsMySqlCache->set('plugins_pubs_wordad', $arrData); header('Location: ' . SITE_URL . 'index.php?app=pubs&ac=plugin&plugin=wordad&in=edit&ts=set'); break; }
$arrPlugin[$key]['about'] = (require_once 'plugins/' . $apps . '/' . $item . '/about.php'); } } $app_plugins = fileRead('data/' . $apps . '_plugins.php'); if ($app_plugins == '') { $app_plugins = $tsMySqlCache->get($apps . '_plugins'); } include template("plugin_list"); break; //插件停启用 //插件停启用 case "do": $apps = tsFilter($_GET['apps']); $isused = intval($_GET['isused']); $pname = tsFilter($_GET['pname']); $app_plugins = fileRead('data/' . $apps . '_plugins.php'); if ($app_plugins == '') { $app_plugins = $tsMySqlCache->get($apps . '_plugins'); } //0停用1启用 if ($isused == '0') { $pkey = array_search($pname, $app_plugins); unset($app_plugins[$pkey]); fileWrite($apps . '_plugins.php', 'data', $app_plugins); $tsMySqlCache->set($apps . '_plugins', $app_plugins); qiMsg("插件停用成功!"); } elseif ($isused == '1') { array_push($app_plugins, $pname); if (file_exists('plugins/' . $apps . '/' . $pname . '/install.sql')) { $sql = file_get_contents('plugins/' . $apps . '/' . $pname . '/install.sql'); $sql = str_replace('ts_', '' . dbprefix . '', $sql);
<?php defined('IN_TS') or die('Access Denied.'); //插件编辑 switch ($ts) { case "set": $code = fileRead('data/plugins_pubs_gobad.php'); if ($code == '') { $code = $tsMySqlCache->get('plugins_pubs_gobad'); } include 'edit_set.html'; break; case "do": $code = $_POST['code']; fileWrite('plugins_pubs_gobad.php', 'data', $code); $tsMySqlCache->set('plugins_pubs_gobad', $code); header('Location: ' . SITE_URL . 'index.php?app=pubs&ac=plugin&plugin=gobad&in=edit&ts=set'); break; }
<?php defined('IN_TS') or die('Access Denied.'); //插件编辑 switch ($ts) { case "set": $arrNav = fileRead('data/plugins_pubs_navs.php'); if ($arrNav == '') { $arrNav = $tsMySqlCache->get('plugins_pubs_navs'); } include 'edit_set.html'; break; case "do": $arrNavName = $_POST['navname']; $arrNavUrl = $_POST['navurl']; foreach ($arrNavName as $key => $item) { $navname = trim($item); $navurl = trim($arrNavUrl[$key]); if ($navname && $navurl) { $arrNav[] = array('navname' => $navname, 'navurl' => $navurl); } } fileWrite('plugins_pubs_navs.php', 'data', $arrNav); $tsMySqlCache->set('plugins_pubs_navs', $arrNav); header('Location: ' . SITE_URL . 'index.php?app=pubs&ac=plugin&plugin=navs&in=edit&ts=set'); break; }
<?php defined('IN_TS') or die('Access Denied.'); //插件编辑 switch ($ts) { case "set": $code = fileRead('data/plugins_pubs_feedback.php'); if ($code == '') { $code = $tsMySqlCache->get('plugins_pubs_feedback'); } $code = stripslashes($code); include 'edit_set.html'; break; case "do": $code = trim($_POST['code']); fileWrite('plugins_pubs_feedback.php', 'data', $code); $tsMySqlCache->set('plugins_pubs_feedback', $code); header('Location: ' . SITE_URL . 'index.php?app=pubs&ac=plugin&plugin=feedback&in=edit&ts=set'); break; }
<?php defined('IN_TS') or die('Access Denied.'); switch ($ts) { case "set": $arrData = fileRead('data/plugins_pubs_weibo.php'); if ($arrData == '') { $arrData = $tsMySqlCache->get('plugins_pubs_weibo'); } include 'html/edit.html'; break; case "do": $wb_akey = trim($_POST['wb_akey']); $wb_skey = trim($_POST['wb_skey']); $siteurl = $_POST['siteurl']; $arrData = array('wb_akey' => $wb_akey, 'wb_skey' => $wb_skey, 'siteurl' => $siteurl); fileWrite('plugins_pubs_weibo.php', 'data', $arrData); $tsMySqlCache->set('plugins_pubs_weibo'); header('Location: ' . SITE_URL . 'index.php?app=pubs&ac=plugin&plugin=weibo&in=edit&ts=set'); break; }
<?php defined('IN_TS') or die('Access Denied.'); //读取数据 $arr_weibvo = fileRead('data/plugins_pubs_weibo.php'); if ($arr_weibvo == '') { $arr_weibvo = $tsMySqlCache->get('plugins_pubs_weibo'); } define("WB_AKEY", $arr_weibvo['wb_akey']); define("WB_SKEY", $arr_weibvo['wb_skey']); define("WB_CALLBACK_URL", $arr_weibvo['siteurl'] . "index.php?app=pubs&ac=plugin&plugin=weibo&in=callback");
.ItemAm:hover { opacity: 1.0; } </style> </head> <body> <?php include "Include/FileFuncs.php"; include "Include/FolderFuncs.php"; include "HandleRequests.php"; $Active = fileRead("Data/Active.illuminati"); $aIf = fileRead("Data/" . $Active . "/if.illuminati"); $aCase = fileRead("Data/" . $Active . "/case.illuminati"); $ItemID = fileRead("Data/" . $Active . "/ItemID.illuminati"); $ItemAm = fileRead("Data/" . $Active . "/ItemAm.illuminati"); echo "<a href='?request=666' class='ahv'>New recipe</a> | <a href='?request=616' class='ahv'>Load recipe</a> | <a href='?request=BlockItemIDs' target='_blank' class='ahv'>Blocks & Items</a>"; echo " <b class='right'>Recipe: " . $Active . "</b>"; //echo "<a href='' class='right'>← Go back</a> "; echo "<div class='line1'></div>"; echo "<div class='almostEverything'>"; echo "<center>"; echo "<br /><h1>RECIPE CODE GENERATOR</h1>"; switch ($_REQUEST['request']) { case 666: include "CallRequests/666.php"; break; case 616: include "CallRequests/616.php"; break; case 10:
<?php defined('IN_TS') or die('Access Denied.'); //插件编辑 switch ($ts) { case "set": $strGonggao = fileRead('data/plugins_pubs_gonggao.php'); if ($strGonggao == '') { $strGonggao = $tsMySqlCache->get('plugins_pubs_gonggao'); } include 'edit_set.html'; break; case "do": $title = trim($_POST['title']); $url = trim($_POST['url']); $arrData = array('title' => $title, 'url' => $url); fileWrite('plugins_pubs_gonggao.php', 'data', $arrData); $tsMySqlCache->set('plugins_pubs_gonggao', $arrData); header('Location: ' . SITE_URL . 'index.php?app=pubs&ac=plugin&plugin=gonggao&in=edit&ts=set'); break; }
$tsHooks = array(); if ($TS_URL['app'] != 'system' && $TS_URL['app'] != 'pubs') { //加载公用插件 $public_plugins = fileRead('data/pubs_plugins.php'); if ($public_plugins == '') { $public_plugins = $tsMySqlCache->get('pubs_plugins'); } if ($public_plugins && is_array($public_plugins)) { foreach ($public_plugins as $item) { if (is_file('plugins/pubs/' . $item . '/' . $item . '.php')) { include 'plugins/pubs/' . $item . '/' . $item . '.php'; } } } //加载APP插件 $active_plugins = fileRead('data/' . $TS_URL['app'] . '_plugins.php'); if ($active_plugins == '') { $active_plugins = $tsMySqlCache->get($TS_URL['app'] . '_plugins'); } if ($active_plugins && is_array($active_plugins)) { foreach ($active_plugins as $item) { if (is_file('plugins/' . $TS_URL['app'] . '/' . $item . '/' . $item . '.php')) { include 'plugins/' . $TS_URL['app'] . '/' . $item . '/' . $item . '.php'; } } } } //运行统计结束 $time_end = getmicrotime(); $runTime = $time_end - $time_start; $TS_CF['runTime'] = number_format($runTime, 6);
<?php defined('IN_TS') or die('Access Denied.'); //插件编辑 switch ($ts) { case "set": $arrLink = fileRead('data/plugins_home_links.php'); if ($arrLink == '') { $arrLink = $tsMySqlCache->get('plugins_home_links'); } include 'edit_set.html'; break; case "do": $arrLinkName = $_POST['linkname']; $arrLinkUrl = $_POST['linkurl']; foreach ($arrLinkName as $key => $item) { $linkname = trim($item); $linkurl = trim($arrLinkUrl[$key]); if ($linkname && $linkurl) { $arrLink[] = array('linkname' => $linkname, 'linkurl' => $linkurl); } } fileWrite('plugins_home_links.php', 'data', $arrLink); $tsMySqlCache->set('plugins_home_links', $arrLink); header('Location: ' . SITE_URL . 'index.php?app=home&ac=plugin&plugin=links&in=edit&ts=set'); break; }