bbssel.c
来自「bbs server linux平台下软件源码」· C语言 代码 · 共 58 行
C
58 行
/* * $Id: bbssel.c,v 1.8 2003/04/07 01:47:59 yuhuan Exp $ */#include "bbslib.h"int main(){ char *board, buf[80], *board1, *title; int i, total = 0; bcache_t *bc; init_all(); board = nohtml(getparm("board")); bc = getbcacheaddr(); if (board[0] == 0) { printf("%s -- 选择讨论区<hr color=green>\n", BBSNAME); printf("<form action=bbssel>\n"); printf("讨论区名称: <input type=text name=board>"); printf(" <input type=submit value=确定>"); printf("</form>\n"); } else { for (i = 0; i < MAXBOARD; i++) { board1 = bc[i].filename; if (!check_read_perm(currentuser, &bc[i])) continue; if (!strcasecmp(board, board1)) { sprintf(buf, "/bbsdoc.php?board=%s", board1); redirect(buf); http_quit(); } } printf("%s -- 选择讨论区<hr color=green>\n", BBSNAME); printf("找不到这个讨论区, ", board); printf("标题中含有'%s'的讨论区有: <br><br>\n", board); printf("<table>"); for (i = 0; i < MAXBOARD; i++) { board1 = bc[i].filename; title = bc[i].title; if (!check_read_perm(currentuser, &bc[i])) continue; if (strcasestr(board1, board) || strcasestr(title, board)) { total++; printf("<tr><td>%d", total); printf("<td><a href=/bbsdoc.php?board=%s>%s</a><td>%s<br>\n", board1, board1, title + 7); if (total == 1) { sprintf(buf, "/bbsdoc.php?board=%s", board1); } } } printf("</table><br>\n"); printf("共找到%d个符合条件的讨论区.\n", total); if (total == 1) { redirect(buf); } } http_quit();}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?