pixmicat

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/PMC2Prototype/ @ 370  →  /PMC2Prototype/ @ 371
/PMC2Prototype/lib/lib_fileio.php
@@ -19,14 +19,25 @@
// 擴充物件
class FileIOWrapper extends FileIO{
var $absoluteURL; // 伺服器絕對位置
 
// 取得放置圖片資料夾絕對 URL
function _getAbsoluteURL(){
return 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/(.*)\/.+$/', '$1/', $_SERVER['PHP_SELF']);
return 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/(.*)\/.+$/', '$1/', $_SERVER['PHP_SELF']).substr(PMCCore_getConfig('ENV.FOLDER.BOARD'), 2).'/';
}
 
// 取得圖片本地絕對 URL
function getImageLocalURL($imgname){
if(!isset($this->absoluteURL)) $this->absoluteURL = $this->_getAbsoluteURL();
 
return $this->absoluteURL.(substr($imgname, -5)=='s.jpg' ? PMCCore_getConfig('THUMB_DIR') : PMCCore_getConfig('IMG_DIR')).$imgname;
return $this->absoluteURL.(substr($imgname, -5)=='s.jpg' ? PMCCore_getConfig('THUMB_DIR') : PMCCore_getConfig('IMG_DIR')).'/'.$imgname;
}
 
// 取得總圖片大小
function getImageTotalSize(){
$sfile = PMCCore_getConfig('ENV.FOLDER.TEMP').'sizecache.dat';
touch($sfile);
return (int)(file_get_contents($sfile) / 1024);
}
}
 
$returnOBJECT = new FileIOWrapper(PMCCore_getConfig('LIB.FILEIO.PARAMETER')); // FileIO 物件
/PMC2Prototype/resource/pixmicat-ajax.tmpl
@@ -55,6 +55,7 @@
 
<form action="<?php echo PMCCore_getConfig('ENV.PHP_SELF');?>/search" method="post">
<div id="TrenderSearch" style="display: none;">
[<a href="#">回到版面</a>]
<div class="bar_admin">搜尋</div>
<ul>
<li>請輸入要搜尋的關鍵字,設定好搜尋目標之後,按下「搜尋」按鈕。</li>
@@ -70,9 +71,11 @@
</div>
</form>
 
<div id="TrenderStatus" style="text-align: center; display: none;">
<div id="TrenderStatus" style="display: none;">
[<a href="#">回到版面</a>]
<div class="bar_admin">系統資訊</div>
 
<div style="text-align: center;">
<table border="1" style="margin: 0px auto; text-align: left;">
<tr><td align="center" colspan="3">基本設定</td></tr>
<tr><td style="width: 240px;">程式版本</td><td colspan="2"> $info_basic_ver$ </td></tr>
@@ -87,21 +90,22 @@
<tr><td>接受匿名發送</td><td colspan="2"> $info_basic_anonpost$ (強制砍名:2 是:1 否:0)</td></tr>
<tr><td>自動刪除上傳不完整附加圖檔</td><td colspan="2"> $info_basic_del_incomplete$ (是:1 否:0)</td></tr>
<tr><td>預覽圖品質</td><td colspan="2"> $info_basic_sample_quality$ </td></tr>
<tr><td>└ 預覽圖生成功能</td><td colspan="2"> <span style="color: blue;">功能正常</span> </td></tr>
<tr><td>└ 預覽圖生成功能</td><td colspan="2"> $info_basic_sample_func$ </td></tr>
<tr><td>封鎖檢查功能</td><td colspan="2"> $info_basic_useblock$ (啟動:1 關閉:0)</td></tr>
<tr><td>顯示ID</td><td colspan="2"> $info_basic_showid$ (強制顯示:2 選擇性顯示:1 永遠不顯示:0)</td></tr>
<tr><td>文字換行行數上限</td><td colspan="2"> $info_basic_cr_limit$ 行 (不限:0)</td></tr>
<tr><td>時區設定</td><td colspan="2"> GMT $info_basic_timezone$</td></tr>
<tr><td>目前總討論串篇數</td><td colspan="2"> $info_basic_threadcount$ 篇</td></tr>
<tr><td align="center" colspan="3">記錄檔使用量</td></tr>
<tr align="center"><td>最大筆數</td><td>$info_dsusage_max$</td><td rowspan="2">使用率<br />-- %</td></tr>
<tr align="center"><td>最大筆數</td><td>$info_dsusage_max$</td><td rowspan="2">使用率<br />$info_dsusage_percent$ %</td></tr>
<tr align="center"><td>目前筆數</td><td>$info_dsusage_count$</td></tr>
<tr><td align="center" colspan="3">附加圖檔總容量限制功能:$info_fileusage$ (啟動:1 關閉:0)</td></tr>
<tr align="center"><td>上限大小</td><td>$info_fileusage_limit$ KB</td><td rowspan="2">使用率<br />-- %</td></tr>
<tr align="center"><td>目前容量</td><td>$info_fileusage_count$</td></tr>
<tr align="center"><td>上限大小</td><td>$info_fileusage_limit$ KB</td><td rowspan="2">使用率<br />$info_fileusage_percent$ %</td></tr>
<tr align="center"><td>目前容量</td><td>$info_fileusage_count$ KB</td></tr>
<tr><td align="center" colspan="3">伺服器支援情報</td></tr>
<tr align="center"><td colspan="2">GD函式庫 bundled (2.0.28 compatible)</td><td><span style="color: blue;">已開啟</span></td></tr>
<tr align="center"><td colspan="2">GD函式庫 $info_gd_verinfo$</td><td> $info_gd_func$ </td></tr>
</table>
</div>
<hr />
</div>
 
