| 140 |
show_top(str_section_master, stitle, str_section_name); |
show_top(str_section_master, stitle, str_section_name); |
| 141 |
moveto(2, 0); |
moveto(2, 0); |
| 142 |
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] " |
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] " |
| 143 |
"阅读[\033[1;32m→\033[0;37m,\033[1;32mENTER\033[0;37m]\033[m %s[\033[1;32mn\033[0;37m]\033[m", |
"阅读[\033[1;32m→\033[0;37m,\033[1;32mENTER\033[0;37m] 发表[\033[1;32mCtrl-P\033[0;37m] " |
| 144 |
|
"修改[\033[1;32mE\033[0;37m] %s[\033[1;32mn\033[0;37m]\033[m", |
| 145 |
(display_nickname ? "显示用户名" : "显示昵称")); |
(display_nickname ? "显示用户名" : "显示昵称")); |
| 146 |
moveto(3, 0); |
moveto(3, 0); |
| 147 |
if (display_nickname) |
if (display_nickname) |
| 284 |
if (section_topic_view_mode) |
if (section_topic_view_mode) |
| 285 |
{ |
{ |
| 286 |
snprintf(p_ctx->msg, sizeof(p_ctx->msg), |
snprintf(p_ctx->msg, sizeof(p_ctx->msg), |
| 287 |
"| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] | " |
"| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] " |
| 288 |
"同主题阅读[\033[32m↑\033[33m/\033[32m↓\033[33m] | " |
"同主题阅读[\033[32m↑\033[33m/\033[32m↓\033[33m] " |
| 289 |
"模式[\033[32mp\033[33m] | 帮助[\033[32mh\033[33m] |"); |
"切换[\033[32mp\033[33m] 回复[\033[32mr\033[33m] 帮助[\033[32mh\033[33m] |"); |
| 290 |
} |
} |
| 291 |
else |
else |
| 292 |
{ |
{ |
| 293 |
snprintf(p_ctx->msg, sizeof(p_ctx->msg), |
snprintf(p_ctx->msg, sizeof(p_ctx->msg), |
| 294 |
"| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] | " |
"| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] " |
| 295 |
"移动[\033[32m↑\033[33m/\033[32m↓\033[33m/\033[32mPgUp\033[33m/\033[32mPgDn\033[33m] | " |
"移动[\033[32m↑\033[33m/\033[32m↓\033[33m/\033[32mPgUp\033[33m/\033[32mPgDn\033[33m] " |
| 296 |
"模式[\033[32mp\033[33m] | 帮助[\033[32mh\033[33m] |"); |
"切换[\033[32mp\033[33m] 回复[\033[32mr\033[33m] 帮助[\033[32mh\033[33m] |"); |
| 297 |
} |
} |
| 298 |
*p_key = 0; |
*p_key = 0; |
| 299 |
break; |
break; |
| 353 |
int ret; |
int ret; |
| 354 |
int loop; |
int loop; |
| 355 |
int direction; |
int direction; |
| 356 |
|
ARTICLE article_new; |
| 357 |
|
|
| 358 |
p_section = section_list_find_by_name(sname); |
p_section = section_list_find_by_name(sname); |
| 359 |
if (p_section == NULL) |
if (p_section == NULL) |
| 546 |
} |
} |
| 547 |
break; |
break; |
| 548 |
case 'r': // Reply article |
case 'r': // Reply article |
| 549 |
if (article_reply(p_section, p_articles[selected_index]) < 0) |
if (article_reply(p_section, p_articles[selected_index], &article_new) < 0) |
| 550 |
{ |
{ |
| 551 |
log_error("article_post(aid=%d, REPLY) error\n", p_articles[selected_index]->aid); |
log_error("article_post(aid=%d, REPLY) error\n", p_articles[selected_index]->aid); |
| 552 |
} |
} |
| 573 |
} |
} |
| 574 |
break; |
break; |
| 575 |
case POST_ARTICLE: |
case POST_ARTICLE: |
| 576 |
if (article_post(p_section) < 0) |
ret = article_post(p_section, &article_new); |
| 577 |
|
if (ret < 0) |
| 578 |
{ |
{ |
| 579 |
log_error("article_post(sid=%d, NEW) error\n", p_section->sid); |
log_error("article_post(sid=%d, NEW) error\n", p_section->sid); |
| 580 |
} |
} |
| 581 |
|
else if (ret > 0) // New article posted |
| 582 |
|
{ |
| 583 |
|
ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count); |
| 584 |
|
if (ret < 0) |
| 585 |
|
{ |
| 586 |
|
log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id); |
| 587 |
|
return -3; |
| 588 |
|
} |
| 589 |
|
} |
| 590 |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
| 591 |
{ |
{ |
| 592 |
log_error("section_list_draw_screen() error\n"); |
log_error("section_list_draw_screen() error\n"); |
| 598 |
{ |
{ |
| 599 |
break; |
break; |
| 600 |
} |
} |
| 601 |
if (article_modify(p_section, p_articles[selected_index]) < 0) |
if (article_modify(p_section, p_articles[selected_index], &article_new) < 0) |
| 602 |
{ |
{ |
| 603 |
log_error("article_post(aid=%d, EDIT) error\n", p_articles[selected_index]->aid); |
log_error("article_post(aid=%d, EDIT) error\n", p_articles[selected_index]->aid); |
| 604 |
} |
} |