[外掛] 論壇資料 *顯示頁的產生時間, DB查詢次數, GZIP狀態...

Officially Approved MODs
由 phpBB Group 官方發展小組認證的 MOD!

版主: 版主管理群

版面規則
請注意!只有發表在 [2.0.x] MOD Database Releases 的外掛,才算是官方認證的外掛。
主題已鎖定
bebe2803
星球公民
星球公民
文章: 117
註冊時間: 2005-01-24 19:31
來自: Hong Kong

[外掛] 論壇資料 *顯示頁的產生時間, DB查詢次數, GZIP狀態...

文章 bebe2803 »

http://www.phpbb.com/phpBB/viewtopic.php?t=273290

我的論壇開一頁是 0.5-1 秒 @@ (暈倒) (真慢)


產生此頁面的秒數或時間,會在頁底加的句 (因此是 overall footer 所以大部份頁也有...)

GZIP: Disabled Queries: 35 Generation Time: 0.59186 Seconds


我把本來有圖片的改成沒有, 這樣會快很多...

代碼: 選擇全部

############################################################## 
## MOD Title: Forum Information
## MOD Author: lowjoel <webmaster@joelsplace.sg> Joel Low - http://joelsplace.sg/
## MOD Description: Displays the Number of script queries executed, GZIP
## compression information and page execution time.
## MOD Version: 1.0.0
## 
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit:  extension.inc,
##                 language/lang_english/lang_main.php,
##                 includes/page_tail.php,
##                 templates/subSilver/overall_footer.tpl
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/
############################################################## 
## MOD History:
##
##     2005-03-17  - Version 1.0.1
##          - Updated installation instructions
##          - Created folder hierachy for easy extraction
##
##     2005-03-12  - Version 1.0.0
##          - Original release
##
############################################################## 
## Author Notes: 
##  
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
#
extension.inc

# 
#-----[ FIND ]------------------------------------------ 
#
$starttime = 0;
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
$starttime = time();
# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
#
// That's all, Folks! 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//-------------------------- MOD: Forum Information MOD --------------------------
$lang['L_GZIP_ENABLED'] = 'GZIP: Enabled';
$lang['L_GZIP_DISABLED'] = 'GZIP: Disabled';
$lang['L_GENERATION_TIME'] = 'Generation Time: %s  Seconds';
$lang['L_MYSQL_QUERIES'] = 'Queries: %s';
//-------------------------- End MOD: Forum Information MOD --------------------------
# 
#-----[ OPEN ]------------------------------------------ 
#
includes/page_tail.php

# 
#-----[ FIND ]------------------------------------------ 
#
$template->pparse('overall_footer');
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
//-------------------------- MOD: Forum Information MOD --------------------------
//delete
//$template->pparse('overall_footer');
//-------------------------- End MOD: Forum Information MOD --------------------------

# 
#-----[ FIND ]------------------------------------------ 
#
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
	echo $gzip_contents;
	echo pack('V', $gzip_crc);
	echo pack('V', $gzip_size);
}
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

//-------------------------- MOD: Forum Information MOD --------------------------
$endtime = microtime(); 
$endtime = explode(" ", microtime()); 
$endtime = $endtime[1] + $endtime[0]; 
$gentime = round(($endtime - $starttime), 5);
$template->assign_vars(array(
  'L_GENERATION_TIME' => sprintf($lang['L_GENERATION_TIME'], $gentime),
  'L_NUMBER_QUERIES' => sprintf($lang['L_MYSQL_QUERIES'],  $db->num_queries),
  'L_GZIP_ON' =>  ($board_config['gzip_compress']) ? $lang['L_GZIP_ENABLED'] : $lang['L_GZIP_DISABLED'],
)
);
$template->pparse('overall_footer');
//-------------------------- End MOD: Forum Information MOD --------------------------

# 
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/overall_footer.tpl

# 
#-----[ FIND ]------------------------------------------ 
#
{TRANSLATION_INFO}
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
<br /> {L_GZIP_ON}&nbsp;&nbsp; {L_NUMBER_QUERIES}&nbsp;&nbsp; {L_GENERATION_TIME}
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
我總覺得裝了後慢了不少 (謎之聲 : 是你的錯覺吧 一直也很慢 XD)
怨念公社

phpBB 2.0.17, 8+1 個 template, 70+ mod...
主題已鎖定

回到「官方認證外掛」