回精華區
作者itoc, 信區: itoc
標題[功能] gem.c 收文時標題附加作者 ID
時間04/01/10
作者: itoc (核心動力) 看板: itoc
標題: Re: 能不能像狂狷年少一樣
時間: 2004/01/10 Sat 19:35:07                           Updated: 2004/10/08

※ 引述《yenning.bbs@bbs.seehere.org (yenning~)》之銘言:
> 就是收文的時候  標題會加上作者ID

  適用 paste/gather

  ps. 如果是從精華區 c/p 到別的精華區
      由於精華區文章的作者會被改為板主
      所以附加的作者會是板主

: gem.c:gem_do_paste()

+ static int attach_author;     /* 1: 標題附加作者 */

static void
gem_do_paste(srcDir, dstDir, hdr, pos)

  ...
  ...

  strcpy(ghdr.owner, cuser.userid);
+ if (attach_author)
+   sprintf(ghdr.title, "%-51.51s %.18s", hdr->title, hdr->owner);
+ else
    strcpy(ghdr.title, hdr->title);

: gem.c:gem_paste()

  dir = xo->dir;
+ attach_author = (vans("是否附加原作者ID於標題(Y/N)?[N] ") == 'y');

  switch (ans = vans("存放位置 A)加到最後 .... E)附加檔案 Q)離開 [A] "))

: gem.c:gem_gather()

    case '2':
+     attach_author = (vans("是否附加原作者ID於標題(Y/N)?[N] ") == 'y');
      break;

  ...
  ...

      else      /* 分別建檔 */
      {
        hdr_stamp(folder, HDR_COPY | 'A', &ghdr, fpath);
        strcpy(ghdr.owner, cuser.userid);       /* 收錄用板主 id */
+       if (attach_author)
+         sprintf(ghdr.title, "%-51.51s %.18s", hdr->title, hdr->owner);
+       else
          strcpy(ghdr.title, hdr->title);
        ghdr.xmode = 0;                         /* xmode 是文章 */


--
  Origin:  Maple-itoc˙動力核心  processor.tfcis.org 
  Author: itoc itoc.Dorm11.NCTU.edu.tw 發表
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