/********************************
四葉の芽画像掲示板
-yotsubanome.php*/$ver = "v0.7.8.1.0002 β lot.100404";/*
+yotsubanome.php*/$ver = "v0.7.8.1.0004 β lot.100404";/*
これがコアシステムです。 四葉の芽スクリプト
このスクリプトはレッツPHP!<http://php.s3.to/>のgazou.phpを改造したものです。
說明條目可資參考。
*/
-//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'); // 引入共通函式檔案
$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] */
}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 != 0 && $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
$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++){
$pte_vals['{$PAGENAV}'] .= '<br style="clear: left;" />
</div>';
$dat .= $PTE->ParseBlock('MAIN', $pte_vals);
- foot($dat); ////++++---- the foot is a special core function wwww --sparky4
+ foot($dat); // the foot is a special core function wwww --sparky4
// 存檔 / 輸出
- //---- if($single_page || ($page_num == -1 && !$resno)){ // 靜態快取頁面生成
- if($threads_count == 0 && $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');
$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
</html>');
}
-////////////////
-// 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 = '';
// Success messages
$action = (file_exists($style_dat)) ? _t('admin_updated') : _t('admin_created');
- $delete = (@unlink(CSS_DIR.CSVSS)) ? ' - <span class="warning">'.str_replace('[file]', CSS_DIR.CSVSS, _t('admin_deleted')).'</span>' : false;
+ //---- $delete = (@unlink(CSS_DIR.CSVSS)) ? ' - <span class="warning">'.str_replace('[file]', CSS_DIR.CSVSS, _t('admin_deleted')).'</span>' : false;
$fp = fopen($style_dat, 'w+');
set_file_buffer($fp, 0);
rewind($fp);
fputs($fp, $line);
fclose($fp);
@chmod($style_dat, 0666);
- echo '<div class="bar_managecss">'.str_replace('[file]', $style_dat, _t('admin_updated')).$delete.'</div>';
+ echo '<div class="bar_managecss">'.str_replace('[file]', $style_dat, _t('admin_updated'))./*----$delete.*/'</div>';
}
// 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 '<div class="banner"><table width="100%"><tr><th class="bar_managecss">
'.str_replace('[file]', $style_data, $style_mode).'
}
// Read data from R3 DAT
- else if(file_exists(CSS_DIR.CSVSS)){
- $style_data = CSS_DIR.CSVSS;
- $lines = explode("\n", file_get_contents($style_data));
- $j = 0;
- foreach($lines as $null => $line){ // Line has data, or line is not commented out
- if(substr($line, 0, 2) != '//' && $line != ''){
- $bits = explode('[*]', $line);
- $j++;
- $style_name = $bits[0];
- $style_path = CSS_DIR.$bits[2];
- if(file_exists($style_path)){
- $style_short = $bits[1];
- if($bits[3]) $style_rel = ' checked="checked"';
- else $style_rel = false;
- $class = ($j % 2) ? 'row1' : 'row2'; // BG colour
- echo '<tr class="'.$class.'"><td align="left" colspan="2"><label><input name="default" type="radio"'.$style_rel.' value="'.$style_name.'" /> '.$style_path.'</label><input type="hidden" name="path['.$style_name.']" value="'.$bits[2].'" /></td><td align="left"><input name="names['.$style_name.']" value="'.$style_name.'" size="25" /></td><td align="left"><input name="short['.$style_name.']" value="'.$style_short.'" size="5" /></td><td align="left"><input name="order['.$style_name.']" size="2" value="'.$j.'" /></td></tr>';
- }
- }
- }
- }
+ //---- else if(file_exists(CSS_DIR.CSVSS)){
+ //---- $style_data = CSS_DIR.CSVSS;
+ //---- $lines = explode("\n", file_get_contents($style_data));
+ //---- $j = 0;
+ //---- foreach($lines as $null => $line){ // Line has data, or line is not commented out
+ //---- if(substr($line, 0, 2) != '//' && $line != ''){
+ //---- $bits = explode('[*]', $line);
+ //---- $j++;
+ //---- $style_name = $bits[0];
+ //---- $style_path = CSS_DIR.$bits[2];
+ //---- if(file_exists($style_path)){
+ //---- $style_short = $bits[1];
+ //---- if($bits[3]) $style_rel = ' checked="checked"';
+ //---- else $style_rel = false;
+ //---- $class = ($j % 2) ? 'row1' : 'row2'; // BG colour
+ //---- echo '<tr class="'.$class.'"><td align="left" colspan="2"><label><input name="default" type="radio"'.$style_rel.' value="'.$style_name.'" /> '.$style_path.'</label><input type="hidden" name="path['.$style_name.']" value="'.$bits[2].'" /></td><td align="left"><input name="names['.$style_name.']" value="'.$style_name.'" size="25" /></td><td align="left"><input name="short['.$style_name.']" value="'.$style_short.'" size="5" /></td><td align="left"><input name="order['.$style_name.']" size="2" value="'.$j.'" /></td></tr>';
+ //---- }
+ //---- }
+ //---- }
+ //---- }
$j++; $class = ($j % 2) ? 'row1' : 'row2';