function ModulePage()
 {
     global $PIO;
     if (!isset($_GET['res'])) {
         if (!file_exists('./.userrepair') || isset($_GET['force'])) {
             touch('./.userrepair');
             $PIO->dbMaintanence('repair', $PIO->dbMaintanence('repair'));
             updatelog();
             // 重導向到靜態快取
             unlink('./.userrepair');
             header('HTTP/1.1 302 Moved Temporarily');
             header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
         } else {
             error('已經有其他人在修復中。<p>[<a href="' . $this->SELF . '&amp;force=1">強制執行</a>]</p>');
         }
     } else {
         if (!file_exists('./.userrepair') || isset($_GET['force'])) {
             touch('./.userrepair');
             $no = intval($_GET['res']);
             deleteCache(array($no));
             unlink('./.userrepair');
             header('HTTP/1.1 302 Moved Temporarily');
             header('Location: ' . fullURL() . PHP_SELF . '?res=' . $no);
         } else {
             error('已經有其他人在修復中。<p>[<a href="' . $this->SELF . '&amp;res=' . $_GET['res'] . '&amp;force=1">強制執行</a>]</p>');
         }
     }
 }
Example #2
0
 function mod_atom()
 {
     global $PMS;
     $this->FEED_COUNT = 10;
     // Feed 產生最大篇數
     $this->FEED_UPDATETYPE = 1;
     // Feed 更新時機 (1: 瀏覽 MODULEPAGE 時更新, 2: 有新文章貼出時更新)
     $this->FEED_DISPLAYTYPE = 'T';
     // 資料取出形式 (T: 討論串取向, P: 文章取向)
     $this->FEED_CACHEFILE = 'feed.atom';
     // 資料輸出暫存檔 (靜態快取Feed格式)
     $this->BASEDIR = fullURL();
     // 基底 URL
     switch ($this->FEED_UPDATETYPE) {
         case 1:
             // MODULEPAGE
             $PMS->hookModuleMethod('ModulePage', __CLASS__);
             // 註冊獨立頁面
             $this->SELF = $this->BASEDIR . $PMS->getModulePageURL(__CLASS__);
             // Feed 連結
             $this->FEED_STATUSFILE = __CLASS__ . '.tmp';
             // 資料狀態暫存檔 (檢查資料需不需要更新)
             break;
         case 2:
             // Update on RegistAfterCommit
             $this->SELF = $this->BASEDIR . $this->FEED_CACHEFILE;
             // Feed 連結
             break;
     }
 }
 function autoHookRegistBegin(&$name, &$email, &$sub, &$com, $upfileInfo, $accessInfo, $isReply)
 {
     $CSRFdetectd = false;
     /* 檢查 HTTP_REFERER (防止跨站 form)
      *  1. 無 HTTP_REFERER
      *  2. HTTP_REFERER 不是此網域
      */
     if (!isset($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], fullURL()) !== 0) {
         $CSRFdetectd = true;
     }
     if ($CSRFdetectd) {
         error('CSRF detected!');
     }
 }
Example #4
0
 public function __construct($PMS)
 {
     parent::__construct($PMS);
     $this->BASEDIR = fullURL();
     switch ($this->FEED_UPDATETYPE) {
         case 1:
             // MODULEPAGE
             $this->SELF = $this->BASEDIR . $this->getModulePageURL();
             $this->FEED_STATUSFILE = __CLASS__ . '.tmp';
             break;
         case 2:
             // Update on RegistAfterCommit
             $this->SELF = $this->BASEDIR . $this->FEED_CACHEFILE;
             break;
     }
 }
Example #5
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model(array('hentai_m'));
     $this->template->title($GLOBALS['global']['HOME_PAGE']['site_title'])->append_metadata(js('swf.js', 'hentai'))->append_metadata(js('hentai.js', 'hentai'));
     if ($GLOBALS['global']['HENTAI']['show'] != 1) {
         show_404();
     }
     if (isLogin()) {
         $currenturl = fullURL();
         if (false !== strpos($currenturl, '/hentai/category/')) {
             $redr = str_replace('/hentai/category/', '/user/hentai/', $currenturl);
             redirect($redr);
             die;
         }
         redirect('user/hentai');
         exit;
     }
 }
 function mod_typepad_antispam()
 {
     global $PMS;
     $this->THISPAGE = $PMS->getModulePageURL(__CLASS__);
     $PMS->hookModuleMethod('ModulePage', __CLASS__);
     // Register ModulePage
     // TypePad AntiSpam API key 輸入位置 (申請 http://antispam.typepad.com/info/get-api-key.html)
     $this->api_key = '1234567890ab';
     // 下列若無必要請勿修改
     # Index page location (http:// included)
     $this->blog = fullURL() . PHP_SELF2;
     # Base hostname for API requests (API key is always prepended to this)
     $this->service_host = 'api.antispam.typepad.com';
     $this->api_host = $this->api_key . '.' . $this->service_host;
     # Plugin version
     $this->plugin_ver = '1.0';
     # API Protocol version
     $this->protocol_ver = '1.1';
     # Port for API requests to service host
     $this->api_port = 80;
     # Spam count file
     $this->recordfile = 'mod_typepad_antispam.tmp';
 }
Example #7
0
<?php

