| 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) |
| 237 |
(*p_page_id)++; |
(*p_page_id)++; |
| 238 |
*p_selected_index = 0; |
*p_selected_index = 0; |
| 239 |
} |
} |
| 240 |
|
else // end of last page |
| 241 |
|
{ |
| 242 |
|
return CHANGE_PAGE; // force refresh pages |
| 243 |
|
} |
| 244 |
} |
} |
| 245 |
else |
else |
| 246 |
{ |
{ |
| 288 |
if (section_topic_view_mode) |
if (section_topic_view_mode) |
| 289 |
{ |
{ |
| 290 |
snprintf(p_ctx->msg, sizeof(p_ctx->msg), |
snprintf(p_ctx->msg, sizeof(p_ctx->msg), |
| 291 |
"| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] | " |
"| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] " |
| 292 |
"同主题阅读[\033[32m↑\033[33m/\033[32m↓\033[33m] | " |
"同主题阅读[\033[32m↑\033[33m/\033[32m↓\033[33m] " |
| 293 |
"模式[\033[32mp\033[33m] | 帮助[\033[32mh\033[33m] |"); |
"切换[\033[32mp\033[33m] 回复[\033[32mr\033[33m] 帮助[\033[32mh\033[33m] |"); |
| 294 |
} |
} |
| 295 |
else |
else |
| 296 |
{ |
{ |
| 297 |
snprintf(p_ctx->msg, sizeof(p_ctx->msg), |
snprintf(p_ctx->msg, sizeof(p_ctx->msg), |
| 298 |
"| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] | " |
"| 返回[\033[32m←\033[33m,\033[32mESC\033[33m] " |
| 299 |
"移动[\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] " |
| 300 |
"模式[\033[32mp\033[33m] | 帮助[\033[32mh\033[33m] |"); |
"切换[\033[32mp\033[33m] 回复[\033[32mr\033[33m] 帮助[\033[32mh\033[33m] |"); |
| 301 |
} |
} |
| 302 |
*p_key = 0; |
*p_key = 0; |
| 303 |
break; |
break; |
| 357 |
int ret; |
int ret; |
| 358 |
int loop; |
int loop; |
| 359 |
int direction; |
int direction; |
| 360 |
|
ARTICLE article_new; |
| 361 |
|
|
| 362 |
p_section = section_list_find_by_name(sname); |
p_section = section_list_find_by_name(sname); |
| 363 |
if (p_section == NULL) |
if (p_section == NULL) |
| 550 |
} |
} |
| 551 |
break; |
break; |
| 552 |
case 'r': // Reply article |
case 'r': // Reply article |
| 553 |
if (article_reply(p_section, p_articles[selected_index]) < 0) |
if (article_reply(p_section, p_articles[selected_index], &article_new) < 0) |
| 554 |
{ |
{ |
| 555 |
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); |
| 556 |
} |
} |
| 577 |
} |
} |
| 578 |
break; |
break; |
| 579 |
case POST_ARTICLE: |
case POST_ARTICLE: |
| 580 |
if (article_post(p_section) < 0) |
ret = article_post(p_section, &article_new); |
| 581 |
|
if (ret < 0) |
| 582 |
{ |
{ |
| 583 |
log_error("article_post(sid=%d, NEW) error\n", p_section->sid); |
log_error("article_post(sid=%d, NEW) error\n", p_section->sid); |
| 584 |
} |
} |
| 585 |
|
else if (ret > 0) // New article posted |
| 586 |
|
{ |
| 587 |
|
ret = query_section_articles(p_section, page_id, p_articles, &article_count, &page_count); |
| 588 |
|
if (ret < 0) |
| 589 |
|
{ |
| 590 |
|
log_error("query_section_articles(sid=%d, page_id=%d) error\n", p_section->sid, page_id); |
| 591 |
|
return -3; |
| 592 |
|
} |
| 593 |
|
} |
| 594 |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
| 595 |
{ |
{ |
| 596 |
log_error("section_list_draw_screen() error\n"); |
log_error("section_list_draw_screen() error\n"); |
| 602 |
{ |
{ |
| 603 |
break; |
break; |
| 604 |
} |
} |
| 605 |
if (article_modify(p_section, p_articles[selected_index]) < 0) |
if (article_modify(p_section, p_articles[selected_index], &article_new) < 0) |
| 606 |
{ |
{ |
| 607 |
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); |
| 608 |
} |
} |