Small bug fix. :o
[iDB.git] / search.php
blob6cff9974a73b29b92d5a3171dcb477672c094fc8
1 <?php
2 /*
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2011 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
14 $FileInfo: search.php - Last Update: 06/17/2011 SVN 676 - Author: cooldude2k $
16 if(ini_get("register_globals")) {
17 require_once('inc/misc/killglobals.php'); }
18 require('preindex.php');
19 $usefileext = $Settings['file_ext'];
20 if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $usefileext = ""; }
21 $filewpath = $exfile['search'].$usefileext.$_SERVER['PATH_INFO'];
22 $idbactcheck = array("topic", "topics");
25 <link rel="search" type="application/opensearchdescription+xml" title="<?php echo $Settings['board_name']." ".$ThemeSet['TitleDivider']; ?> Search" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=opensearch",$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
26 <title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
27 </head>
28 <body>
29 <?php require($SettDir['inc'].'navbar.php');
30 if($Settings['enable_search']=="off"||
31 $GroupInfo['CanSearch']=="no") {
32 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
33 header("Content-Type: text/plain; charset=".$Settings['charset']);
34 ob_clean(); echo "Sorry you do not have permission to do a search."; $urlstatus = 302;
35 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
36 if($Settings['enable_search']=="on"||$GroupInfo['CanSearch']=="yes") {
37 if(!isset($_GET['search'])) { $_GET['search'] = null; }
38 if(!isset($_POST['search'])) { $_POST['search'] = null; }
39 if($_GET['search']==null&&
40 $_POST['search']!=null) {
41 $_GET['search'] = $_POST['search']; }
42 if(!isset($_GET['type'])) { $_GET['type'] = null; }
43 if(!isset($_POST['type'])) { $_POST['type'] = null; }
44 if($_GET['type']==null&&
45 $_POST['type']!=null) {
46 $_GET['type'] = $_POST['type']; }
47 if(!isset($_POST['act'])) { $_POST['act'] = null; }
48 if($_GET['act']==null||$_GET['act']=="topic"||
49 $_POST['act']=="topic"||$_POST['act']=="topics")
50 { $_GET['act']="topics"; }
51 if(!in_array($_GET['act'], $idbactcheck))
52 { $_GET['act']="topics"; }
53 if(!isset($_GET['msearch'])) { $_GET['msearch'] = null; }
54 if(!isset($_POST['msearch'])) { $_POST['msearch'] = null; }
55 if($_GET['msearch']==null&&
56 $_POST['msearch']!=null) {
57 $_GET['msearch'] = $_POST['msearch']; }
58 if($_GET['act']=="topics") {
59 require($SettDir['inc'].'searches.php'); } }
60 if($_GET['act']=="opensearch") {
61 redirect("location",$rbasedir.url_maker($exfile['rss'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss'],FALSE));
62 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
63 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
64 require($SettDir['inc'].'endpage.php');
65 if(!isset($_GET['search'])) { $_GET['search'] = null; }
67 </body>
68 </html>
69 <?php
70 if($_GET['search']==null&&$_GET['type']==null) {
71 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Searching",$Settings['use_gzip'],$GZipEncode['Type']); }
72 if($_GET['search']!=null&&$_GET['type']!=null) {
73 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$_GET['search'],$Settings['use_gzip'],$GZipEncode['Type']); }