session_start();
session_register("isLogined_session");
session_register("pwd_session");
//Settings here:
$sqlite_file = './myfav.sdb';
$FavPasswd = "Fav_pass";
$ViewPassword = "******";
$NewWin = true;
$shrinkFirst = true;
$TextboxWidth = 50;
$homeTitle = "My Web Faovrities";
$homeDesc = "A simple Web Favorities System written in PHP.";
$itemDesc = "A item generated by Web Favorities System.";
$authorName = "Roy Tam";
// End of settings part
require_once './fav_common.php';
// *** DETERMINATION SCRIPT, MODIFY WITH RISK! ***
// Auto Setup Part, no need to modify
$BaseURL = fullURL();
$homeURL = $BaseURL . "fav.php";
$BackUrl = $homeURL;
$RSS_SELF = $BaseURL . "rss.php";
$domainName = preg_replace('/\\:.*/', '', $_SERVER["HTTP_HOST"]);
Example #8
0
echo $userdataobj->gender;
?>
		
	</div>
	
	<div class="right" style="margin-left:10px;">
		<div style="width: 270px;">
			<div style="float:left;">
				<!--<fb:like href="<?php 
//echo site_url();
?>
" layout="button_count"
				show_faces="false" width="20" action="like" font="arial" colorscheme="light"></fb:like>
				-->
				<fb:like href="<?php 
echo fullURL();
?>
" show_faces="false" layout="button_count" width="60" height="30" send="true"></fb:like>
			</div>
			<br/>
			<div style="clear:both;margin:3px 0px;"></div>
			
			<div style="float:left;margin-top:10px;">
				<a href="<?php 
echo site_url();
?>
" class="twitter-share-button" data-lang="en">Tweet</a>
				<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
			</div>

			<div style="clear:both;margin:3px 0px;"></div>
Example #9
0
 function ModulePage()
 {
     global $PIO, $PTE;
     if (!isset($_GET['do'])) {
         // 沒有 "do" 指令,舊的 tag 連接
         if (!isset($_GET['no'])) {
             die('[Error] not enough parameter.');
         }
         if (!isset($_POST['tag'])) {
             $post = $PIO->fetchPosts($_GET['no']);
             if (!count($post)) {
                 die('[Error] Post does not exist.');
             }
             $pte_vals = array('{$TITLE}' => TITLE, '{$RESTO}' => '');
             $dat = $PTE->ParseBlock('HEADER', $pte_vals);
             $dat .= '</head><body id="main">';
             $dat .= '<form action="' . $this->mypage . '&amp;no=' . $_GET['no'] . '" method="POST">Tag: <input type="text" name="tag" value="' . htmlentities(substr(str_replace('&#44;', ',', $post[0]['category']), 1, -1), ENT_QUOTES, 'UTF-8') . '" size="28" /><input type="submit" name="submit" value="Tag!" /></form>';
             echo $dat . "</body></html>";
         } else {
             $Tag = CleanStr($_POST['tag']);
             if ($_SERVER['REQUEST_METHOD'] != 'POST') {
                 error(_T('regist_notpost'));
             }
             // 非正規POST方式
             $post = $PIO->fetchPosts($_GET['no']);
             $parentNo = $post[0]['resto'] ? $post[0]['resto'] : $post[0]['no'];
             $threads = array_flip($PIO->fetchThreadList());
             $threadPage = floor($threads[$parentNo] / PAGE_DEF);
             if (!count($post)) {
                 die('[Error] Post does not exist.');
             }
             $ss = method_exists($PIO, '_replaceComma') ? '&#44;' : ',';
             // Dirty implement
             $category = explode(',', $Tag);
             // 把標籤拆成陣列
             $category = $ss . implode($ss, array_map('trim', $category)) . $ss;
             // 去空白再合併為單一字串 (左右含,便可以直接以,XX,形式搜尋)
             $PIO->updatePost($_GET['no'], array('category' => $category));
             $PIO->dbCommit();
             if (STATIC_HTML_UNTIL == -1 || $threadPage <= STATIC_HTML_UNTIL) {
                 updatelog(0, $threadPage, true);
             }
             // 僅更新討論串出現那頁
             deleteCache(array($parentNo));
             // 刪除討論串舊快取
             if (isset($_POST['ajaxmode'])) {
                 echo $Tag;
             } else {
                 header('HTTP/1.1 302 Moved Temporarily');
                 header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
             }
         }
     } else {
         // 有 "do" 指令,查看下一步
         if ($_GET['do'] == "search") {
             // 搜尋符合標籤的主題
             global $PTE, $PIO, $PMS, $FileIO, $language;
             $category = isset($_GET['c']) ? strtolower(strip_tags(trim($_GET['c']))) : '';
             // 搜尋之類別標籤
             if (!$category) {
                 error(_T('category_nokeyword'));
             }
             $category_enc = urlencode($category);
             $category_md5 = md5($category);
             $page = isset($_GET['p']) ? @intval($_GET['p']) : 1;
             if ($page < 1) {
                 $page = 1;
             }
             // 目前瀏覽頁數
             $isrecache = isset($_GET['recache']);
             // 是否強制重新生成快取
             // 利用Session快取類別標籤出現篇別以減少負擔
             session_start();
             // 啟動Session
             if (!isset($_SESSION['loglist_' . $category_md5]) || $isrecache) {
                 $loglist = $PIO->searchCategory($category);
                 $_SESSION['loglist_' . $category_md5] = serialize($loglist);
             } else {
                 $loglist = unserialize($_SESSION['loglist_' . $category_md5]);
             }
             $loglist_count = count($loglist);
             if (!$loglist_count) {
                 error(_T('category_notfound'));
             }
             $page_max = ceil($loglist_count / PAGE_DEF);
             if ($page > $page_max) {
                 $page = $page_max;
             }
             // 總頁數
             // 分割陣列取出適當範圍作分頁之用
             $loglist_cut = array_slice($loglist, PAGE_DEF * ($page - 1), PAGE_DEF);
             // 取出特定範圍文章
             $loglist_cut_count = count($loglist_cut);
             $dat = '';
             head($dat);
             $links = '[<a href="' . PHP_SELF2 . '?' . time() . '">' . _T('return') . '</a>][<a href="' . PHP_SELF . '?mode=module&amp;load=mod_tag&amp;do=search&amp;c=' . $category_enc . '&amp;recache=1">' . _T('category_recache') . '</a>]';
             $PMS->useModuleMethods('LinksAboveBar', array(&$links, 'category'));
             $dat .= "<div>{$links}</div>\n";
             for ($i = 0; $i < $loglist_cut_count; $i++) {
                 $tID = $loglist_cut[$i];
                 $tree_count = $PIO->postCount($tID) - 1;
                 // 討論串回應個數
                 $RES_start = $tree_count - RE_DEF + 1;
                 if ($RES_start < 1) {
                     $RES_start = 1;
                 }
                 // 開始
                 $RES_amount = RE_DEF;
                 // 取幾個
                 $hiddenReply = $RES_start - 1;
                 // 被隱藏回應
                 // $RES_start, $RES_amount 拿去算新討論串結構 (分頁後, 部分回應隱藏)
                 $tree = $PIO->fetchPostList($tID);
                 // 整個討論串樹狀結構
                 $tree_cut = array_slice($tree, $RES_start, $RES_amount);
                 array_unshift($tree_cut, $tID);
                 // 取出特定範圍回應
                 $posts = $PIO->fetchPosts($tree_cut);
                 // 取得文章架構內容
                 $dat .= arrangeThread($PTE, $tree, $tree_cut, $posts, $hiddenReply, 0, array(), array(), false, false, false);
             }
             $dat .= '<table border="1"><tr>';
             if ($page > 1) {
                 $dat .= '<td><form action="' . PHP_SELF . '?mode=module&amp;load=mod_tag&amp;do=search&amp;c=' . $category_enc . '&amp;p=' . ($page - 1) . '" method="post"><div><input type="submit" value="' . _T('prev_page') . '" /></div></form></td>';
             } else {
                 $dat .= '<td style="white-space: nowrap;">' . _T('first_page') . '</td>';
             }
             $dat .= '<td>';
             for ($i = 1; $i <= $page_max; $i++) {
                 if ($i == $page) {
                     $dat .= "[<b>" . $i . "</b>] ";
                 } else {
                     $dat .= '[<a href="' . PHP_SELF . '?mode=module&amp;load=mod_tag&amp;do=search&amp;c=' . $category_enc . '&amp;p=' . $i . '">' . $i . '</a>] ';
                 }
             }
             $dat .= '</td>';
             if ($page < $page_max) {
                 $dat .= '<td><form action="' . PHP_SELF . '?mode=module&amp;load=mod_tag&amp;do=search&amp;c=' . $category_enc . '&amp;p=' . ($page + 1) . '" method="post"><div><input type="submit" value="' . _T('next_page') . '" /></div></form></td>';
             } else {
                 $dat .= '<td style="white-space: nowrap;">' . _T('last_page') . '</td>';
             }
             $dat .= '</tr></table>' . "\n";
             foot($dat);
             echo $dat;
         } else {
             if ($_GET['do'] == "cloud") {
                 // 建立 tag cloud?
                 // blah blah blah
             } else {
                 // 不知道該如何處理的 "do" 指令
                 echo "スクリプトはTranslation Server Errorに免費の午餐を食べています!<br />";
                 echo "...你想表達什麼?";
             }
         }
     }
 }
