/[LeafOK_CVS]/fenglin/www/search.php
ViewVC logotype

Contents of /fenglin/www/search.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations)
Fri Apr 11 12:47:00 2025 UTC (11 months ago) by sysadm
Branch: MAIN
Changes since 1.11: +30 -20 lines
Refact section_list

1 <?
2 require_once "../lib/common.inc.php";
3 require_once "../lib/db_open.inc.php";
4 require_once "../bbs/session_init.inc.php";
5 ?>
6 <?
7 if (isset($_GET["type"]))
8 $type=$_GET["type"];
9 else
10 $type="";
11
12 switch($type)
13 {
14 case "journal":
15 $title="精品导读";
16 break;
17 case "doc":
18 $title="文档搜索";
19 break;
20 case "author":
21 $title="作者搜索";
22 break;
23 default:
24 $title="选择类别";
25 break;
26 }
27 ?>
28 <html>
29 <head>
30 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
31 <title><? echo $BBS_name; ?> - 搜索</title>
32 <link rel="stylesheet" href="css/default.css" type="text/css">
33 </head>
34
35 <body>
36 <center>
37 <?
38 include "./head.inc.php";
39 ?>
40 <table width="760" border="0" cellpadding="0" cellspacing="0">
41 <tr height=20 bgcolor=#F3F9FC>
42 <td width="20">&nbsp;</td>
43 <td><? echo $BBS_name; ?> &gt;&gt; <a href="search.php">搜索</a> &gt;&gt; <? echo $title; ?></td>
44 <td width="20">&nbsp;</td>
45 </tr>
46 <tr>
47 <td colspan=3 height=1 bgcolor=gray></td>
48 </tr>
49 <tr height=5>
50 <td>&nbsp;</td>
51 </tr>
52 </table>
53 <table width="760" border="0" cellpadding="0" cellspacing="0">
54 <tr>
55 <td width="20%" align="center" valign="top" class="td2">
56 <table width="80%" border="0" cellpadding="0" cellspacing="0">
57 <tr height=20>
58 <td></td>
59 </tr>
60 <tr height=30 class="title_bar_5">
61 <td align="center">- 论坛搜索 -</td>
62 </tr>
63 <tr height=5>
64 <td></td>
65 </tr>
66 <tr height=20>
67 <td align="center"><a href="search.php?type=journal">精品导读</a></td>
68 </tr>
69 <tr height=20>
70 <td align="center"><a href="search.php?type=doc">文档搜索</a></td>
71 </tr>
72 <tr height=20>
73 <td align="center"><a href="search.php?type=author">作者搜索</a></td>
74 </tr>
75 <tr height=20>
76 <td></td>
77 </tr>
78 </table>
79 </td>
80 <td width="80%" align="center" valign="top">
81 <table width="80%" border="0" cellpadding="0" cellspacing="0">
82 <tr height="20">
83 <td></td>
84 </tr>
85 <tr height="30" class="title_bar_6">
86 <td><? echo $title; ?></td>
87 </tr>
88 <tr>
89 <td class="td4">
90 <div style="margin:10px;" align="center">
91 <?
92 switch($type)
93 {
94 case "journal":
95 ?>
96 <form action="journal.php" method="get" target="_blank">
97 <select name="jid" value="0">
98 <option value="0">--请选择发布时间--</option>
99 <?
100 $rs=mysql_query("select * from journal_index where enable order by dt");
101 while($row=mysql_fetch_array($rs))
102 {
103 ?><option value="<? echo $row["JID"]; ?>"><? echo date("Y-m-d",strtotime($row["dt"]));?></option>
104 <?
105 }
106 mysql_free_result($rs);
107 ?>
108 </select>
109 <input type="submit" value="浏览" onclick="return (jid.value!='0');">
110 </form>
111 <?
112 break;
113 case "doc":
114 ?>
115 请选择版块,并输入查找内容,"%"为通配符。
116 <form action="/bbs/list.php" method="get" target="_blank" onsubmit="return (sid.value != 0);">
117 <select name="sid" value="0">
118 <option value="0">--请选择版块--</option>
119 <?
120 require_once "../bbs/section_list.inc.php";
121
122 // Load favorite section list
123 $section_hierachy = array();
124
125 $ret = load_section_list($section_hierachy,
126 function (int $sid) : bool
127 {
128 global $s_favor;
129 return ($_SESSION["BBS_priv"]->checkpriv($sid, S_LIST));
130 },
131 function (int $sid) : mixed
132 {
133 return null;
134 },
135 $db_conn);
136
137 if ($ret == false)
138 {
139 ?>
140 <option value="0">---数据查询错误---</option>
141 <?
142 }
143
144 foreach ($section_hierachy as $c_index => $section_class)
145 {
146 ?>
147 <option value="0">==<? echo $section_class["title"]; ?>==</option>
148 <?
149 foreach ($section_class["sections"] as $s_index => $section)
150 {
151 ?>
152 <option value="<? echo $section["sid"]; ?>">&nbsp;&nbsp;├<? echo $section["title"]; ?></option>
153 <?
154 }
155 }
156
157 unset($section_hierachy);
158 ?>
159 </select>
160 <input name="search_text" value="">
161 <input type="submit" value="搜索">
162 </form>
163 <?
164 break;
165 case "author":
166 ?>
167 请输入查找内容,"%"为通配符。
168 <form action="/bbs/search_user.php" method="get" target="_blank">
169 <input name="search_text" value="">
170 <input type="submit" value="搜索">
171 </form>
172 <?
173 break;
174 default:
175 ?>
176 请从左侧列表选择查找类型。
177 <?
178 }
179 ?>
180 </div>
181 </td>
182 </tr>
183 </table>
184 </td>
185 </tr>
186
187 </table>
188 <?
189 mysql_close($db_conn);
190
191 include "./foot.inc.php";
192 ?>
193 </center>
194 </body>
195 </html>

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1