回文章列表
作者itoc.bbs@cpu.tfcis.org (核心動力) 看板: itoc
標題Re: 如何警告使用者本頁有控制碼?
時間動力核心 (2007/09/07 Fri 23:57:24)
※ 引述《Colorcloud.bbs@bbs.wretch.cc (彩雲追月~)》之銘言:
> 可是這樣似乎有點小bug
> 如果文章沒有超過一頁的話
> 不會跑出警告標語

: more.c:more()

    if (footer)         /* 有 footer */
    {
      if (footer != (char *) -1)
+     {
+       if (control)
+       {
+         outf(FOOTER_MORE3);
+         control = 0;
+       }
+       else
          outf(footer);
+     }
      else
        outs(str_ransi);
    }

: theme.h

: theme.h

#define FOOTER_MORE     \
COLOR1 " 瀏覽 P.%d (%d%%) " COLOR2 " ... (C)暫存 (←q)結束 "

#define FOOTER_MORE3     \
COLOR1 " 瀏覽文章 " COLOR2 "此頁包括控制碼,會顯示個人資訊 ... "
// 上面的 ... 是空格,到和 FOOTER_COSIGN 一樣長 


> 這個功能如何跟『文章閱讀發表控制碼擴增』的功能結合起來?

: visio.c:outx()

+ 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;
}

--
=[:摃��:﹎Origin ]|[  Ocpu.tfcis.org  ]|[�搟說:]=
=[:摃�╱�:Author ]|[61-216-42-68.dynamic.hinet]|[�:]=
文章選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