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

Annotation of /fenglin/www/search.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations)
Sat Mar 29 07:06:57 2025 UTC (11 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.10: +3 -2 lines
Add site name and domain to common.inc.php

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

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