| 24 |
#include "log.h" |
#include "log.h" |
| 25 |
#include "login.h" |
#include "login.h" |
| 26 |
#include "menu.h" |
#include "menu.h" |
| 27 |
|
#include "menu_proc.h" |
| 28 |
#include "section_list_display.h" |
#include "section_list_display.h" |
| 29 |
#include "section_list_loader.h" |
#include "section_list_loader.h" |
| 30 |
#include "screen.h" |
#include "screen.h" |
| 53 |
LAST_TOPIC_ARTICLE, |
LAST_TOPIC_ARTICLE, |
| 54 |
SCAN_NEW_ARTICLE, |
SCAN_NEW_ARTICLE, |
| 55 |
VIEW_EX_DIR, |
VIEW_EX_DIR, |
| 56 |
|
SHOW_TOP10, |
| 57 |
}; |
}; |
| 58 |
|
|
| 59 |
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, ARTICLE *p_articles[], int article_count, int display_nickname, int ontop_start_offset) |
| 136 |
} |
} |
| 137 |
strncat(title_f, p_articles[i]->title + j, sizeof(title_f) - 1 - strnlen(title_f, sizeof(title_f))); |
strncat(title_f, p_articles[i]->title + j, sizeof(title_f) - 1 - strnlen(title_f, sizeof(title_f))); |
| 138 |
|
|
| 139 |
len = split_line(title_f, 47 - (display_nickname ? 8 : 0), &eol, &title_f_len, 1); |
len = split_line(title_f, 59 - (display_nickname ? BBS_nickname_max_len / 2 : BBS_username_max_len), &eol, &title_f_len, 1); |
| 140 |
if (title_f[len] != '\0') |
if (title_f[len] != '\0') |
| 141 |
{ |
{ |
| 142 |
title_f[len] = '\0'; |
title_f[len] = '\0'; |
| 366 |
return SHOW_HELP; |
return SHOW_HELP; |
| 367 |
case 'x': |
case 'x': |
| 368 |
return VIEW_EX_DIR; |
return VIEW_EX_DIR; |
| 369 |
|
case 'H': |
| 370 |
|
return SHOW_TOP10; |
| 371 |
default: |
default: |
| 372 |
} |
} |
| 373 |
|
|
| 514 |
int page_id_cur; |
int page_id_cur; |
| 515 |
const ARTICLE *p_article_locate; |
const ARTICLE *p_article_locate; |
| 516 |
|
|
| 517 |
p_section = section_list_find_by_name(sname, §ion_index); |
p_section = section_list_find_by_name(sname); |
| 518 |
if (p_section == NULL) |
if (p_section == NULL) |
| 519 |
{ |
{ |
| 520 |
log_error("Section %s not found\n", sname); |
log_error("Section %s not found\n", sname); |
| 521 |
return -1; |
return -1; |
| 522 |
} |
} |
| 523 |
|
|
| 524 |
|
if (!checkpriv(&BBS_priv, p_section->sid, S_LIST)) |
| 525 |
|
{ |
| 526 |
|
log_error("Forbid access to unauthorized section, sid=%d, uid=%d\n", |
| 527 |
|
p_section->sid, BBS_priv.uid); |
| 528 |
|
return -1; |
| 529 |
|
} |
| 530 |
|
|
| 531 |
|
section_index = get_section_index(p_section); |
| 532 |
|
|
| 533 |
if ((ret = section_list_rd_lock(p_section)) < 0) |
if ((ret = section_list_rd_lock(p_section)) < 0) |
| 534 |
{ |
{ |
| 535 |
log_error("section_list_rd_lock(sid = 0) error\n"); |
log_error("section_list_rd_lock(sid = 0) error\n"); |
| 554 |
else |
else |
| 555 |
{ |
{ |
| 556 |
aid_location = aid; |
aid_location = aid; |
| 557 |
} |
} |
| 558 |
|
|
| 559 |
// Locate at article with aid_locate |
// Locate at article with aid_locate |
| 560 |
if (aid_location > 0) |
if (aid_location > 0) |
| 977 |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
| 978 |
{ |
{ |
| 979 |
log_error("section_list_draw_screen() error\n"); |
log_error("section_list_draw_screen() error\n"); |
| 980 |
|
return -2; |
| 981 |
|
} |
| 982 |
|
break; |
| 983 |
|
case SHOW_TOP10: |
| 984 |
|
show_top10_menu(NULL); |
| 985 |
|
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
| 986 |
|
{ |
| 987 |
|
log_error("section_list_draw_screen() error\n"); |
| 988 |
return -2; |
return -2; |
| 989 |
} |
} |
| 990 |
break; |
break; |