| 42 |
int eol; |
int eol; |
| 43 |
int len; |
int len; |
| 44 |
int i; |
int i; |
| 45 |
|
char article_flag; |
| 46 |
|
time_t tm_now; |
| 47 |
|
|
| 48 |
|
time(&tm_now); |
| 49 |
|
|
| 50 |
clrline(4, 23); |
clrline(4, 23); |
| 51 |
|
|
| 52 |
for (i = 0; i < article_count; i++) |
for (i = 0; i < article_count; i++) |
| 53 |
{ |
{ |
| 54 |
|
article_flag = ' '; |
| 55 |
|
|
| 56 |
|
if (p_articles[i]->excerption) |
| 57 |
|
{ |
| 58 |
|
article_flag = 'm'; |
| 59 |
|
} |
| 60 |
|
else if (p_articles[i]->lock) |
| 61 |
|
{ |
| 62 |
|
article_flag = 'x'; |
| 63 |
|
} |
| 64 |
|
|
| 65 |
localtime_r(&p_articles[i]->sub_dt, &tm_sub); |
localtime_r(&p_articles[i]->sub_dt, &tm_sub); |
| 66 |
strftime(str_time, sizeof(str_time), "%b %e", &tm_sub); |
if (tm_now - p_articles[i]->sub_dt < 3600 * 24 * 365) |
| 67 |
strncpy(title_f, p_articles[i]->title, sizeof(title_f) - 1); |
{ |
| 68 |
|
strftime(str_time, sizeof(str_time), "%b %e ", &tm_sub); |
| 69 |
|
} |
| 70 |
|
else |
| 71 |
|
{ |
| 72 |
|
strftime(str_time, sizeof(str_time), "%m/%Y", &tm_sub); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
strncpy(title_f, (p_articles[i]->transship ? "[转载]" : ""), sizeof(title_f) - 1); |
| 76 |
title_f[sizeof(title_f) - 1] = '\0'; |
title_f[sizeof(title_f) - 1] = '\0'; |
| 77 |
|
strncat(title_f, p_articles[i]->title, sizeof(title_f) - 1 - strnlen(title_f, sizeof(title_f))); |
| 78 |
len = split_line(title_f, (p_articles[i]->tid == 0 ? 46 : 49), &eol, &title_f_len); |
len = split_line(title_f, (p_articles[i]->tid == 0 ? 46 : 49), &eol, &title_f_len); |
| 79 |
if (title_f[len] != '\0') |
if (title_f[len] != '\0') |
| 80 |
{ |
{ |
| 82 |
} |
} |
| 83 |
|
|
| 84 |
moveto(4 + i, 1); |
moveto(4 + i, 1); |
| 85 |
prints(" %7d %s%*s %s %s%s", |
prints(" %7d %c %s%*s %s %s%s", |
| 86 |
p_articles[i]->aid, |
p_articles[i]->aid, |
| 87 |
|
article_flag, |
| 88 |
p_articles[i]->username, |
p_articles[i]->username, |
| 89 |
BBS_username_max_len - (int)strnlen(p_articles[i]->username, sizeof(p_articles[i]->username)), |
BBS_username_max_len - (int)strnlen(p_articles[i]->username, sizeof(p_articles[i]->username)), |
| 90 |
"", |
"", |
| 112 |
moveto(2, 0); |
moveto(2, 0); |
| 113 |
prints("离开[\033[1;32m←\033[0;37m,\033[1;32mESC\033[0;37m] 选择[\033[1;32m↑\033[0;37m,\033[1;32m↓\033[0;37m] 阅读[\033[1;32m→\033[0;37m,\033[1;32mENTER\033[0;37m]\033[m"); |
prints("离开[\033[1;32m←\033[0;37m,\033[1;32mESC\033[0;37m] 选择[\033[1;32m↑\033[0;37m,\033[1;32m↓\033[0;37m] 阅读[\033[1;32m→\033[0;37m,\033[1;32mENTER\033[0;37m]\033[m"); |
| 114 |
moveto(3, 0); |
moveto(3, 0); |
| 115 |
prints("\033[44;37m \033[1;37m 编 号 发 布 者 日 期 文 章 标 题 \033[m"); |
prints("\033[44;37m \033[1;37m 编 号 发 布 者 日 期 文 章 标 题 \033[m"); |
| 116 |
show_bottom(""); |
show_bottom(""); |
| 117 |
|
|
| 118 |
return 0; |
return 0; |