From 9f75ea3435a7c61baf051076804a88935e4e6456 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 17 Feb 2011 09:08:16 -0600 Subject: [PATCH] modified: .gitignore modified: yotsubanome.php --- .gitignore | 1 + yotsubanome.php | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 7a29ba2..3ae06b4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ #security reasons .audit *salt*.* +*.sh # *-*_files/ 1279257582007.jpg diff --git a/yotsubanome.php b/yotsubanome.php index fd16534..4b0b3d1 100755 --- a/yotsubanome.php +++ b/yotsubanome.php @@ -57,14 +57,9 @@ error_reporting(E_ALL); // show all errors for debugging /* Enviorment Settings */ // Do not change unless you renamed the directories define("PHP_DIRECTORY", '../test/'); // yotsubanome "C:\windows\system\" -define("DATA_DIR", PHP_DIRECTORY.'data/'); // data directory -define("CSS_DIR", DATA_DIR.'css/'); // CSS directory -define("ICON_DIR", DATA_DIR.'icon/'); // icon directory [Graphics of the software go here] -define("TEMP_DIR", PHP_DIRECTORY.'temp/'); // upload content temperary directory -define("TPLT_DIR", DATA_DIR.'tplt/'); // template directory -define("JS_DIR", DATA_DIR.'js/'); // javascript directory -define("SALTFILE", DATA_DIR.'salt.php'); // saltfile for secure t. codes +/* Include */ +include_once(PHP_DIRECTORY.'env.php'); // Enviorment Settings include_once(PHP_DIRECTORY.'config.php'); // 引入設定檔 include_once(PHP_DIRECTORY.'lib/lib_language.php'); // 引入語系 include_once(PHP_DIRECTORY.'lib/lib_common.php'); // 引入共通函式檔案 @@ -305,7 +300,8 @@ function arrangeThread($PTE, $tree, $tree_cut, $posts, $hiddenReply, $resno=0, $ if(gettype($tree_cut) == 'array') $tree_cut = array_flip($tree_cut); // array_flip + isset 搜尋法 if(gettype($tree) == 'array') $tree_clone = array_flip($tree); if($hiddenReply){ // o++ - // $o = 0 (首篇), $o = 1~n (回應) //++++---- for($o = 0; $o < $posts_img_count; $o++){ // o++ + // $o = 0 (首篇), $o = 1~n (回應) //++++---- + for($o = 0; $o < $posts_img_count; $o++){ // o++ extract($posts_img[$o]); // o++ if($ext && $FileIO->imageExists($tim.$ext)) $hiddenImage++; // o++ all images in thread } @@ -332,7 +328,8 @@ function arrangeThread($PTE, $tree, $tree_cut, $posts, $hiddenReply, $resno=0, $ // 設定欄位值 $name = str_replace('&'.TRIP_KEY, '&'.TRIP_KEY, $name); // 避免 &#xxxx; 後面被視為 Trip 留下 & 造成解析錯誤 if(CLEAR_SAGE) $email = preg_replace('/^sage( *)/i', '', trim($email)); // 清除E-mail中的「sage」關鍵字 - //Tripcode indicator // t++ //++++---- + // Tripcode indicator // t++ //++++---- + // This may be a blob of code but it apparently works >< please help me here $tripkeycount = substr_count($name, TRIP_KEY); if(ALLOW_NONAME==2){ // 強制砍名 if($tripkeycount==1) $name = preg_match('/(\\'.TRIP_KEY.'.{10})/', $name, $matches) ? ''.$matches[1].'' : ''; @@ -418,6 +415,7 @@ function arrangeThread($PTE, $tree, $tree_cut, $posts, $hiddenReply, $resno=0, $ if($flgh->exists('TS')) $WARN_ENDREPLY = ''._T('warn_locked').'
'."\n"; // 被標記為禁止回應 if($hiddenReply) $WARN_HIDEPOST = ''._res($hiddenReply, $hiddenImgs)._T('notice_omitted_reply').'
'."\n"; // 有隱藏的回應 } + // 對類別標籤作自動連結 if(USE_CATEGORY){ $ary_category = explode(',', str_replace(',', ',', $category)); $ary_category = array_map('trim', $ary_category); @@ -561,7 +559,7 @@ function regist(){ $size = @getimagesize($dest); if(!is_array($size)) error(_T('regist_upload_notimage'), $dest); // $size不為陣列就不是圖檔 $imgsize = @filesize($dest); // 檔案大小 - if(!KB) $imgsize .= ' B'; // B only + if(!KB) $imgsize .= ' B'; // Bytes only else $imgsize = ($imgsize>=1024) ? (int)($imgsize/1024).' KB' : $imgsize.' B'; // KB和B的判別 switch($size[2]){ // 判斷上傳附加圖檔之格式 case 1 : $ext = ".gif"; break; @@ -579,7 +577,7 @@ function regist(){ case 13 : $ext = ".swf"; break; case 14 : $ext = ".aiff"; break; case 15 : $ext = ".wbmp"; break; - case 16 : $ext = ".xbm"; break; + case 16 : $ext = ".xbm"; break; // I add more media support (^^,) default : $ext = ".xxxx"; error(_T('regist_upload_notsupport'), $dest); } $allow_exts = explode('|', strtolower(ALLOW_UPLOAD_EXT)); // 接受之附加圖檔副檔名 @@ -588,7 +586,7 @@ function regist(){ $md5chksum = md5_file($dest); // 檔案MD5 if(array_search($md5chksum, $BAD_FILEMD5)!==FALSE) error(_T('regist_upload_blocked'), $dest); // 在封鎖設定內則阻擋 - // 四‧計算附加圖檔圖檔縮圖顯示尺寸 + // 四‧計算附加圖檔圖檔縮圖顯示尺寸 //++++---- <- the comment from pixmicat team is broken here $W = $imgW = $size[0]; $H = $imgH = $size[1]; $MAXW = $resto ? MAX_RW : MAX_W; @@ -611,6 +609,7 @@ function regist(){ // E-mail / 標題修整 $email = str_replace("\r\n", '', $email); $sub = str_replace("\r\n", '', $sub); + // Tripcode area-------------------------------------------------------------------------------- if($name){ // 名稱修整 -- 2.39.2