| 71 |
SEARCH_USER, |
SEARCH_USER, |
| 72 |
}; |
}; |
| 73 |
|
|
| 74 |
static int section_list_draw_items(int page_id, ARTICLE *p_articles[], int article_count, int display_nickname, int ontop_start_offset) |
static int section_list_draw_items(int page_id, const ARTICLE *p_articles[], int article_count, int display_nickname, int ontop_start_offset) |
| 75 |
{ |
{ |
| 76 |
char str_time[LINE_BUFFER_LEN]; |
char str_time[LINE_BUFFER_LEN]; |
| 77 |
struct tm tm_sub; |
struct tm tm_sub; |
| 270 |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
| 271 |
{ |
{ |
| 272 |
BBS_last_access_tm = time(NULL); |
BBS_last_access_tm = time(NULL); |
| 273 |
|
|
| 274 |
|
// Refresh current action |
| 275 |
|
if (user_online_update(NULL) < 0) |
| 276 |
|
{ |
| 277 |
|
log_error("user_online_update(NULL) error\n"); |
| 278 |
|
} |
| 279 |
} |
} |
| 280 |
|
|
| 281 |
switch (ch) |
switch (ch) |
| 590 |
char stitle[BBS_section_title_max_len + 1]; |
char stitle[BBS_section_title_max_len + 1]; |
| 591 |
char master_list[(BBS_username_max_len + 1) * 3 + 1]; |
char master_list[(BBS_username_max_len + 1) * 3 + 1]; |
| 592 |
char page_info_str[LINE_BUFFER_LEN]; |
char page_info_str[LINE_BUFFER_LEN]; |
| 593 |
ARTICLE *p_articles[BBS_article_limit_per_page]; |
const ARTICLE *p_articles[BBS_article_limit_per_page]; |
| 594 |
int article_count; |
int article_count; |
| 595 |
int page_count; |
int page_count; |
| 596 |
int ontop_start_offset; |
int ontop_start_offset; |
| 718 |
{ |
{ |
| 719 |
case EXIT_SECTION: |
case EXIT_SECTION: |
| 720 |
// Update current aid location |
// Update current aid location |
| 721 |
if (p_articles[selected_index] != NULL) |
if (selected_index < article_count && p_articles[selected_index] != NULL) |
| 722 |
{ |
{ |
| 723 |
if (selected_index >= ontop_start_offset) |
if (selected_index >= ontop_start_offset) |
| 724 |
{ |
{ |
| 1363 |
{ |
{ |
| 1364 |
MENU_SET ex_menu_set; |
MENU_SET ex_menu_set; |
| 1365 |
int ch = 0; |
int ch = 0; |
| 1366 |
|
int loop; |
| 1367 |
|
|
| 1368 |
if (p_section == NULL) |
if (p_section == NULL) |
| 1369 |
{ |
{ |
| 1396 |
|
|
| 1397 |
if (display_menu(&ex_menu_set) == 0) |
if (display_menu(&ex_menu_set) == 0) |
| 1398 |
{ |
{ |
| 1399 |
while (!SYS_server_exit) |
for (loop = 1; !SYS_server_exit && loop;) |
| 1400 |
{ |
{ |
| 1401 |
iflush(); |
iflush(); |
| 1402 |
ch = igetch(100); |
ch = igetch(100); |
| 1404 |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
| 1405 |
{ |
{ |
| 1406 |
BBS_last_access_tm = time(NULL); |
BBS_last_access_tm = time(NULL); |
| 1407 |
|
|
| 1408 |
|
// Refresh current action |
| 1409 |
|
if (user_online_update(NULL) < 0) |
| 1410 |
|
{ |
| 1411 |
|
log_error("user_online_update(NULL) error\n"); |
| 1412 |
|
} |
| 1413 |
} |
} |
| 1414 |
|
|
| 1415 |
switch (ch) |
switch (ch) |
| 1416 |
{ |
{ |
| 1417 |
case KEY_NULL: // broken pipe |
case KEY_NULL: // broken pipe |
| 1418 |
log_error("KEY_NULL\n"); |
log_error("KEY_NULL\n"); |
| 1419 |
return 0; |
loop = 0; |
| 1420 |
|
break; |
| 1421 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 1422 |
if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time) |
if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time) |
| 1423 |
{ |
{ |
| 1424 |
log_error("User input timeout\n"); |
log_error("User input timeout\n"); |
| 1425 |
return 0; |
loop = 0; |
| 1426 |
|
break; |
| 1427 |
} |
} |
| 1428 |
continue; |
continue; |
| 1429 |
case CR: |
case CR: |
| 1431 |
switch (menu_control(&ex_menu_set, ch)) |
switch (menu_control(&ex_menu_set, ch)) |
| 1432 |
{ |
{ |
| 1433 |
case EXITMENU: |
case EXITMENU: |
| 1434 |
ch = EXITMENU; |
loop = 0; |
| 1435 |
break; |
break; |
| 1436 |
case REDRAW: |
case REDRAW: |
| 1437 |
clearscr(); |
clearscr(); |
| 1444 |
break; |
break; |
| 1445 |
} |
} |
| 1446 |
} |
} |
|
|
|
|
if (ch == EXITMENU) |
|
|
{ |
|
|
break; |
|
|
} |
|
| 1447 |
} |
} |
| 1448 |
} |
} |
| 1449 |
|
|