X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=yotsubanome.php;h=0b94d01b875c0b3574b768fd6900551d9d2f4479;hb=944335da5882cdd17738bb1bd00b4ce1714539f4;hp=4bbce4b278e7067fb7d827ee7f72944df35e4212;hpb=8ec518ab65701d8592878e163886ba15e2bb15a5;p=test.git diff --git a/yotsubanome.php b/yotsubanome.php index 4bbce4b..0b94d01 100755 --- a/yotsubanome.php +++ b/yotsubanome.php @@ -2,7 +2,7 @@ /********************************     四葉の芽画像掲示板 -yotsubanome.php*/$ver = "v0.7.8.1.0002 β lot.100404";/* +yotsubanome.php*/$ver = "v0.7.8.1.0004 β lot.100404";/* これがコアシステムです。 四葉の芽スクリプト このスクリプトはレッツPHP!のgazou.phpを改造したものです。 @@ -52,14 +52,12 @@ PHP 4.4.9 或更高版本並開啟 GD 和 Zlib 支援,如支援 ImageMagick 說明條目可資參考。 */ -//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\" /* Include */ -include_once(PHP_DIRECTORY.'env.php'); // Enviorment Settings +include_once(PHP_DIRECTORY.'lib/lib_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'); // 引入共通函式檔案 @@ -71,9 +69,10 @@ include_once(PHP_DIRECTORY.'lib/lib_pte.php'); // 引入PTE外部函式庫 $PTE = new PTELibrary(TEMPLATE_FILE); // PTE Library if(version_compare(PHP_VERSION, '5.0.0', '>=')){ // PHP5+ - set_error_handler('PMCCore_errorHandler', E_ERROR | E_WARNING | E_USER_ERROR); // Handle Errors + set_error_handler('PMCCore_errorHandler', E_ERROR | E_WARNING | E_USER_ERROR); // Handle Errors }else{ - set_error_handler('PMCCore_errorHandler'); + //---- set_error_handler('PMCCore_errorHandler'); + error_reporting(E_ALL); // show all errors for debugging } /* Lockdown [prevents posting] */ @@ -127,7 +126,9 @@ function updatelog($resno=0,$page_num=-1,$single_page=false){ }else{ // 討論串分頁模式 (PHP動態輸出一頁份) $threads_count = $PIO->threadCount(); // 討論串個數 //---- if($page_num < 0 || ($page_num * PAGE_DEF) >= $threads_count) error(_T('page_not_found')); // $page_num超過範圍 - if($threads_count = 1 && $page_num < 0 || ($page_num < 0 || ($page_num * PAGE_DEF) >= $threads_count)) error(_T('page_not_found')); // $page_num超過範圍 + //++++---- Page 0 bug fix + if($page_num!=0) if($page_num < 0 || ($page_num * PAGE_DEF) >= $threads_count) error(_T('page_not_found')); // $page_num超過範圍 + //++++---- $page_start = $page_end = $page_num; // 設定靜態頁面編號 $threads = $PIO->fetchThreadList($page_num * PAGE_DEF, PAGE_DEF); // 取出分頁後的討論串首篇列表 $PMS->useModuleMethods('ThreadOrder', array($resno,$page_num,$single_page,&$threads)); // "ThreadOrder" Hook Point @@ -188,6 +189,9 @@ function updatelog($resno=0,$page_num=-1,$single_page=false){ $PMS->useModuleMethods('ThreadFront', array(&$pte_vals['{$THREADFRONT}'], $resno)); // "ThreadFront" Hook Point $PMS->useModuleMethods('ThreadRear', array(&$pte_vals['{$THREADREAR}'], $resno)); // "ThreadRear" Hook Point + //++++---- Page 0 bug fix + if($tree_count==0 && $page_end==-1) $page_end = 0; + //++++---- // 生成靜態頁面一頁份內容 for($page = $page_start; $page <= $page_end; $page++){ @@ -267,11 +271,10 @@ function updatelog($resno=0,$page_num=-1,$single_page=false){ $pte_vals['{$PAGENAV}'] .= '
'; $dat .= $PTE->ParseBlock('MAIN', $pte_vals); - foot($dat); + foot($dat); // the foot is a special core function wwww --sparky4 // 存檔 / 輸出 - //---- if($single_page || ($page_num == -1 && !$resno)){ // 靜態快取頁面生成 - if($threads_count = 1 && $page_num < 0 || ($single_page || ($page_num == -1 && !$resno))){ // 靜態快取頁面生成 + if($single_page || ($page_num == -1 && !$resno)){ // 靜態快取頁面生成 if($page==0) $logfilename = PHP_SELF2; else $logfilename = $page.PHP_EXT; $fp = fopen($logfilename, 'w'); @@ -684,6 +687,7 @@ function regist(){ $name = str_replace('&'.TRIP_KEY, '&'.TRIP_KEY, $name); // 避免 &#xxxx; 後面被視為 Trip 留下 & 造成解析錯誤 } // End of Tripcode area-------------------------------------------------------------------------- + // 內文修整 if((strlen($com) > COMM_MAX) && !$is_admin) error(_T('regist_commenttoolong'), $dest); $com = CleanStr($com, $is_admin); // 引入$is_admin參數是因為當管理員キャップ啟動時,允許管理員依config設定是否使用HTML @@ -1108,9 +1112,8 @@ _ADMINEOF_; '); } -//////////////// -// manage_css // -//////////////// +/* manage_css */ +// http://www.magmagateau.com/fuukaba/ is the source of the code below function manage_css(){ global $PMS, $language; $order = array(); $line = ''; @@ -1182,23 +1185,23 @@ function manage_css(){ // Success messages $action = (file_exists($style_dat)) ? _t('admin_updated') : _t('admin_created'); - $delete = (@unlink(CSS_DIR.CSVSS)) ? ' - '.str_replace('[file]', CSS_DIR.CSVSS, _t('admin_deleted')).'' : false; + //---- $delete = (@unlink(CSS_DIR.CSVSS)) ? ' - '.str_replace('[file]', CSS_DIR.CSVSS, _t('admin_deleted')).'' : false; $fp = fopen($style_dat, 'w+'); set_file_buffer($fp, 0); rewind($fp); fputs($fp, $line); fclose($fp); @chmod($style_dat, 0666); - echo '
'.str_replace('[file]', $style_dat, _t('admin_updated')).$delete.'
'; + echo '
'.str_replace('[file]', $style_dat, _t('admin_updated'))./*----$delete.*/'
'; } // Editing messages if(file_exists(DATA_DIR.CSV_SS)){ $style_data = DATA_DIR.CSV_SS; $style_mode = _t('admin_editing'); - }else{ - $style_data = CSS_DIR.CSVSS; - $style_mode = _t('admin_imported'); + //---- }else{ + //---- $style_data = CSS_DIR.CSVSS; + //---- $style_mode = _t('admin_imported'); } echo '