[外掛]狀態列訊息+時間plus0.2

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
*tytsim*
竹貓忠實會員
竹貓忠實會員
文章: 411
註冊時間: 2005-03-24 11:54
來自: 香港
聯繫:

[外掛]狀態列訊息+時間plus0.2

文章 *tytsim* »

狀態列訊息+時間plus0.2
########################################################
## 外掛名稱: 狀態列訊息+時間
## 外掛版本: plus0.2
## 作者: tytsim, k122417901, ts00728326
##
## 這個外掛支援所有phpbb2.0
## This mod is for all phpBB2.0
##
##
## Installation Level: 普通
## Installation Time: 3-4 分鐘
## Files To Edit: 4
## admin/admin_board.php
## includes/page_header.php
## language\lang_chinese_traditional_taiwan\lang_admin.php
## /templates/your_templates/overall_header.tpl
##
##########################################################
##
## Installation Notes:
##
## There is some customization that will need to be
## done in Viewtopic_body.tpl It is really up to you
## where you want it to be placed.
##
########################################################
plus0.2:tytsim
外掛指正:~倉木麻衣~
後台功能:k122417901
原作者:ts00728326
範例:http://www.tytsim.bobos.ca/bbs/index.php
大家先備份~

新功能簡介:
1. 已修正"h"變數的問題
2. 後台增加"狀態列時間制"
3. 中午12:00 由"12:00 上午" 修改做 "12:00 中午"

plus0.3將會加的功能:
1. "上午" "中午" "下午" "目前時間:"文字編輯
有可能會加的功能(未必會有):
1. 會員修改"狀態列時間制"

修正安裝 (於2005/7/24 下午 08:40分後安裝的不用修改)
把overall_header.tpl
if (h = 12)
改做
if (h == 12)


