回文章列表
作者itoc.bbs@cpu.tfcis.org (核心動力) 看板: itoc
標題Re: [請益] 看板人氣的問題
時間動力核心 (2007/05/15 Tue 08:21:49)
※ 引述《roga (任性)》之銘言:
>     請問板上的前輩,看板人氣的部份最近面臨了被灌水的問題,
>     主要具體狀況是有人開很多分身,然後灌同一個版的人氣,
>     目的是讓看板擠上熱門排行。
>     我需要一些辦法來遏止此種行為,目前想到的大概是
>     同一個 fromhost 不累積人氣,

  進站時檢查是否有人和自己來自同一個來源
  若有,進出看板不增減人氣

: global.h

VAR int total_user;
+ VAR int same_addr;

: bbsd.c:tn_login()

  bbstate = STAT_STARTED;
  utmp_setup(M_LOGIN);
+ same_addr = utmp_same_addr();

: bbsd.c:utmp_find() 新增此函式在 utmp_setup() 後面

static int
utmp_same_addr()
{
  UTMP *uentp, *uceil;
  int num;

  num = 0;
  uentp = ushm->uslot;
  uceil = (void *) uentp + ushm->offset;
  do
  {
    if (uentp->in_addr == cutmp->in_addr)
      num++;
  } while (++uentp <= uceil);

  return num;
}

: bbsd.c:u_exit()

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

: vote.c:vote_all()

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

: board.c:XoPost()

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


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