[緊急]我的外掛plus版怪怪地,

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

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

文章 *tytsim* »

用\r
<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 < 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>

行嗎??
以我來說應該對,
原來,
改php還易過改JAVASCRIPT.....
 網絡鎮
    關於網絡的
http://tytsim.net.ru  一個網絡鎮
~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

文章 ~倉木麻衣~ »

大致上是對了
不過這回換成中午12點的顯示有問題:P
中午12點應該是要顯示成 下午12點才對吧\r
判斷式再改一下就差不多OK了
*tytsim*
竹貓忠實會員
竹貓忠實會員
文章: 411
註冊時間: 2005-03-24 11:54
來自: 香港
聯繫:

文章 *tytsim* »

這樣用\r
<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>

行嗎??
 網絡鎮
    關於網絡的
http://tytsim.net.ru  一個網絡鎮
~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

文章 ~倉木麻衣~ »

也是可以
不過if (h = 12) 要寫成 if (h == 12) 才對
不然永遠會顯示為中午12點
*tytsim*
竹貓忠實會員
竹貓忠實會員
文章: 411
註冊時間: 2005-03-24 11:54
來自: 香港
聯繫:

文章 *tytsim* »

是啊,
想不到....
 網絡鎮
    關於網絡的
http://tytsim.net.ru  一個網絡鎮
DL
竹貓忠實會員
竹貓忠實會員
文章: 717
註冊時間: 2005-03-05 15:29

文章 DL »

JS比php易得很多=.=
主題已鎖定

回到「外掛問題討論」