升級安裝 (plus0.1 to plus 0.2)
#
#-----[ OPEN 打開 ]-------------------------------------------------------------
#
page_header.php
#
#-----[ FIND 找尋 ]------------------------------------------------------------
#
if($board_config['mod_time']=="1"){
$mod_time="onetwo";
}else if ($board_config['mod_time']=="0"){
$mod_time="twofour";
}
#
#-----[ CHANGE 轉做 ]------------------------------------------------------------
#
if($board_config['mod_time']=="1"){
$mod_time="onetwo()";
}else if ($board_config['mod_time']=="0"){
$mod_time="twofour()";
}
#
#-----[ OPEN 打開 ]---------------------------------------------------------------
#
overall_header.tpl
#
#-----[ FIND 找尋 ]-----------------------------------------------------------
#
onload="{mod_time}()"
#
#-----[ CHANGE 轉做 ]--------------------------------------------------------
#
onload="{mod_time}"
#
#-----[ FIND 找尋 ]-----------------------------------------------------------
#
<script language="JavaScript" type="text/javascript">
<!--
timeID = 10;
stcnt = 16;
msg = "{WELCOME_MESSAGE}";
wmsg = new Array(32);
wmsg[0]=msg;
blnk = " ";
for (i=1; i<32; i++)
{
b = blnk.substring(0,i);
wmsg="";
for (j=0; j<msg.length; j++) wmsg=wmsg+msg.charAt(j)+b;
}
function twofour()
{
ct = new Date();
h = "0"+ct.getHours();
m = "0"+ct.getMinutes();
s = "0"+ct.getSeconds();
h = h.substring(h.length-2,h.length+1);
m = m.substring(m.length-2,m.length+1);
s = s.substring(s.length-2,s.length+1);
cl = " 目前時間: "+h+":"+m+":"+s+" ";
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt-- < -40) stcnt=31;
status = cl+str;
clearTimeout(timeID);
timeID = setTimeout("twofour()",100);
}
function onetwo()
{
ct = new Date();
h = "0"+ct.getHours();
m = "0"+ct.getMinutes();
s = "0"+ct.getSeconds();
h = h.substring(h.length-2,h.length+1);
m = m.substring(m.length-2,m.length+1);
s = s.substring(s.length-2,s.length+1);
if (h > 12)
{
h = h-12 ;
cl = " 目前時間: "+h+":"+m+":"+s+" 下午";
}
if (h <= 12) cl = " 目前時間: "+h+":"+m+":"+s+" 上午";
if (h < 10 & h > 0 ) cl= " 目前時間: 0"+h+":"+m+":"+s+" 下午";
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt-- < -40) stcnt=31;
status = cl+str;
clearTimeout(timeID);
timeID = setTimeout("onetwo()",100);
}
-->
</script>
#
#-----[ CHANGE 轉做 ]------------------------------------------------------
#
<script language="JavaScript" type="text/javascript">
<!--
timeID = 10;
stcnt = 16;
msg = "{WELCOME_MESSAGE}";
\nwmsg = new Array(32);
wmsg[0]=msg;
blnk = " ";
for (i=1; i<32; i++)
{
b = blnk.substring(0,i);
wmsg="";
for (j=0; j<msg.length; j++) wmsg=wmsg+msg.charAt(j)+b;
}
function twofour()
{
ct = new Date();
h = "0"+ct.getHours();
m = "0"+ct.getMinutes();
s = "0"+ct.getSeconds();
h = h.substring(h.length-2,h.length+1);
m = m.substring(m.length-2,m.length+1);
s = s.substring(s.length-2,s.length+1);
cl = " 目前時間: "+h+":"+m+":"+s+" ";
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt-- < -40) stcnt=31;
status = cl+str;
clearTimeout(timeID);
timeID = setTimeout("twofour()",100);
}
function onetwo()
{
ct = new Date();
h = "0"+ct.getHours();
m = "0"+ct.getMinutes();
s = "0"+ct.getSeconds();
h = h.substring(h.length-2,h.length+1);
m = m.substring(m.length-2,m.length+1);
s = s.substring(s.length-2,s.length+1);
if (h == 12)
{
cl = " 目前時間: "+h+":"+m+":"+s+" 中午";
}else if (h > 12)
{
h = h-12 ;
cl = " 目前時間: "+h+":"+m+":"+s+" 下午";
if (h < 10 & h > 0 ) cl= " 目前時間: 0"+h+":"+m+":"+s+" 下午";
}else if (h < 12) cl = " 目前時間: "+h+":"+m+":"+s+" 上午";
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt-- < -40) stcnt=31;
status = cl+str;
clearTimeout(timeID);
timeID = setTimeout("onetwo()",100);
}
-->
</script>
#
#-----[ SAVE COLSE 存檔 關閉 ]--------------------------------------------
#EoM 外掛升級結束
完整安裝:

#
#-----[ OPEN 打開 ]----------------------------------------------------------------
#
overall_header.tpl
#
#-----[ BEFORE </HEAD> ADD 在</head>之前加上 ]------------------------
#
<script language="JavaScript" type="text/javascript">
<!--
timeID = 10;
stcnt = 16;
msg = "{WELCOME_MESSAGE}";
wmsg = new Array(32);
wmsg[0]=msg;
blnk = " ";
for (i=1; i<32; i++)
{
b = blnk.substring(0,i);
wmsg="";
for (j=0; j<msg.length; j++) wmsg=wmsg+msg.charAt(j)+b;
}
function twofour()
{
ct = new Date();
h = "0"+ct.getHours();
m = "0"+ct.getMinutes();
s = "0"+ct.getSeconds();
h = h.substring(h.length-2,h.length+1);
m = m.substring(m.length-2,m.length+1);
s = s.substring(s.length-2,s.length+1);
cl = " 目前時間: "+h+":"+m+":"+s+" ";
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt-- < -40) stcnt=31;
status = cl+str;
clearTimeout(timeID);
timeID = setTimeout("twofour()",100);
}
function onetwo()
{
ct = new Date();
h = "0"+ct.getHours();
m = "0"+ct.getMinutes();
s = "0"+ct.getSeconds();
h = h.substring(h.length-2,h.length+1);
m = m.substring(m.length-2,m.length+1);
s = s.substring(s.length-2,s.length+1);
if (h == 12)
{
cl = " 目前時間: "+h+":"+m+":"+s+" 中午";
}else if (h > 12)
{
h = h-12 ;
cl = " 目前時間: "+h+":"+m+":"+s+" 下午";
if (h < 10 & h > 0 ) cl= " 目前時間: 0"+h+":"+m+":"+s+" 下午";
}else if (h < 12) cl = " 目前時間: "+h+":"+m+":"+s+" 上午";
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt-- < -40) stcnt=31;
status = cl+str;
clearTimeout(timeID);
timeID = setTimeout("onetwo()",100);
}
-->
</script>
#
#-----[ FIND 找尋 ]----------------------------------------------------------------
#
<body
#
#-----[ IN-LINE (AFTER) ADD 在之後(同一行)加 ]-------------------------------
#
onload={MOD_TIME}
#
#-----[ OPEN 打開 ]--------------------------------------------------------------
#
includes/page_header.php
#
#-----[ FIND 找尋 ]---------------------------------------------------------------
#
//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//
#
#-----[ AFTER ADD 之後加 ]---------------------------------------------------
#
if($board_config['mod_time']=="1"){
$mod_time="onetwo()";
}else if ($board_config['mod_time']=="0"){
$mod_time="twofour()";
}
#
#-----[ FIND 找尋 ]---------------------------------------------------------------
#
'NAV_LINKS' => $nav_links_html)

