/[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.17 by sysadm, Sat Jun 7 10:00:10 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 "article_view_log.h"
25  #include "str_process.h"  #include "str_process.h"
26  #include <time.h>  #include <time.h>
27  #include <sys/param.h>  #include <sys/param.h>
# Line 49  static int section_list_draw_items(int p Line 50  static int section_list_draw_items(int p
50          int len;          int len;
51          int i;          int i;
52          char article_flag;          char article_flag;
53            int is_viewed;
54          time_t tm_now;          time_t tm_now;
55    
56          time(&tm_now);          time(&tm_now);
# Line 57  static int section_list_draw_items(int p Line 59  static int section_list_draw_items(int p
59    
60          for (i = 0; i < article_count; i++)          for (i = 0; i < article_count; i++)
61          {          {
62                  article_flag = ' ';                  is_viewed = article_view_log_is_viewed(p_articles[i]->aid, &BBS_article_view_log);
63                    if (is_viewed < 0)
64                    {
65                            log_error("article_view_log_is_viewed(aid=%d) error\n", p_articles[i]->aid);
66                            is_viewed = 0;
67                    }
68    
69                    article_flag = (is_viewed ? ' ' : 'N');
70    
71                  if (p_articles[i]->excerption)                  if (p_articles[i]->excerption)
72                  {                  {
73                          article_flag = 'm';                          article_flag = (is_viewed ? 'm' : 'M');
74                  }                  }
75                  else if (p_articles[i]->lock)                  else if (p_articles[i]->lock && is_viewed)
76                  {                  {
77                          article_flag = 'x';                          article_flag = 'x';
78                  }                  }
# Line 426  int section_list_display(const char *sna Line 435  int section_list_display(const char *sna
435                                          break;                                          break;
436                                  }                                  }
437    
438                                    // Update article_view_log
439                                    if (article_view_log_set_viewed(p_articles[selected_index]->aid, &BBS_article_view_log) < 0)
440                                    {
441                                            log_error("article_view_log_set_viewed(aid=%d) error\n", p_articles[selected_index]->aid);
442                                    }
443    
444                                  switch (ret)                                  switch (ret)
445                                  {                                  {
446                                  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