/[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.5 by sysadm, Tue Nov 4 14:58:56 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     */
 /***************************************************************************  
  *                                                                         *  
  *   This program is free software; you can redistribute it and/or modify  *  
  *   it under the terms of the GNU General Public License as published by  *  
  *   the Free Software Foundation; either version 3 of the License, or     *  
  *   (at your option) any later version.                                   *  
  *                                                                         *  
  ***************************************************************************/  
8    
9  #include "log.h"  #include "log.h"
10  #include "section_list.h"  #include "section_list.h"
# Line 75  int user_stat_map_update(USER_STAT_MAP * Line 67  int user_stat_map_update(USER_STAT_MAP *
67                          break;                          break;
68                  }                  }
69    
70                    if (p_article->visible == 0)
71                    {
72                            continue;
73                    }
74    
75                  if (p_article->uid > p_map->last_uid)                  if (p_article->uid > p_map->last_uid)
76                  {                  {
77  #ifdef _DEBUG  #ifdef _DEBUG
78                          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",
79                                            p_article->uid, p_article->aid, p_map->last_uid);                                            p_article->uid, p_article->aid, p_map->last_uid);
80  #endif  #endif
81                          break;                          continue;
82                  }                  }
83    
84                  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 113  int user_stat_article_cnt_inc(USER_STAT_
113                  mid = (left + right) / 2;                  mid = (left + right) / 2;
114                  if (uid < p_map->stat_list[mid].uid)                  if (uid < p_map->stat_list[mid].uid)
115                  {                  {
116                          right = mid;                          right = mid - 1;
117                  }                  }
118                  else if (uid > p_map->stat_list[mid].uid)                  else if (uid > p_map->stat_list[mid].uid)
119                  {                  {
# Line 158  int user_stat_get(USER_STAT_MAP *p_map, Line 155  int user_stat_get(USER_STAT_MAP *p_map,
155                  mid = (left + right) / 2;                  mid = (left + right) / 2;
156                  if (uid < p_map->stat_list[mid].uid)                  if (uid < p_map->stat_list[mid].uid)
157                  {                  {
158                          right = mid;                          right = mid - 1;
159                  }                  }
160                  else if (uid > p_map->stat_list[mid].uid)                  else if (uid > p_map->stat_list[mid].uid)
161                  {                  {


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

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