Yet another small update.
[iDB.git] / search.php
blob54c92df23d6b9a706c207f122bd49f53b3d3ccc9
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: 07/30/2011 SVN 729 - 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");
23 ob_start("idb_suboutput_handler");
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 <?php $iWrappers['EXTRALINKS'] = ob_get_clean();
27 ob_start("idb_suboutput_handler"); ?>
28 <title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
29 <?php $iWrappers['TITLETAG'] = ob_get_clean();
30 ob_start("idb_suboutput_handler"); ?>
31 </head>
32 <body>
33 <?php $iWrappers['BODYTAG'] = ob_get_clean();
34 ob_start("idb_suboutput_handler");
35 require($SettDir['inc'].'navbar.php');
36 $iWrappers['NAVBAR'] = ob_get_clean();
37 ob_start("idb_suboutput_handler");
38 if($Settings['enable_search']=="off"||
39 $GroupInfo['CanSearch']=="no") {
40 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
41 header("Content-Type: text/plain; charset=".$Settings['charset']);
42 ob_clean(); echo "Sorry you do not have permission to do a search."; $urlstatus = 302;
43 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
44 if($Settings['enable_search']=="on"||$GroupInfo['CanSearch']=="yes") {
45 if(!isset($_GET['search'])) { $_GET['search'] = null; }
46 if(!isset($_POST['search'])) { $_POST['search'] = null; }
47 if($_GET['search']==null&&
48 $_POST['search']!=null) {
49 $_GET['search'] = $_POST['search']; }
50 if(!isset($_GET['type'])) { $_GET['type'] = null; }
51 if(!isset($_POST['type'])) { $_POST['type'] = null; }
52 if($_GET['type']==null&&
53 $_POST['type']!=null) {
54 $_GET['type'] = $_POST['type']; }
55 if(!isset($_POST['act'])) { $_POST['act'] = null; }
56 if($_GET['act']==null||$_GET['act']=="topic"||
57 $_POST['act']=="topic"||$_POST['act']=="topics")
58 { $_GET['act']="topics"; }
59 if(!in_array($_GET['act'], $idbactcheck))
60 { $_GET['act']="topics"; }
61 if(!isset($_GET['msearch'])) { $_GET['msearch'] = null; }
62 if(!isset($_POST['msearch'])) { $_POST['msearch'] = null; }
63 if($_GET['msearch']==null&&
64 $_POST['msearch']!=null) {
65 $_GET['msearch'] = $_POST['msearch']; }
66 if($_GET['act']=="topics") {
67 require($SettDir['inc'].'searches.php'); } }
68 if($_GET['act']=="opensearch") {
69 redirect("location",$rbasedir.url_maker($exfile['rss'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss'],FALSE));
70 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
71 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
72 $iWrappers['CONTENT'] = ob_get_clean();
73 ob_start("idb_suboutput_handler");
74 require($SettDir['inc'].'endpage.php');
75 $iWrappers['COPYRIGHT'] = ob_get_clean();
76 ob_start("idb_suboutput_handler");
77 if(!isset($_GET['search'])) { $_GET['search'] = null; }
79 </body>
80 </html>
81 <?php
82 $iWrappers['HTMLEND'] = ob_get_clean();
83 require($SettDir['inc'].'iwrapper.php');
84 if($_GET['search']==null&&$_GET['type']==null) {
85 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Searching",$Settings['use_gzip'],$GZipEncode['Type']); }
86 if($_GET['search']!=null&&$_GET['type']!=null) {
87 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$_GET['search'],$Settings['use_gzip'],$GZipEncode['Type']); }