Example #10
0
 function ModulePage()
 {
     global $PIO, $FileIO, $PMS, $language, $BAD_STRING, $BAD_FILEMD5, $BAD_IPADDR, $LIMIT_SENSOR;
     if (!isset($_GET['no'])) {
         die('[Error] not enough parameter.');
     }
     if (!isset($_POST['mode'])) {
         // 顯示表單
         if (!$this->shown_in_page && !adminAuthenticate('check')) {
             die('[Error] Access Denied.');
         }
         $post = $PIO->fetchPosts($_GET['no']);
         if (!count($post)) {
             die('[Error] Post does not exist.');
         }
         extract($post[0]);
         $PMS->loadModules('mod_bbcode');
         //嘗試載入mod_bbcode
         if ($bbcode = $PMS->getModuleInstance('mod_bbcode')) {
             $bbcode->_html2bb($com);
         }
         $name = preg_replace('|<span.*?>(.*?)</span>|', '\\1', $name);
         $dat = '';
         head($dat);
         $PMS->hookModuleMethod('PostInfo', array($this, '_EditPostInfo'));
         form($dat, $resto, false, $this->mypage . '&amp;no=' . $_GET['no'], $name, $email, $sub, str_replace('<br />', "\n", $com), substr(str_replace('&#44;', ',', $category), 1, -1), 'edit');
         foot($dat);
         echo $dat;
     } else {
         // 儲存
         if ($_SERVER['REQUEST_METHOD'] != 'POST') {
             error(_T('regist_notpost'));
         }
         // 非正規POST方式
         $post = $PIO->fetchPosts($_GET['no']);
         $newValues = array();
         if (!count($post)) {
             die('[Error] Post does not exist.');
         }
         $name = isset($_POST[FT_NAME]) ? $_POST[FT_NAME] : '';
         $email = isset($_POST[FT_EMAIL]) ? $_POST[FT_EMAIL] : '';
         $sub = isset($_POST[FT_SUBJECT]) ? $_POST[FT_SUBJECT] : '';
         $com = isset($_POST[FT_COMMENT]) ? $_POST[FT_COMMENT] : '';
         $pwd = isset($_POST['pwd']) ? $_POST['pwd'] : '';
         $category = isset($_POST['category']) ? $_POST['category'] : '';
         $resto = isset($_POST['resto']) ? $_POST['resto'] : 0;
         $upfile = '';
         $upfile_path = '';
         $upfile_name = false;
         $upfile_status = 4;
         $pwdc = isset($_COOKIE['pwdc']) ? $_COOKIE['pwdc'] : '';
         if ($resto && !$PIO->isThread($resto)) {
             die('[Error] Thread was deleted.');
         }
         $is_admin = $haveperm = $pwd == ADMIN_PASS || adminAuthenticate('check');
         $PMS->useModuleMethods('Authenticate', array($pwd, 'useredit', &$haveperm));
         if ($pwd == '' && $pwdc != '') {
             $pwd = $pwdc;
         }
         $pwd_md5 = substr(md5($pwd), 2, 8);
         $host = gethostbyaddr(getREMOTE_ADDR());
         if (!($pwd_md5 == $post[0]['pwd'] || $host == $post[0]['host'] || $haveperm)) {
             die('[Error] Access denied.');
         }
         // 欄位陷阱
         $FTname = isset($_POST['name']) ? $_POST['name'] : '';
         $FTemail = isset($_POST['email']) ? $_POST['email'] : '';
         $FTsub = isset($_POST['sub']) ? $_POST['sub'] : '';
         $FTcom = isset($_POST['com']) ? $_POST['com'] : '';
         $FTreply = isset($_POST['reply']) ? $_POST['reply'] : '';
         if ($FTname != 'spammer' || $FTemail != '*****@*****.**' || $FTsub != 'DO NOT FIX THIS' || $FTcom != 'EID OG SMAPS' || $FTreply != '') {
             error(_T('regist_nospam'));
         }
         // 封鎖:IP/Hostname/DNSBL 檢查機能
         $ip = getREMOTE_ADDR();
         $host = gethostbyaddr($ip);
         $baninfo = '';
         if (BanIPHostDNSBLCheck($ip, $host, $baninfo)) {
             error(_T('regist_ipfiltered', $baninfo));
         }
         // 封鎖:限制出現之文字
         foreach ($BAD_STRING as $value) {
             if (strpos($com, $value) !== false || strpos($sub, $value) !== false || strpos($name, $value) !== false || strpos($email, $value) !== false) {
                 error(_T('regist_wordfiltered'));
             }
         }
         $PMS->useModuleMethods('RegistBegin', array(&$name, &$email, &$sub, &$com, array('file' => &$upfile, 'path' => &$upfile_path, 'name' => &$upfile_name, 'status' => &$upfile_status), array('ip' => $ip, 'host' => $host)));
         // "RegistBegin" Hook Point
         // 檢查是否輸入櫻花日文假名
         $chkanti = array($name, $email, $sub, $com);
         foreach ($chkanti as $anti) {
             if (anti_sakura($anti)) {
                 error(_T('regist_sakuradetected'));
             }
         }
         // 檢查表單欄位內容並修整
         if (strlen($name) > 100) {
             error(_T('regist_nametoolong'));
         }
         if (strlen($email) > 100) {
             error(_T('regist_emailtoolong'));
         }
         if (strlen($sub) > 100) {
             error(_T('regist_topictoolong'));
         }
         if (strlen($resto) > 10) {
             error(_T('regist_longthreadnum'));
         }
         $email = CleanStr($email);
         $email = str_replace("\r\n", '', $email);
         $sub = CleanStr($sub);
         $sub = str_replace("\r\n", '', $sub);
         $resto = CleanStr($resto);
         $resto = str_replace("\r\n", '', $resto);
         // 名稱修整
         $name = CleanStr($name);
         $name = str_replace(_T('trip_pre'), _T('trip_pre_fake'), $name);
         // 防止トリップ偽造
         $name = str_replace(CAP_SUFFIX, _T('cap_char_fake'), $name);
         // 防止管理員キャップ偽造
         $name = str_replace("\r\n", '', $name);
         $nameOri = $name;
         // 名稱
         if (preg_match('/(.*?)[##](.*)/u', $name, $regs)) {
             // トリップ(Trip)機能
             $name = $nameOri = $regs[1];
             $cap = strtr($regs[2], array('&amp;' => '&'));
             $salt = preg_replace('/[^\\.-z]/', '.', substr($cap . 'H.', 1, 2));
             $salt = strtr($salt, ':;<=>?@[\\]^_`', 'ABCDEFGabcdef');
             $name = $name . _T('trip_pre') . substr(crypt($cap, $salt), -10);
         }
         if (CAP_ENABLE && preg_match('/(.*?)[##](.*)/', $email, $aregs)) {
             // 管理員キャップ(Cap)機能
             $acap_name = $nameOri;
             $acap_pwd = strtr($aregs[2], array('&amp;' => '&'));
             if ($acap_name == CAP_NAME && $acap_pwd == CAP_PASS) {
                 $name = '<span class="admin_cap">' . $name . CAP_SUFFIX . '</span>';
                 $is_admin = true;
                 $email = $aregs[1];
                 // 去除 #xx 密碼
             }
         }
         if (!$is_admin) {
             // 非管理員
             $name = str_replace(_T('admin'), '"' . _T('admin') . '"', $name);
             $name = str_replace(_T('deletor'), '"' . _T('deletor') . '"', $name);
         }
         $name = str_replace('&◆', '&amp;◆', $name);
         // 避免 &#xxxx; 後面被視為 Trip 留下 & 造成解析錯誤
         // 內文修整
         if (strlen($com) > COMM_MAX && !$is_admin) {
             error(_T('regist_commenttoolong'));
         }
         $com = CleanStr($com, $is_admin);
         // 引入$is_admin參數是因為當管理員キャップ啟動時,允許管理員依config設定是否使用HTML
         $com = str_replace("\r\n", "\n", $com);
         $com = str_replace("\r", "\n", $com);
         $com = ereg_replace("\n(( | )*\n){3,}", "\n", $com);
         if (!BR_CHECK || substr_count($com, "\n") < BR_CHECK) {
             $com = nl2br($com);
         }
         // 換行字元用<br />代替
         $com = str_replace("\n", '', $com);
         // 若還有\n換行字元則取消換行
         if ($category && USE_CATEGORY) {
             // 修整標籤樣式
             $category = explode(',', $category);
             // 把標籤拆成陣列
             $category = '&#44;' . implode('&#44;', array_map('trim', $category)) . '&#44;';
             // 去空白再合併為單一字串 (左右含,便可以直接以,XX,形式搜尋)
         } else {
             $category = '';
         }
         $age = false;
         $dest = '';
         $W = $post[0]['tw'];
         $H = $post[0]['th'];
         $imgW = $post[0]['imgw'];
         $imgH = $post[0]['imgh'];
         $status = $post[0]['status'];
         $PMS->useModuleMethods('RegistBeforeCommit', array(&$name, &$email, &$sub, &$com, &$category, &$age, $dest, $resto, array($W, $H, $imgW, $imgH), &$status));
         // "RegistBeforeCommit" Hook Point
         if ($name != $post[0]['name'] && $_POST[FT_NAME]) {
             $newValues['name'] = $name;
         }
         if ($email != $post[0]['email'] && $_POST[FT_EMAIL]) {
             $newValues['email'] = $email;
         }
         if ($sub != $post[0]['sub'] && $_POST[FT_SUBJECT]) {
             $newValues['sub'] = $sub;
         }
         if ($com != $post[0]['com'] && $_POST[FT_COMMENT]) {
             $newValues['com'] = $com;
         }
         if ($category != $post[0]['category'] && $_POST['category']) {
             $newValues['category'] = $category;
         }
         $PIO->updatePost($_GET['no'], $newValues);
         $PIO->dbCommit();
         $parentNo = $post[0]['resto'] ? $post[0]['resto'] : $post[0]['no'];
         $threads = array_flip($PIO->fetchThreadList());
         $threadPage = floor($threads[$parentNo] / PAGE_DEF);
         if (STATIC_HTML_UNTIL == -1 || $threadPage <= STATIC_HTML_UNTIL) {
             updatelog(0, $threadPage, true);
         }
         // 僅更新討論串出現那頁
         deleteCache(array($parentNo));
         // 刪除討論串舊快取
         header('HTTP/1.1 302 Moved Temporarily');
         header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
     }
 }
