| 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" |
| 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; |
| 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) |