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

Diff of /lbbs/src/section_list_display.c

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

Revision 1.16 by sysadm, Sun Jun 1 14:05:09 2025 UTC Revision 1.19 by sysadm, Sun Jun 8 09:25:25 2025 UTC
# Line 21  Line 21 
21  #include "io.h"  #include "io.h"
22  #include "screen.h"  #include "screen.h"
23  #include "log.h"  #include "log.h"
24    #include "user_priv.h"
25    #include "article_view_log.h"
26  #include "str_process.h"  #include "str_process.h"
27  #include <time.h>  #include <time.h>
28  #include <sys/param.h>  #include <sys/param.h>
# Line 49  static int section_list_draw_items(int p Line 51  static int section_list_draw_items(int p
51          int len;          int len;
52          int i;          int i;
53          char article_flag;          char article_flag;
54            int is_viewed;
55          time_t tm_now;          time_t tm_now;
56    
57          time(&tm_now);          time(&tm_now);
# Line 57  static int section_list_draw_items(int p Line 60  static int section_list_draw_items(int p
60    
61          for (i = 0; i < article_count; i++)          for (i = 0; i < article_count; i++)
62          {          {
63                  article_flag = ' ';                  if (p_articles[i]->uid == BBS_priv.uid)
64                    {
65                            is_viewed = 1;
66                    }
67                    else
68                    {
69                            is_viewed = article_view_log_is_viewed(p_articles[i]->aid, &BBS_article_view_log);
70                            if (is_viewed < 0)
71                            {
72                                    log_error("article_view_log_is_viewed(aid=%d) error\n", p_articles[i]->aid);
73                                    is_viewed = 0;
74                            }
75                    }
76    
77                    article_flag = (is_viewed ? ' ' : 'N');
78    
79                  if (p_articles[i]->excerption)                  if (p_articles[i]->excerption)
80                  {                  {
81                          article_flag = 'm';                          article_flag = (is_viewed ? 'm' : 'M');
82                  }                  }
83                  else if (p_articles[i]->lock)                  else if (p_articles[i]->lock && is_viewed)
84                  {                  {
85                          article_flag = 'x';                          article_flag = 'x';
86                  }                  }
# Line 417  int section_list_display(const char *sna Line 434  int section_list_display(const char *sna
434                                          break;                                          break;
435                                  }                                  }
436    
437                                  ret = display_data(cache.p_data, cache.line_total, cache.line_offsets, 1, 0,                                  ret = display_data(cache.p_data, cache.line_total, cache.line_offsets, 0,
438                                                                     display_article_key_handler, DATA_READ_HELP);                                                                     display_article_key_handler, DATA_READ_HELP);
439    
440                                  if (article_cache_unload(&cache) < 0)                                  if (article_cache_unload(&cache) < 0)
# Line 426  int section_list_display(const char *sna Line 443  int section_list_display(const char *sna
443                                          break;                                          break;
444                                  }                                  }
445    
446                                    // Update article_view_log
447                                    if (article_view_log_set_viewed(p_articles[selected_index]->aid, &BBS_article_view_log) < 0)
448                                    {
449                                            log_error("article_view_log_set_viewed(aid=%d) error\n", p_articles[selected_index]->aid);
450                                    }
451    
452                                  switch (ret)                                  switch (ret)
453                                  {                                  {
454                                  case KEY_UP:                                  case KEY_UP:


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

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