| 30 |
#include "section_list_loader.h" |
#include "section_list_loader.h" |
| 31 |
#include "screen.h" |
#include "screen.h" |
| 32 |
#include "str_process.h" |
#include "str_process.h" |
| 33 |
|
#include "user_info_display.h" |
| 34 |
#include "user_priv.h" |
#include "user_priv.h" |
| 35 |
#include <string.h> |
#include <string.h> |
| 36 |
#include <time.h> |
#include <time.h> |
| 51 |
EDIT_ARTICLE, |
EDIT_ARTICLE, |
| 52 |
DELETE_ARTICLE, |
DELETE_ARTICLE, |
| 53 |
QUERY_ARTICLE, |
QUERY_ARTICLE, |
| 54 |
|
QUERY_USER, |
| 55 |
SET_FAVOR_ARTICLE, |
SET_FAVOR_ARTICLE, |
| 56 |
UNSET_FAVOR_ARTICLE, |
UNSET_FAVOR_ARTICLE, |
| 57 |
FIRST_TOPIC_ARTICLE, |
FIRST_TOPIC_ARTICLE, |
| 264 |
|
|
| 265 |
switch (ch) |
switch (ch) |
| 266 |
{ |
{ |
| 267 |
case KEY_NULL: // broken pipe |
case KEY_NULL: // broken pipe |
| 268 |
log_error("KEY_NULL\n"); |
log_error("KEY_NULL\n"); |
| 269 |
return EXIT_SECTION; |
return EXIT_SECTION; |
| 270 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 280 |
case 'n': |
case 'n': |
| 281 |
return CHANGE_NAME_DISPLAY; |
return CHANGE_NAME_DISPLAY; |
| 282 |
case CR: |
case CR: |
|
igetch_reset(); |
|
| 283 |
case 'r': |
case 'r': |
| 284 |
case KEY_RIGHT: |
case KEY_RIGHT: |
| 285 |
if (item_count > 0) |
if (item_count > 0) |
| 307 |
return QUERY_ARTICLE; |
return QUERY_ARTICLE; |
| 308 |
} |
} |
| 309 |
break; |
break; |
| 310 |
|
case Ctrl('A'): |
| 311 |
|
if (item_count > 0) |
| 312 |
|
{ |
| 313 |
|
return QUERY_USER; |
| 314 |
|
} |
| 315 |
|
break; |
| 316 |
case 'F': |
case 'F': |
| 317 |
if (item_count > 0) |
if (item_count > 0) |
| 318 |
{ |
{ |
| 413 |
case 'H': |
case 'H': |
| 414 |
return SHOW_TOP10; |
return SHOW_TOP10; |
| 415 |
default: |
default: |
| 416 |
|
break; |
| 417 |
} |
} |
| 418 |
|
|
| 419 |
if (old_page_id != *p_page_id) |
if (old_page_id != *p_page_id) |
| 557 |
ARTICLE article_new; |
ARTICLE article_new; |
| 558 |
int page_id_cur; |
int page_id_cur; |
| 559 |
const ARTICLE *p_article_locate; |
const ARTICLE *p_article_locate; |
| 560 |
|
USER_INFO user_info; |
| 561 |
|
|
| 562 |
p_section = section_list_find_by_name(sname); |
p_section = section_list_find_by_name(sname); |
| 563 |
if (p_section == NULL) |
if (p_section == NULL) |
| 952 |
return -2; |
return -2; |
| 953 |
} |
} |
| 954 |
break; |
break; |
| 955 |
|
case QUERY_USER: |
| 956 |
|
if ((ret = query_user_info_by_uid(p_articles[selected_index]->uid, &user_info)) < 0) |
| 957 |
|
{ |
| 958 |
|
log_error("query_user_info_by_uid(uid=%d) error\n", p_articles[selected_index]->uid); |
| 959 |
|
return -2; |
| 960 |
|
} |
| 961 |
|
else if (ret == 0) |
| 962 |
|
{ |
| 963 |
|
clearscr(); |
| 964 |
|
prints("该用户已升天"); |
| 965 |
|
press_any_key(); |
| 966 |
|
} |
| 967 |
|
else if (user_info_display(&user_info) < 0) // && ret > 0 |
| 968 |
|
{ |
| 969 |
|
log_error("user_info_display(uid=%d) error\n", p_articles[selected_index]->uid); |
| 970 |
|
} |
| 971 |
|
|
| 972 |
|
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
| 973 |
|
{ |
| 974 |
|
log_error("section_list_draw_screen() error\n"); |
| 975 |
|
return -2; |
| 976 |
|
} |
| 977 |
|
break; |
| 978 |
case SET_FAVOR_ARTICLE: |
case SET_FAVOR_ARTICLE: |
| 979 |
ret = article_favor_set(p_articles[selected_index]->tid == 0 |
ret = article_favor_set(p_articles[selected_index]->tid == 0 |
| 980 |
? p_articles[selected_index]->aid |
? p_articles[selected_index]->aid |
| 1145 |
} |
} |
| 1146 |
continue; |
continue; |
| 1147 |
case CR: |
case CR: |
|
igetch_reset(); |
|
| 1148 |
default: |
default: |
| 1149 |
switch (menu_control(&ex_menu_set, ch)) |
switch (menu_control(&ex_menu_set, ch)) |
| 1150 |
{ |
{ |