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

Annotation of /fenglin/www/search.php

Parent Directory Parent Directory | Revision Log Revision Log


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

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