Example #11
0
function php2js()
{
    $json = !empty($_GET) ? json_encode($_GET) : '{}';
    return "\r\n\t\t\t<script type='text/javascript'>\r\n\t\t\t\tvar __GET = {$json};\r\n\t\t\t\tvar __URL = '" . fullURL() . "';\r\n\t\t\t\tvar __BASE_URL = '" . baseURL() . "';\r\n\t\t\t\t\r\n\t\t\t\tfunction _toURLstring(){\r\n\t\t\t\t\treturn jQuery.param(__GET);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfunction _buildNewString(){\r\n\t\t\t\t\treturn __BASE_URL+'/?'+_toURLstring();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfunction _makeQueryURL(){\r\n\t\t\t\t\twindow.location = _buildNewString();\r\n\t\t\t\t}\r\n\t\t\t</script>\r\n\t\t";
}
Example #12
0
            // 回應模式輸出
            $page = isset($_GET['page_num']) ? $_GET['page_num'] : 'RE_PAGE_MAX';
            if (!($page == 'all' || $page == 'RE_PAGE_MAX')) {
                $page = intval($_GET['page_num']);
            }
            updatelog($res, $page);
            // 實行分頁
        } elseif (isset($_GET['page_num']) && intval($_GET['page_num']) > -1) {
            // PHP動態輸出一頁
            updatelog(0, intval($_GET['page_num']));
        } else {
            // 導至靜態庫存頁
            if (!is_file(PHP_SELF2)) {
                updatelog();
            }
            header('HTTP/1.1 302 Moved Temporarily');
            header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
        }
}
if (GZIP_COMPRESS_LEVEL && $Encoding) {
    // 有啟動Gzip
    if (!ob_get_length()) {
        exit;
    }
    // 沒內容不必壓縮
    header('Content-Encoding: ' . $Encoding);
    header('X-Content-Encoding-Level: ' . GZIP_COMPRESS_LEVEL);
    header('Vary: Accept-Encoding');
    print gzencode(ob_get_clean(), GZIP_COMPRESS_LEVEL);
    // 壓縮內容
}
Example #13
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('user_m');
     $this->load->model('wall_m');
     $this->load->model('qa_m');
     $this->load->model('wallet_m');
     $this->load->model('friend_m');
     $this->load->model('pet_m');
     $this->load->model('wishlist_m');
     $this->load->model('lock_m');
     $this->load->model('collection_m');
     $this->load->model('photos_m');
     $this->load->model('backstage_m');
     $this->load->model('rate_m');
     $this->load->model('gift_m');
     //$this->load->model( 'flirt_m' );
     $this->load->model('mapflirt_m');
     $this->load->model('peep_m');
     $this->load->model('block_m');
     $this->load->model('online_m');
     $this->load->model('random_message_m');
     $this->load->model('hentai_m');
     $this->load->model('watching_video_m');
     $this->load->model('peepbought_history_m');
     $this->load->model('report_abuse_m');
     $this->load->model('favourite_m');
     $this->load->model('trialpay_m');
     if (!isLogin()) {
         $currenturl = fullURL();
         if (false !== strpos($currenturl, '/videos/')) {
             $redr = str_replace(array('/user/videos/video/', '/user/videos/series/'), array('/videos/category/video/', '/videos/category/series/'), $currenturl);
             redirect($redr);
             die;
         }
         //redirect("member");
     }
     if (isLogin()) {
         $userdata = getAccountUserDataObject(true);
         if ($userdata->status != 0) {
             //show_404();
             die("This account had been deactivated.");
         }
         $facebookdata = $this->db->where('userid', getAccountUserId())->get(TBL_FACEBOOK_CONNECT)->result();
         $twitterdata = $this->db->where('userid', getAccountUserId())->get(TBL_TWITTER_CONNECT)->result();
         if (!$facebookdata and !$twitterdata) {
             //force connect page
             if (isset($_SESSION['admin_switch_user'])) {
             } else {
                 if ($this->uri->segment(2) != 'connect') {
                     redirect("user/connect");
                 }
             }
         }
         /*****
         			if($facebookdata ){ //AND !isset($_SESSION['facebookinvokedtime'])
         				if(!isFacebookLogin()){
         					$url = $this->facebookmodel->getLoginLogoutUrl();
         					$_SESSION['facebookinvokedtime'] = 1;
         					if(ENVIRONMENT != 'development'){
         						redirect( $url );
         					}
         				}
         			}
         			***/
         if ($twitterdata and $twitterdata[0]->session_data) {
             if (!isTwitterLogin()) {
                 $this->twittermodel->invokedSessionLogin($twitterdata[0]->session_data);
             }
         }
         if (isset($_SESSION['reffer_video_url'])) {
             $tmp = $_SESSION['reffer_video_url'];
             unset($_SESSION['reffer_video_url']);
             redirect($tmp);
         }
         $this->user_io_m->userSyncCashAndValue(getAccountUserId());
         $current_dbprefix = $this->db->dbprefix;
         $this->db->set_dbprefix('');
         $check = $this->db->where('userid', getAccountUserId())->get('cometchat_status')->result();
         if (empty($check)) {
             $this->db->set('userid', getAccountUserId());
             $this->db->set('message', NULL);
             $this->db->set('status', 'available');
             $this->db->set('typingto', NULL);
             $this->db->set('typingtime', NULL);
             $this->db->insert('cometchat_status');
         }
         $this->db->set_dbprefix($current_dbprefix);
     }
     //$fb = site_url()."/media/js/fb.js";
     $this->template->append_metadata('<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>');
 }
