作者Colorcloud.bbs@bbs.wretch.cc (彩雲追月~) 看板: itoc
標題Re: 如何警告使用者本頁有控制碼?
時間無名小站 (2007/09/08 Sat 15:16:55)
※ 引述《itoc.bbs@cpu.tfcis.org (核心動力)》之銘言:
感謝版大,控制碼警告在沒有超過一頁的問題解決了
但是和控制碼擴增結合起來的問題似乎仍然無效
您提供的方法我昨天試過了
雖然可以編譯,但是bbsd無法開啟,站台也就無法打開
這個功能要改兩個地方,我想edit應該不是問題的來源@@
以下是我改visio的地方,請您過目哪裡不對?
麻煩您了:)
#ifdef SHOW_USER_IN_TEXT
int
outx(str)
uschar *str;
{
int ch;
int control = 0;
char buf[20];
while (ch = *str)
{
/* itoc.020301: ESC + * + s 等控制碼 */
if (ch == KEY_ESC && str[1] == '*')
{
switch (str[2])
{
case 's': /* **s 顯示 ID */
outs(cuser.userid);
str += 3;
control = 1;
continue;
case 'n': /* **n 顯示暱稱 */
outs(cuser.username);
str += 3;
control = 1;
continue;
case 'l': /* **l 顯示上站次數 */
sprintf(buf, "%d", cuser.numlogins);
outs(buf);
str += 3;
control = 1;
continue;
case 'p': /* **p 顯示文章篇數*/
sprintf(buf, "%d", cuser.numposts);
outs(buf);
str += 3;
control = 1;
continue;
case 'g': /* **g 顯示金幣 */
sprintf(buf, "%d", cuser.gold);
outs(buf);
str += 3;
control = 1;
continue;
case 'm': /* **m 顯示銀幣 */
sprintf(buf, "%d", cuser.money);
outs(buf);
str += 3;
control = 1;
continue;
case 't': /* **t 顯示時間 */
outs(Now());
str += 3;
control = 1;
continue;
case 'u': /* **u 顯示線上人數 */
sprintf(buf, "%d", total_user);
outs(buf);
str += 3;
control = 1;
continue;
case 'b': /* **b 顯示生日 */
sprintf(buf, "%d/%d", cuser.month, cuser.day);
outs(buf);
str += 3;
control = 1;
continue;
}
}
outc(ch);
str++;
}
return control;
}
#endif
> + int
> outx(str)
> uschar *str;
> {
> int ch;
> + int control = 0;
> ...
> ...
> case 's': /* **s 顯示 ID */
> outs(cuser.userid);
> str += 3;
> + control = 1;
> continue;
> case 'n': /* **n 顯示暱稱 */
> outs(cuser.username);
> str += 3;
> + control = 1;
> continue;
> // 如果有做精華區這篇 [功能] visio.c 文章閱讀發表控制碼擴增
> // 那麼要在所有的 str += 3; 下一行加上 control = 1;
> ...
> ...
> }
> + return control;
> }
--
夫兵者不祥之器物或惡之故有道者不處君子居則貴左用兵則貴右兵者不祥之器非君子
之器不得已而用之恬淡為上勝而不美而美之者是樂殺人夫樂殺人者則不可得志於天下
矣吉事尚左凶事尚右偏將軍居左上將軍居右言以喪禮處之殺人之眾以哀悲泣之戰勝以
喪禮處之道常無名樸雖小天下莫能臣侯王若能守之萬物將自賓天地相合以降甘露民莫
之令而自均始制有名名亦既有夫亦將知止 219-69-98-22.idc.static.giga.net.tw海