| 14 |
* * |
* * |
| 15 |
***************************************************************************/ |
***************************************************************************/ |
| 16 |
|
|
|
#include "section_list_display.h" |
|
|
#include "section_list_loader.h" |
|
| 17 |
#include "article_cache.h" |
#include "article_cache.h" |
| 18 |
#include "article_post.h" |
#include "article_post.h" |
| 19 |
|
#include "article_view_log.h" |
| 20 |
#include "article_del.h" |
#include "article_del.h" |
| 21 |
#include "common.h" |
#include "common.h" |
| 22 |
#include "io.h" |
#include "io.h" |
|
#include "screen.h" |
|
| 23 |
#include "log.h" |
#include "log.h" |
| 24 |
#include "user_priv.h" |
#include "login.h" |
| 25 |
#include "article_view_log.h" |
#include "section_list_display.h" |
| 26 |
|
#include "section_list_loader.h" |
| 27 |
|
#include "screen.h" |
| 28 |
#include "str_process.h" |
#include "str_process.h" |
| 29 |
|
#include "user_priv.h" |
| 30 |
#include <string.h> |
#include <string.h> |
| 31 |
#include <time.h> |
#include <time.h> |
| 32 |
#include <sys/param.h> |
#include <sys/param.h> |
| 467 |
show_bottom(page_info_str); |
show_bottom(page_info_str); |
| 468 |
iflush(); |
iflush(); |
| 469 |
|
|
| 470 |
|
if (user_online_update(sname) < 0) |
| 471 |
|
{ |
| 472 |
|
log_error("user_online_update(%s) error\n", sname); |
| 473 |
|
} |
| 474 |
|
|
| 475 |
ret = section_list_select(page_count, article_count, &page_id, &selected_index); |
ret = section_list_select(page_count, article_count, &page_id, &selected_index); |
| 476 |
switch (ret) |
switch (ret) |
| 477 |
{ |
{ |
| 504 |
break; |
break; |
| 505 |
} |
} |
| 506 |
|
|
| 507 |
|
if (user_online_update("VIEW_ARTICLE") < 0) |
| 508 |
|
{ |
| 509 |
|
log_error("user_online_update(VIEW_ARTICLE) error\n"); |
| 510 |
|
} |
| 511 |
|
|
| 512 |
ret = display_data(cache.p_data, cache.line_total, cache.line_offsets, 0, |
ret = display_data(cache.p_data, cache.line_total, cache.line_offsets, 0, |
| 513 |
display_article_key_handler, DATA_READ_HELP); |
display_article_key_handler, DATA_READ_HELP); |
| 514 |
|
|
| 611 |
} |
} |
| 612 |
break; |
break; |
| 613 |
case 'r': // Reply article |
case 'r': // Reply article |
| 614 |
|
if (user_online_update("REPLY_ARTICLE") < 0) |
| 615 |
|
{ |
| 616 |
|
log_error("user_online_update(REPLY_ARTICLE) error\n"); |
| 617 |
|
} |
| 618 |
|
|
| 619 |
if (article_reply(p_section, p_articles[selected_index], &article_new) < 0) |
if (article_reply(p_section, p_articles[selected_index], &article_new) < 0) |
| 620 |
{ |
{ |
| 621 |
log_error("article_post(aid=%d, REPLY) error\n", p_articles[selected_index]->aid); |
log_error("article_reply(aid=%d) error\n", p_articles[selected_index]->aid); |
| 622 |
} |
} |
| 623 |
loop = 1; |
loop = 1; |
| 624 |
break; |
break; |
| 662 |
} |
} |
| 663 |
break; |
break; |
| 664 |
case POST_ARTICLE: |
case POST_ARTICLE: |
| 665 |
|
if (user_online_update("POST_ARTICLE") < 0) |
| 666 |
|
{ |
| 667 |
|
log_error("user_online_update(POST_ARTICLE) error\n"); |
| 668 |
|
} |
| 669 |
|
|
| 670 |
if ((ret = article_post(p_section, &article_new)) < 0) |
if ((ret = article_post(p_section, &article_new)) < 0) |
| 671 |
{ |
{ |
| 672 |
log_error("article_post(sid=%d) error\n", p_section->sid); |
log_error("article_post(sid=%d) error\n", p_section->sid); |
| 692 |
{ |
{ |
| 693 |
break; // No permission |
break; // No permission |
| 694 |
} |
} |
| 695 |
|
|
| 696 |
|
if (user_online_update("EDIT_ARTICLE") < 0) |
| 697 |
|
{ |
| 698 |
|
log_error("user_online_update() error\n"); |
| 699 |
|
} |
| 700 |
|
|
| 701 |
if (article_modify(p_section, p_articles[selected_index], &article_new) < 0) |
if (article_modify(p_section, p_articles[selected_index], &article_new) < 0) |
| 702 |
{ |
{ |
| 703 |
log_error("article_modify(aid=%d) error\n", p_articles[selected_index]->aid); |
log_error("article_modify(aid=%d) error\n", p_articles[selected_index]->aid); |