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

Diff of /lbbs/src/article_favor.c

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

Revision 1.7 by sysadm, Tue Nov 4 13:49:50 2025 UTC Revision 1.11 by sysadm, Wed Dec 3 14:04:02 2025 UTC
# Line 3  Line 3 
3   * article_favor   * article_favor
4   *   - data model and basic operations of user favorite articles   *   - data model and basic operations of user favorite articles
5   *   *
6   * Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com>   * Copyright (C) 2004-2025  Leaflet <leaflet@leafok.com>
7   */   */
8    
9    #ifdef HAVE_CONFIG_H
10    #include "config.h"
11    #endif
12    
13  #include "article_favor.h"  #include "article_favor.h"
14  #include "common.h"  #include "common.h"
15  #include "database.h"  #include "database.h"
# Line 441  int article_favor_set(int32_t aid, ARTIC Line 445  int article_favor_set(int32_t aid, ARTIC
445          return 1; // Set complete          return 1; // Set complete
446  }  }
447    
448  int query_favor_articles(ARTICLE_FAVOR *p_favor, int page_id, ARTICLE **p_articles,  int query_favor_articles(ARTICLE_FAVOR *p_favor, int page_id, const ARTICLE **p_articles,
449                                                   char p_snames[][BBS_section_name_max_len + 1], int *p_article_count, int *p_page_count)                                                   char p_snames[][BBS_section_name_max_len + 1], int *p_article_count, int *p_page_count)
450  {  {
451          SECTION_LIST *p_section;          SECTION_LIST *p_section;
# Line 465  int query_favor_articles(ARTICLE_FAVOR * Line 469  int query_favor_articles(ARTICLE_FAVOR *
469                  return -2;                  return -2;
470          }          }
471    
472          *p_page_count = p_favor->aid_base_cnt / BBS_article_limit_per_page + (p_favor->aid_base_cnt % BBS_article_limit_per_page == 0 ? 0 : 1);          *p_page_count = (p_favor->aid_base_cnt + BBS_article_limit_per_page - 1) / BBS_article_limit_per_page;
473          *p_article_count = 0;          *p_article_count = 0;
474    
475          if (p_favor->aid_base_cnt == 0)          if (p_favor->aid_base_cnt == 0)


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

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