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

Annotation of /fenglin/www/search.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide 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 sysadm 1.1 <?
2 sysadm 1.8 require_once "../lib/db_open.inc.php";
3 sysadm 1.1 ?>
4     <?
5     if (isset($_GET["type"]))
6     $type=$_GET["type"];
7     else
8     $type="";
9    
10     switch($type)
11     {
12     case "journal":
13 sysadm 1.7 $title="精品导读";
14 sysadm 1.1 break;
15     case "doc":
16 sysadm 1.7 $title="文档搜索";
17 sysadm 1.1 break;
18     case "author":
19 sysadm 1.7 $title="作者搜索";
20 sysadm 1.1 break;
21     default:
22 sysadm 1.7 $title="选择类别";
23 sysadm 1.1 break;
24     }
25     ?>
26     <html>
27     <head>
28 sysadm 1.7 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
29     <title>枫林在线 - 搜索</title>
30 sysadm 1.1 <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 sysadm 1.7 <td>枫林在线 &gt;&gt; <a href="search.php">搜索</a> &gt;&gt; <? echo $title; ?></td>
42 sysadm 1.1 <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 sysadm 1.7 <td align="center">- 论坛搜索 -</td>
60 sysadm 1.1 </tr>
61     <tr height=5>
62     <td></td>
63     </tr>
64     <tr height=20>
65 sysadm 1.7 <td align="center"><a href="search.php?type=journal">精品导读</a></td>
66 sysadm 1.1 </tr>
67     <tr height=20>
68 sysadm 1.7 <td align="center"><a href="search.php?type=doc">文档搜索</a></td>
69 sysadm 1.1 </tr>
70     <tr height=20>
71 sysadm 1.7 <td align="center"><a href="search.php?type=author">作者搜索</a></td>
72 sysadm 1.1 </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 sysadm 1.7 <option value="0">--请选择发布时间--</option>
97 sysadm 1.1 <?
98     $rs=mysql_query("select * from journal_index where enable order by dt");
99     while($row=mysql_fetch_array($rs))
100     {
101 sysadm 1.6 ?><option value="<? echo $row["JID"]; ?>"><? echo date("Y-m-d",strtotime($row["dt"]));?></option>
102 sysadm 1.1 <?
103     }
104     mysql_free_result($rs);
105     ?>
106     </select>
107 sysadm 1.7 <input type="submit" value="浏览" onclick="return (jid.value!='0');">
108 sysadm 1.1 </form>
109     <?
110     break;
111     case "doc":
112     ?>
113 sysadm 1.7 请选择版块,并输入查找内容,"%"为通配符。
114 sysadm 1.10 <form action="/bbs/bbs.php" method="get" target="_blank" onsubmit="return (sid.value != 0);">
115 sysadm 1.1 <select name="sid" value="0">
116 sysadm 1.7 <option value="0">--请选择版块--</option>
117 sysadm 1.1 <?
118 sysadm 1.10 $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 sysadm 1.1 {
128 sysadm 1.10 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 sysadm 1.1 <?
141 sysadm 1.10 }
142     ?>
143     <option value="<? echo $row["SID"];?>">&nbsp;&nbsp;├<? echo $row["s_title"]; ?></option>
144 sysadm 1.1 <?
145 sysadm 1.10 }
146     mysqli_free_result($rs);
147 sysadm 1.1 ?>
148     </select>
149     <input name="search_text" value="">
150 sysadm 1.10 <input type="submit" value="搜索">
151 sysadm 1.1 </form>
152     <?
153     break;
154     case "author":
155     ?>
156 sysadm 1.7 请输入查找内容,"%"为通配符。
157 sysadm 1.1 <form action="/bbs/search_user.php" method="get" target="_blank">
158     <input name="search_text" value="">
159 sysadm 1.7 <input type="submit" value="搜索">
160 sysadm 1.1 </form>
161     <?
162     break;
163     default:
164     ?>
165 sysadm 1.7 请从左侧列表选择查找类型。
166 sysadm 1.1 <?
167     }
168     ?>
169     </div>
170     </td>
171     </tr>
172     </table>
173     </td>
174     </tr>
175    
176     </table>
177     <?
178 sysadm 1.8 mysql_close($db_conn);
179    
180 sysadm 1.1 include "./foot.inc.php";
181     ?>
182     </center>
183     </body>
184     </html>

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