#
#-----[ BEFORE IT, ADD 在之前加 ]--------------------
#
'WELCOME_MESSAGE' => $board_config['welcome_message'],
'MOD_TIME' => $mod_time,
#
#-----[ OPEN 打開 ]----------------------------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND 找尋 ]----------------------------------------------------------------
#
"L_SITE_DESCRIPTION" => $lang['Site_desc'],
#
#-----[ AFTER ADD 之後加 ]------------------------------------------------------
#
"L_WELCOME_MESSAGE" => $lang['Welcome_message'],
"L_MOD_TIME" => $lang['Mod_time'],
#
#-----[ FIND 找尋 ]----------------------------------------------------------------
#
"SITE_DESCRIPTION" => $new['site_desc'],

#
#-----[ AFTER, ADD 之後加]-----------------------------------------------------
#
"WELCOME_MESSAGE" => $new['welcome_message'],
"MOD_TIME" => $new['mod_time'],
#
#-----[ OPEN 打開 ]------------------------------------------------
#
language\lang_chinese_traditional_taiwan\lang_admin.php
#
#-----[ FIND 找尋 ]-----------------------------------------------------------
#
$lang['Site_desc'] = '討論區描述';
#
#-----[ AFTER ADD 之後加 ]--------------------------------------------------
#
$lang['Welcome_message'] = '狀態列訊息';
$lang['Mod_time'] = '狀態列時間制';
#
#-----[ OPEN 打開 ]------------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND 尋找 ]------------------------------------------------
#
<tr>
<td class="row1">{L_SITE_DESCRIPTION}</td>
<td class="row2"><input class="post" type="text" size="40" maxlength="255" name="site_desc" value="{SITE_DESCRIPTION}" /></td>
</tr>
#
#-----[ AFTER, ADD 之後加 ]------------------------------------
#
<tr>
<td class="row1">{L_WELCOME_MESSAGE}</td>
<td class="row2"><input class="post" type="text" size="40" maxlength="255" name="welcome_message" value="{WELCOME_MESSAGE}" /></td>
</tr>
<tr>
<td class="row1">{L_MOD_TIME}<br>12小時制打1,24小時制打0</td>
<td class="row2"><input class="post" type="text" size="5" maxlength="1" name="mod_time" value="{MOD_TIME}" /></td>
</tr>
#
#-----[ ADD SQL 加入SQL語法 ]----------------------------------
#
INSERT INTO phpbb_config (config_name , config_value) VALUES ('welcome_message', '您好^_^');
INSERT INTO phpbb_config (config_name , config_value) VALUES ('mod_time', '1');
#
#-----[ SAVE CLOSE 存檔 關閉 ]
#
#EoM
有問題到
非官方推薦認證外掛討論
 網絡鎮
    關於網絡的
http://tytsim.net.ru  一個網絡鎮
主題已鎖定

回到「非官方認證外掛」