Example #14
0
    } else {
        return 0;
    }
}
function writeFile($file, $data)
{
    $rp = fopen($file, 'w');
    flock($rp, LOCK_EX);
    // 鎖定檔案
    @fputs($rp, $data);
    flock($rp, LOCK_UN);
    // 解鎖
    fclose($rp);
    chmod($file, 0666);
}
$url = fullURL();
$filesdate = date('YmdHis', filemtime($dir));
$cachedate = @file_get_contents($datecache);
if ($filesdate <= $cachedate && file_exists($feedcache)) {
    header('Content-type: application/xml');
    readfile($feedcache);
    exit;
}
require_once './name.inc.php';
$files = array();
clearstatcache();
if ($dh = opendir('./' . $dir)) {
    while (($file = readdir($dh)) !== false) {
        $files[$file] = @filemtime($dir . $file);
    }
    closedir($dh);
Example #15
0
 public function ModulePage()
 {
     $PIO = PMCLibrary::getPIOInstance();
     if (!isset($_GET['no'])) {
         die('[Error] not enough parameter.');
     }
     if (isset($_GET['action'])) {
         if (adminAuthenticate('check')) {
             $pushcount = '';
             $puststart = 0;
             $post = $PIO->fetchPosts($_GET['no']);
             if (!count($post)) {
                 die('[Error] Post does not exist.');
             }
             // 被推之文章不存在
             extract($post[0]);
             if ($status != '') {
                 $f = $PIO->getPostStatus($status);
                 $pushcount = $f->value('mppCnt');
                 // 被推次數
             }
             if (($puststart = strpos($com, $this->PUSHPOST_SEPARATOR . '<br />')) === false) {
                 die('[Error] No pushpost.');
             }
             $ocom = substr($com, 0, $puststart);
             $pushpost = explode('<br />', substr($com, $puststart + strlen($this->PUSHPOST_SEPARATOR . '<br />')));
             $com = $ocom;
             if ($_GET['action'] == 'del') {
                 // list
                 $p_count = 1;
                 $com .= '<div class="pushpost">';
                 foreach ($pushpost as $p) {
                     $com .= '<input type="checkbox" name="' . $p_count++ . '" value="delete" />' . $p . '<br />';
                 }
                 $com .= '</div>';
                 $dat = '';
                 head($dat);
                 $dat .= '<div class="bar_reply">' . $this->_T('deletepush') . '</div>';
                 $dat .= '<form action="' . $this->getModulePageURL(array('action' => 'delpush', 'no' => $_GET['no'])) . '" method="post">';
                 $dat .= PMCLibrary::getPTEInstance()->ParseBlock('SEARCHRESULT', array('{$NO}' => $no, '{$SUB}' => $sub, '{$NAME}' => $name, '{$NOW}' => $now, '{$COM}' => $com, '{$CATEGORY}' => $category, '{$NAME_TEXT}' => _T('post_name'), '{$CATEGORY_TEXT}' => _T('post_category')));
                 echo $dat, '<input type="submit" value="' . _T('del_btn') . '" /></form></body></html>';
                 return;
             } else {
                 if ($_GET['action'] == 'delpush') {
                     // delete
                     $delno = array();
                     reset($_POST);
                     while ($item = each($_POST)) {
                         if ($item[1] == 'delete' && $item[0] != 'func') {
                             array_push($delno, $item[0]);
                         }
                     }
                     if (count($delno)) {
                         foreach ($delno as $d) {
                             if (isset($pushpost[$d - 1])) {
                                 unset($pushpost[$d - 1]);
                             }
                         }
                     }
                     $pushcount = count($pushpost);
                     if ($pushcount) {
                         $f->update('mppCnt', $pushcount);
                         // 更新推文次數
                         $com = $ocom . $this->PUSHPOST_SEPARATOR . '<br />' . implode('<br />', $pushpost);
                     } else {
                         $f->remove('mppCnt');
                         // 刪除推文次數
                         $com = $ocom;
                     }
                     $PIO->updatePost($_GET['no'], array('com' => $com, 'status' => $f->toString()));
                     // 更新推文
                     $PIO->dbCommit();
                     header('HTTP/1.1 302 Moved Temporarily');
                     header('Location: ' . fullURL() . PHP_SELF . '?page_num=0');
                     return;
                 } else {
                     die('[Error] unknown action.');
                 }
             }
         } else {
             die('[Error] unauthenticated action.');
         }
     }
     // 非 AJAX 推文,產出表單供填寫
     if (!isset($_POST['comm'])) {
         echo $this->printStaticForm(intval($_GET['no']));
     } else {
         // 處理推文
         // 傳送方法不正確
         if ($_SERVER['REQUEST_METHOD'] != 'POST') {
             die(_T('regist_notpost'));
         }
         // 查IP
         $baninfo = '';
         $ip = getREMOTE_ADDR();
         $host = gethostbyaddr($ip);
         if (BanIPHostDNSBLCheck($ip, $host, $baninfo)) {
             die(_T('regist_ipfiltered', $baninfo));
         }
         $name = CleanStr($_POST['name']);
         $comm = CleanStr($_POST['comm']);
         if (strlen($name) > 30) {
             die($this->_T('maxlength'));
         }
         // 名稱太長
         if (strlen($comm) > 160) {
             die($this->_T('maxlength'));
         }
         // 太多字
         if (strlen($comm) == 0) {
             die($this->_T('nocomment'));
         }
         // 沒打字
         $name = str_replace(array(_T('trip_pre'), _T('admin'), _T('deletor')), array(_T('trip_pre_fake'), '"' . _T('admin') . '"', '"' . _T('deletor') . '"'), $name);
         // 生成ID, Trip 等識別資訊
         $pushID = $this->getID();
         $pushtime = gmdate('y/m/d H:i', time() + intval(TIME_ZONE) * 3600);
         if (preg_match('/(.*?)[##](.*)/u', $name, $regs)) {
             $cap = strtr($regs[2], array('&amp;' => '&'));
             $salt = strtr(preg_replace('/[^\\.-z]/', '.', substr($cap . 'H.', 1, 2)), ':;<=>?@[\\]^_`', 'ABCDEFGabcdef');
             $name = $regs[1] . _T('trip_pre') . substr(crypt($cap, $salt), -10);
         }
         if (!$name || preg_match("/^[ | |]*\$/", $name)) {
             if (ALLOW_NONAME) {
                 $name = DEFAULT_NONAME;
             } else {
                 die(_T('regist_withoutname'));
             }
             // 不接受匿名
         }
         if (ALLOW_NONAME == 2) {
             // 強制砍名
             $name = preg_match('/(\\' . _T('trip_pre') . '.{10})/', $name, $matches) ? $matches[1] . ':' : DEFAULT_NONAME . ':';
         } else {
             $name .= ':';
         }
         $pushpost = "{$name} {$comm} ({$pushID} {$pushtime})";
         // 推文主體
         $post = $PIO->fetchPosts($_GET['no']);
         if (!count($post)) {
             die('[Error] Post does not exist.');
         }
         // 被推之文章不存在
         $parentNo = $post[0]['resto'] ? $post[0]['resto'] : $post[0]['no'];
         $threads = array_flip($PIO->fetchThreadList());
         $threadPage = floor($threads[$parentNo] / PAGE_DEF);
         $p = $parentNo == $post[0]['no'] ? $post : $PIO->fetchPosts($parentNo);
         // 取出首篇
         $flgh = $PIO->getPostStatus($p[0]['status']);
         if ($flgh->exists('TS')) {
             die('[Error] ' . _T('regist_threadlocked'));
         }
         // 首篇禁止回應/同時表示禁止推文
         $post[0]['com'] .= (strpos($post[0]['com'], $this->PUSHPOST_SEPARATOR . '<br />') === false ? '<br />' . $this->PUSHPOST_SEPARATOR : '') . '<br /> ' . $pushpost;
         $flgh2 = $PIO->getPostStatus($post[0]['status']);
         $flgh2->plus('mppCnt');
         // 推文次數+1
         $PIO->updatePost($_GET['no'], array('com' => $post[0]['com'], 'status' => $flgh2->toString()));
         // 更新推文
         $PIO->dbCommit();
         // mod_audit logcat
         $this->callCHP('mod_audit_logcat', array(sprintf('[%s] No.%d %s (%s)', __CLASS__, $_GET['no'], $comm, $pushID)));
         if (STATIC_HTML_UNTIL == -1 || $threadPage <= STATIC_HTML_UNTIL) {
             // 僅更新討論串出現那頁
             updatelog(0, $threadPage, true);
         }
         deleteCache(array($parentNo));
         // 刪除討論串舊快取
         if (isset($_POST['ajaxmode'])) {
             echo '+OK ', $pushpost;
         } else {
             header('HTTP/1.1 302 Moved Temporarily');
             header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
         }
     }
 }
Example #16
0
?>
/media/js/flowplayer.ipad-3.2.2.min.js"></script> 


<?php 
$this->load->model('mod_io/xls_io_m');
$id_video = $this->uri->segment(4, 0);
$videodata = $this->mod_io_m->init('id_video', $id_video, TBL_VIDEO);
$video_url = $this->hentai_m->getFacebookVideoSource($id_video);
$seriesdata = $this->mod_io_m->init('id_series', $videodata->id_series, TBL_SERIES);
$slug = slugify($videodata->name);
$full_url = fullURL();
if (!isLogin()) {
    $is_connect = 0;
}
$_SESSION['reffer_video_url'] = fullURL();
?>

<script type="text/javascript">
	var CONNECTED = <?php 
echo $is_connect;
?>
;
	var url = '<?php 
echo site_url();
?>
';
	
</script>

Example #17
0
/media/js/flowplayer-3.2.6.min.js"></script> 
<script type="text/javascript" src="<?php 
echo site_url();
?>
/media/js/flowplayer.ipad-3.2.2.min.js"></script> 


<?php 
$this->load->model('mod_io/xls_io_m');
$id_video = $this->uri->segment(4, 0);
$videodata = $this->mod_io_m->init('id_video', $id_video, TBL_VIDEO);
//$code_video = strtolower( str_replace(array('-','_'),array('',''),$this->uri->segment(5)) );
//$videodata = ( $this->mod_io_m->init('id_video',$id_video,TBL_VIDEO) ) ? $this->mod_io_m->init('id_video',$id_video,TBL_VIDEO) : $this->mod_io_m->init('code_video',$code_video,TBL_VIDEO) ;
$seriesdata = $this->mod_io_m->init('id_series', $videodata->id_series, TBL_SERIES);
$slug = slugify($videodata->name);
$full_url = fullURL();
unset($_SESSION['reffer_video_url']);
?>

<script type="text/javascript">
	 
</script>


<div id="fb-root"></div>

<div id="body-content">
   <?php 
$this->load->view("user/partial/left");
?>
 
Example #18
0
    function ModulePage()
    {
        global $PIO, $PTE;
        if (isset($_GET['action'])) {
            // 標籤雲
            require './module/wordcloud.class.php';
            $pte_vals = array('{$TITLE}' => TITLE, '{$RESTO}' => '');
            $dat = $PTE->ParseBlock('HEADER', $pte_vals);
            $dat .= '<style type="text/css">
.word { padding: 4px 4px 4px 4px; letter-spacing: 3px; text-decoration: none; font-weight: normal; }
.size9 { color: #000 !important; font-size: 200%; }
.size8 { color: #111 !important; font-size: 170%; }
.size7 { color: #222 !important; font-size: 150%; }
.size6 { color: #333 !important; font-size: 120%; }
.size5 { color: #444 !important; font-size: 110%; }
.size4 { color: #555 !important; font-size: 100%; }
.size3 { color: #666 !important; font-size: 90%; }
.size2 { color: #777 !important; font-size: 80%; }
.size1 { color: #888 !important; font-size: 70%; }
.size0 { color: #999 !important; font-size: 60%; }
</style>
</head>
<body id="main">';
            $p = $PIO->fetchPosts($PIO->fetchPostList());
            $cloud = new wordCloud();
            foreach ($p as $pp) {
                if ($pp['category']) {
                    $pp['category'] = substr(str_replace(array(',', '&#44;'), ' ', $pp['category']), 1, -1);
                    $cloud->addString($pp['category']);
                }
            }
            $myCloud = $cloud->showCloud('array');
            if (is_array($myCloud)) {
                foreach ($myCloud as $key => $value) {
                    $dat .= '<a href="./pixmicat.php?mode=category&c=' . urlencode($value['word']) . '" class="word size' . $value['range'] . '">' . $value['word'] . '</a>' . "\n";
                }
            }
            echo $dat . "</body></html>";
            return;
        }
        if (!isset($_GET['no'])) {
            die('[Error] not enough parameter.');
        }
        if (!isset($_POST['tag'])) {
            $post = $PIO->fetchPosts($_GET['no']);
            if (!count($post)) {
                die('[Error] Post does not exist.');
            }
            $pte_vals = array('{$TITLE}' => TITLE, '{$RESTO}' => '');
            $dat = $PTE->ParseBlock('HEADER', $pte_vals);
            $dat .= '</head><body id="main">';
            $dat .= '<form action="' . $this->mypage . '&amp;no=' . $_GET['no'] . '" method="POST">Tag: <input type="text" name="tag" value="' . htmlentities(substr(str_replace('&#44;', ',', $post[0]['category']), 1, -1), ENT_QUOTES, 'UTF-8') . '" size="28" /><input type="submit" name="submit" value="Tag!" /></form>';
            echo $dat . "</body></html>";
        } else {
            $Tag = CleanStr($_POST['tag']);
            if ($_SERVER['REQUEST_METHOD'] != 'POST') {
                error(_T('regist_notpost'));
            }
            // 非正規POST方式
            $post = $PIO->fetchPosts($_GET['no']);
            $parentNo = $post[0]['resto'] ? $post[0]['resto'] : $post[0]['no'];
            $threads = array_flip($PIO->fetchThreadList());
            $threadPage = floor($threads[$parentNo] / PAGE_DEF);
            if (!count($post)) {
                die('[Error] Post does not exist.');
            }
            if (USE_CATEGORY && $Tag) {
                // 修整標籤樣式
                $ss = method_exists($PIO, '_replaceComma') ? '&#44;' : ',';
                // Dirty implement
                $category = explode(',', $Tag);
                // 把標籤拆成陣列
                $category = $ss . implode($ss, array_map('trim', $category)) . $ss;
                // 去空白再合併為單一字串 (左右含,便可以直接以,XX,形式搜尋)
            } else {
                $category = '';
            }
            $PIO->updatePost($_GET['no'], array('category' => $category));
            $PIO->dbCommit();
            if (STATIC_HTML_UNTIL == -1 || $threadPage <= STATIC_HTML_UNTIL) {
                updatelog(0, $threadPage, true);
            }
            // 僅更新討論串出現那頁
            deleteCache(array($parentNo));
            // 刪除討論串舊快取
            if (isset($_POST['ajaxmode'])) {
                echo $Tag;
            } else {
                header('HTTP/1.1 302 Moved Temporarily');
                header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
            }
        }
    }
Example #19
0
 function mod_fblike()
 {
     $this->site = TITLE;
     $this->url = fullURL() . PHP_SELF . '?res=';
 }