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

Contents of /fenglin/www/search.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations)
Fri Mar 28 11:56:35 2025 UTC (11 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.9: +28 -14 lines
Refact

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

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