回文章列表
作者itoc.bbs@cpu.tfcis.org (核心動力) 看板: itoc
標題Re: 請問版友停留時間
時間動力核心 (2007/05/12 Sat 09:04:41)
※ 引述《maya (瑪雅)》之銘言:
> 我想要每個版主都能夠看到有哪幾個人各停留多久這樣,也許是
> F7   2007/05/11 13:32:33 停留32秒
> in2  2006/04/12 12:24:43 停留10000秒
> F7   2005/01/23 23:22:45 停留235秒
> 這樣子的資訊
> 也許在版內,版主多個快捷鍵可以看到這樣的資訊

: bbsd.c:u_exit()

  if (currbno >= 0)
+ {
    bshm->mantime[currbno]--;   /* 退出最後看的那個板 */
+   board_usies(currbno, 0);
+ }

: vote.c:vote_all()

        if (currbno >= 0)
+       {
          bshm->mantime[currbno]--;             /* 退出上一個板 */
+         board_usies(currbno, 0);
+       }
        bshm->mantime[redraw]++;                /* 進入新的板 */
+       board_usies(redraw, 1);

: board.c:XoPost()

    if (currbno >= 0)
+   {
      bshm->mantime[currbno]--;         /* 退出上一個板 */
+     board_usies(currbno, 0);
+   }
    bshm->mantime[bno]++;               /* 進入新的板 */
+   board_usies(bno, 1);

: board.c:board_usies() 新增此函式在 XoPost() 前面

void
board_usies(bno, in)
  int bno;
  int in;
{
  static time_t start;
  time_t now;
  char fpath[64], buf[80];

  if (in)    /* 進入看板,開始計算時間 */
  {
    time(&start);
  }
  else       /* 離開看板,結算時間 */
  {
    time(&now);
    brd_fpath(fpath, (bshm->bcache + bno)->brdname, "board_usies");
    sprintf(buf, "%s %s 停留%d秒", cuser.userid, Btime(&now), now - start);
    f_cat(fpath, buf);
  }
}

: maple.p

+ void board_usies(int bno, int in);
int XoPost(int bno);

: post.c:post_board_usies() 新增此函式於 post_help() 前面

static int
post_board_usies(xo)
  XO *xo;
{
  char fpath[64];

  brd_fpath(fpath, currboard, "board_usies");
  more(fpath, NULL);
}

: post.c:post_cb[]

+ 'i', post_board_usies,

  'h', post_help
};


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