public function testGetPMSInstance() { $PMS1 = PMCLibrary::getPMSInstance(); $this->assertNotNull($PMS1); $PMS2 = PMCLibrary::getPMSInstance(); $this->assertSame($PMS1, $PMS2); }
function foot(&$dat) { $PTE = PMCLibrary::getPTEInstance(); $PMS = PMCLibrary::getPMSInstance(); $pte_vals = array('{$FOOTER}' => '<!-- GazouBBS v3.0 --><!-- ふたば改0.8 --><!-- Pixmicat! -->'); $PMS->useModuleMethods('Foot', array(&$pte_vals['{$FOOTER}'])); // "Foot" Hook Point $pte_vals['{$FOOTER}'] .= '<small>- <a rel="nofollow noreferrer license" href="http://php.s3.to" target="_blank">GazouBBS</a> + <a rel="nofollow noreferrer license" href="http://www.2chan.net/" target="_blank">futaba</a> + <a rel="nofollow noreferrer license" href="http://pixmicat.openfoundry.org/" target="_blank">Pixmicat!</a> -</small>'; $dat .= $PTE->ParseBlock('FOOTER', $pte_vals); }
function showstatus() { global $LIMIT_SENSOR, $THUMB_SETTING; $PIO = PMCLibrary::getPIOInstance(); $FileIO = PMCLibrary::getFileIOInstance(); $PTE = PMCLibrary::getPTEInstance(); $PMS = PMCLibrary::getPMSInstance(); $countline = $PIO->postCount(); // 計算投稿文字記錄檔目前資料筆數 $counttree = $PIO->threadCount(); // 計算樹狀結構記錄檔目前資料筆數 $tmp_total_size = $FileIO->getCurrentStorageSize(); // 附加圖檔使用量總大小 $tmp_ts_ratio = STORAGE_MAX > 0 ? $tmp_total_size / STORAGE_MAX : 0; // 附加圖檔使用量 // 決定「附加圖檔使用量」提示文字顏色 if ($tmp_ts_ratio < 0.3) { $clrflag_sl = '235CFF'; } elseif ($tmp_ts_ratio < 0.5) { $clrflag_sl = '0CCE0C'; } elseif ($tmp_ts_ratio < 0.7) { $clrflag_sl = 'F28612'; } elseif ($tmp_ts_ratio < 0.9) { $clrflag_sl = 'F200D3'; } else { $clrflag_sl = 'F2004A'; } // 生成預覽圖物件資訊及功能是否正常 $func_thumbWork = '<span style="color: red;">' . _T('info_nonfunctional') . '</span>'; $func_thumbInfo = '(No thumbnail)'; if (USE_THUMB !== 0) { $thumbType = USE_THUMB; if (USE_THUMB == 1) { $thumbType = 'gd'; } require ROOTPATH . 'lib/thumb/thumb.' . $thumbType . '.php'; $thObj = new ThumbWrapper(); if ($thObj->isWorking()) { $func_thumbWork = '<span style="color: blue;">' . _T('info_functional') . '</span>'; } $func_thumbInfo = $thObj->getClass(); unset($thObj); } // PIOSensor if (count($LIMIT_SENSOR)) { $piosensorInfo = nl2br(PIOSensor::info($LIMIT_SENSOR)); } $dat = ''; head($dat); $links = '[<a href="' . PHP_SELF2 . '?' . time() . '">' . _T('return') . '</a>] [<a href="' . PHP_SELF . '?mode=moduleloaded">' . _T('module_info_top') . '</a>]'; $PMS->useModuleMethods('LinksAboveBar', array(&$links, 'status')); $dat .= '<div id="banner">' . $links . '<div class="bar_admin">' . _T('info_top') . '</div> </div> '; $dat .= ' <div id="status-table" style="text-align: center;"> <style type="text/css" scoped="scoped"> .admTable {border-collapse:collapse; border-spacing: 1; margin: 0px auto; text-align: left;} .admTable TD {border:2px solid gray } </style> <table class="admTable"> <thead> <tr><td style="text-align:center" colspan="4">' . _T('info_basic') . '</td></tr> </thead> <tbody> <tr><td style="width: 240px;">' . _T('info_basic_ver') . '</td><td colspan="3"> ' . PIXMICAT_VER . ' </td></tr> <tr><td>' . _T('info_basic_pio') . '</td><td colspan="3"> ' . PIXMICAT_BACKEND . ' : ' . $PIO->pioVersion() . '</td></tr> <tr><td>' . _T('info_basic_threadsperpage') . '</td><td colspan="3"> ' . PAGE_DEF . ' ' . _T('info_basic_threads') . '</td></tr> <tr><td>' . _T('info_basic_postsperpage') . '</td><td colspan="3"> ' . RE_DEF . ' ' . _T('info_basic_posts') . '</td></tr> <tr><td>' . _T('info_basic_postsinthread') . '</td><td colspan="3"> ' . RE_PAGE_DEF . ' ' . _T('info_basic_posts') . ' ' . _T('info_basic_posts_showall') . '</td></tr> <tr><td>' . _T('info_basic_bumpposts') . '</td><td colspan="3"> ' . MAX_RES . ' ' . _T('info_basic_posts') . ' ' . _T('info_basic_0disable') . '</td></tr> <tr><td>' . _T('info_basic_bumphours') . '</td><td colspan="3"> ' . MAX_AGE_TIME . ' ' . _T('info_basic_hours') . ' ' . _T('info_basic_0disable') . '</td></tr> <tr><td>' . _T('info_basic_urllinking') . '</td><td colspan="3"> ' . AUTO_LINK . ' ' . _T('info_0no1yes') . '</td></tr> <tr><td>' . _T('info_basic_com_limit') . '</td><td colspan="3"> ' . COMM_MAX . _T('info_basic_com_after') . '</td></tr> <tr><td>' . _T('info_basic_anonpost') . '</td><td colspan="3"> ' . ALLOW_NONAME . ' ' . _T('info_basic_anonpost_opt') . '</td></tr> <tr><td>' . _T('info_basic_del_incomplete') . '</td><td colspan="3"> ' . KILL_INCOMPLETE_UPLOAD . ' ' . _T('info_0no1yes') . '</td></tr> <tr><td>' . _T('info_basic_use_sample', $THUMB_SETTING['Quality']) . '</td><td colspan="3"> ' . USE_THUMB . ' ' . _T('info_0notuse1use') . '</td></tr> <tr><td>' . _T('info_basic_useblock') . '</td><td colspan="3"> ' . BAN_CHECK . ' ' . _T('info_0disable1enable') . '</td></tr> <tr><td>' . _T('info_basic_showid') . '</td><td colspan="3"> ' . DISP_ID . ' ' . _T('info_basic_showid_after') . '</td></tr> <tr><td>' . _T('info_basic_cr_limit') . '</td><td colspan="3"> ' . BR_CHECK . _T('info_basic_cr_after') . '</td></tr> <tr><td>' . _T('info_basic_timezone') . '</td><td colspan="3"> GMT ' . TIME_ZONE . '</td></tr> <tr><td>' . _T('info_basic_theme') . '</td><td colspan="3"> ' . $PTE->BlockValue('THEMENAME') . ' ' . $PTE->BlockValue('THEMEVER') . '<br/>by ' . $PTE->BlockValue('THEMEAUTHOR') . '</td></tr> <tr><td style="text-align:center" colspan="4">' . _T('info_dsusage_top') . '</td></tr> <tr style="text-align:center"><td>' . _T('info_basic_threadcount') . '</td><td colspan="' . (isset($piosensorInfo) ? '2' : '3') . '"> ' . $counttree . ' ' . _T('info_basic_threads') . '</td>' . (isset($piosensorInfo) ? '<td rowspan="2">' . $piosensorInfo . '</td>' : '') . '</tr> <tr style="text-align:center"><td>' . _T('info_dsusage_count') . '</td><td colspan="' . (isset($piosensorInfo) ? '2' : '3') . '">' . $countline . '</td></tr> <tr><td style="text-align:center" colspan="4">' . _T('info_fileusage_top') . STORAGE_LIMIT . ' ' . _T('info_0disable1enable') . '</td></tr>'; if (STORAGE_LIMIT) { $dat .= ' <tr style="text-align:center"><td>' . _T('info_fileusage_limit') . '</td><td colspan="2">' . STORAGE_MAX . ' KB</td><td rowspan="2">' . _T('info_dsusage_usage') . '<br /><span style="color: #' . $clrflag_sl . '">' . substr($tmp_ts_ratio * 100, 0, 6) . '</span> %</td></tr> <tr style="text-align:center"><td>' . _T('info_fileusage_count') . '</td><td colspan="2"><span style="color: #' . $clrflag_sl . '">' . $tmp_total_size . ' KB</span></td></tr>'; } else { $dat .= ' <tr style="text-align:center"><td>' . _T('info_fileusage_count') . '</td><td>' . $tmp_total_size . ' KB</td><td colspan="2">' . _T('info_dsusage_usage') . '<br /><span style="color: green;">' . _T('info_fileusage_unlimited') . '</span></td></tr>'; } $dat .= ' <tr><td style="text-align:center" colspan="4">' . _T('info_server_top') . '</td></tr> <tr style="text-align:center"><td colspan="3">' . $func_thumbInfo . '</td><td>' . $func_thumbWork . '</td></tr> </tbody> </table> <hr /> </div>' . "\n"; foot($dat); echo $dat; }
public function testStaticPMS() { $this->assertSame(PMCLibrary::getPMSInstance(), $this->mod->testStaticPMS()); }
*/ /** * 取出翻譯資源檔對應字串。 * * @param args 翻譯資源檔索引、其餘變數 * @see LanguageLoader->getTranslation */ function _T() { // 因為 5.3 以前 func_get_args 無法直接指派,故需要由變數 $args 承接再帶入 $args = func_get_args(); return call_user_func_array(array(PMCLibrary::getLanguageInstance(), 'getTranslation'), $args); } /** * 動態附加翻譯資源。此函式已經由 {@link #LanguageLoader->attachLanguage} 取代。 * * @deprecated 7th.Release. Use LanguageLoader->attachLanguage instead. * @param callable $fcall 附加翻譯資源字串的函式 */ function AttachLanguage($fcall) { $GLOBALS['language'] = array(); call_user_func($fcall); PMCLibrary::getLanguageInstance()->attachLanguage($GLOBALS['language']); } // 為了相容舊寫法而保留 $PIO = PMCLibrary::getPIOInstance(); $FileIO = PMCLibrary::getFileIOInstance(); $PTE = PMCLibrary::getPTEInstance(); $PMS = PMCLibrary::getPMSInstance();
public function testPMSInstance() { $obj2 = PMCLibrary::getPMSInstance(); $this->assertSame($this->PMS, $obj2); $this->assertNotNull($this->PMS); }