/[LeafOK_CVS]/lbbs/src/user_stat.c
ViewVC logotype

Diff of /lbbs/src/user_stat.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 by sysadm, Thu Oct 23 04:09:33 2025 UTC Revision 1.6 by sysadm, Tue Nov 11 00:28:05 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /* SPDX-License-Identifier: GPL-3.0-or-later */
2                                                   user_list.c  -  description  /*
3                                                           -------------------   * user_stat
4          Copyright            : (C) 2004-2025 by Leaflet   *   - data model and basic operations of user related statistics
5          Email                : leaflet@leafok.com   *
6   ***************************************************************************/   * Copyright (C) 2004-2025  Leaflet <leaflet@leafok.com>
7     */
8  /***************************************************************************  
9   *                                                                         *  #ifdef HAVE_CONFIG_H
10   *   This program is free software; you can redistribute it and/or modify  *  #include "config.h"
11   *   it under the terms of the GNU General Public License as published by  *  #endif
  *   the Free Software Foundation; either version 3 of the License, or     *  
  *   (at your option) any later version.                                   *  
  *                                                                         *  
  ***************************************************************************/  
12    
13  #include "log.h"  #include "log.h"
14  #include "section_list.h"  #include "section_list.h"
# Line 75  int user_stat_map_update(USER_STAT_MAP * Line 71  int user_stat_map_update(USER_STAT_MAP *
71                          break;                          break;
72                  }                  }
73    
74                    if (p_article->visible == 0)
75                    {
76                            continue;
77                    }
78    
79                  if (p_article->uid > p_map->last_uid)                  if (p_article->uid > p_map->last_uid)
80                  {                  {
81  #ifdef _DEBUG  #ifdef _DEBUG
82                          log_error("uid=%d of article(aid=%d) is greater than last_uid=%d, waiting for next user list update\n",                          log_error("uid=%d of article(aid=%d) is greater than last_uid=%d\n",
83                                            p_article->uid, p_article->aid, p_map->last_uid);                                            p_article->uid, p_article->aid, p_map->last_uid);
84  #endif  #endif
85                          break;                          continue;
86                  }                  }
87    
88                  if (user_stat_article_cnt_inc(p_map, p_article->uid, 1) < 0)                  if (user_stat_article_cnt_inc(p_map, p_article->uid, 1) < 0)
# Line 116  int user_stat_article_cnt_inc(USER_STAT_ Line 117  int user_stat_article_cnt_inc(USER_STAT_
117                  mid = (left + right) / 2;                  mid = (left + right) / 2;
118                  if (uid < p_map->stat_list[mid].uid)                  if (uid < p_map->stat_list[mid].uid)
119                  {                  {
120                          right = mid;                          right = mid - 1;
121                  }                  }
122                  else if (uid > p_map->stat_list[mid].uid)                  else if (uid > p_map->stat_list[mid].uid)
123                  {                  {
# Line 158  int user_stat_get(USER_STAT_MAP *p_map, Line 159  int user_stat_get(USER_STAT_MAP *p_map,
159                  mid = (left + right) / 2;                  mid = (left + right) / 2;
160                  if (uid < p_map->stat_list[mid].uid)                  if (uid < p_map->stat_list[mid].uid)
161                  {                  {
162                          right = mid;                          right = mid - 1;
163                  }                  }
164                  else if (uid > p_map->stat_list[mid].uid)                  else if (uid > p_map->stat_list[mid].uid)
165                  {                  {


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1