/PMC2Prototype/resource/xmlhttp.js
@@ -101,6 +101,7 @@
i2 = iframe.contentWindow.document;
i2.open(); i2.close();
i2.location.hash = Thistory.currentHash;
window.scroll(0, 0); // 修正捲軸問題
}
Thistory.__onRegister(); // 修改連結事件
Thistory.eventFunction(Thistory.currentHash.replace(/^#/, ''));
/PMC2Prototype/action/action.php
@@ -13,15 +13,20 @@
echo '{"status":"Finish."}';
break;
case 'status': // 顯示系統資訊
$PIO = PMCCore_loadLibrary('pio');
$PIO = PMCCore_loadLibrary('pio'); $FileIO = PMCCore_loadLibrary('fileio');
$pCount = $PIO->postCount(); $imgSize = $FileIO->getImageTotalSize();
$gd_func = 'Fail'; $gd_ver = '(No info)';
if(extension_loaded('gd')){ $gd_func = 'OK'; if($gd_ver = @gd_info()){ $gd_ver = $gd_ver['GD Version']; } }
$arrStatus = array(
'info_basic_ver'=>PIXMICAT_VER, 'info_basic_pio'=>$PIO->pioVersion(),
'info_basic_threadsperpage'=>PMCCore_getConfig('PAGE_DEF'), 'info_basic_postsperpage'=>PMCCore_getConfig('RE_DEF'),
'info_basic_postsinthread'=>PMCCore_getConfig('RE_PAGE_DEF'), 'info_basic_bumpposts'=>PMCCore_getConfig('MAX_RES'), 'info_basic_bumphours'=>PMCCore_getConfig('MAX_AGE_TIME'),
'info_basic_urllinking'=>PMCCore_getConfig('AUTO_LINK'), 'info_basic_com_limit'=>PMCCore_getConfig('COMM_MAX'), 'info_basic_anonpost'=>PMCCore_getConfig('ALLOW_NONAME'), 'info_basic_del_incomplete'=>PMCCore_getConfig('KILL_INCOMPLETE_UPLOAD'),
'info_basic_sample_quality'=>PMCCore_getConfig('THUMB.QUALITY'), 'info_basic_useblock'=>PMCCore_getConfig('BAN.ENABLE'), 'info_basic_showid'=>PMCCore_getConfig('DISP_ID'), 'info_basic_cr_limit'=>PMCCore_getConfig('BR_CHECK'),
'info_basic_sample_quality'=>PMCCore_getConfig('THUMB.QUALITY'), 'info_basic_sample_func'=>(function_exists('ImageCreateTrueColor')?'OK':'Fail'), 'info_basic_useblock'=>PMCCore_getConfig('BAN.ENABLE'), 'info_basic_showid'=>PMCCore_getConfig('DISP_ID'), 'info_basic_cr_limit'=>PMCCore_getConfig('BR_CHECK'),
'info_basic_timezone'=>PMCCore_getConfig('TIME_ZONE'), 'info_basic_threadcount'=>$PIO->threadCount(),
'info_dsusage_max'=>PMCCore_getConfig('LOG_MAX'), 'info_dsusage_count'=>$PIO->postCount(), 'info_fileusage'=>PMCCore_getConfig('STORAGE.LIMIT'), 'info_fileusage_limit'=>PMCCore_getConfig('STORAGE.MAX'), 'info_fileusage_count'=>'N/A'
'info_dsusage_max'=>PMCCore_getConfig('LOG_MAX'), 'info_dsusage_count'=>$pCount, 'info_dsusage_percent'=>substr($pCount / PMCCore_getConfig('LOG_MAX') * 100, 0, 6),
'info_fileusage'=>PMCCore_getConfig('STORAGE.LIMIT'), 'info_fileusage_limit'=>PMCCore_getConfig('STORAGE.MAX'), 'info_fileusage_count'=>$imgSize, 'info_fileusage_percent'=>substr($imgSize / PMCCore_getConfig('STORAGE.MAX') * 100, 0, 6),
'info_gd_verinfo'=>$gd_ver,'info_gd_func'=>$gd_func
);
$result = array();
foreach($arrStatus as $akey => $aval){ array_push($result, '"'.$akey.'":"'.$aval.'"'); }