Small update. :P
[iDB.git] / search.php
blob7cb5099161378ae6e4e0df51bbe99f845e04f15b
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: 12/28/2010 SVN 607 - 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'];
24 <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']); ?>" />
25 <title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
26 </head>
27 <body>
28 <?php require($SettDir['inc'].'navbar.php');
29 if($Settings['enable_search']=="off"||
30 $GroupInfo['CanSearch']=="no") {
31 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
32 header("Content-Type: text/plain; charset=".$Settings['charset']);
33 ob_clean(); echo "Sorry you do not have permission to do a search.";
34 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
35 if($Settings['enable_search']=="on"||$GroupInfo['CanSearch']=="yes") {
36 if(!isset($_GET['search'])) { $_GET['search'] = null; }
37 if(!isset($_POST['search'])) { $_POST['search'] = null; }
38 if($_GET['search']==null&&
39 $_POST['search']!=null) {
40 $_GET['search'] = $_POST['search']; }
41 if(!isset($_GET['type'])) { $_GET['type'] = null; }
42 if(!isset($_POST['type'])) { $_POST['type'] = null; }
43 if($_GET['type']==null&&
44 $_POST['type']!=null) {
45 $_GET['type'] = $_POST['type']; }
46 if(!isset($_POST['act'])) { $_POST['act'] = null; }
47 if($_GET['act']==null||$_GET['act']=="topic"||
48 $_POST['act']=="topic"||$_POST['act']=="topics")
49 { $_GET['act']="topics"; }
50 if(!isset($_GET['msearch'])) { $_GET['msearch'] = null; }
51 if(!isset($_POST['msearch'])) { $_POST['msearch'] = null; }
52 if($_GET['msearch']==null&&
53 $_POST['msearch']!=null) {
54 $_GET['msearch'] = $_POST['msearch']; }
55 if($_GET['act']=="topics") {
56 require($SettDir['inc'].'searches.php'); } }
57 if($_GET['act']=="opensearch") {
58 redirect("location",$rbasedir.url_maker($exfile['rss'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss'],FALSE));
59 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
60 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
61 require($SettDir['inc'].'endpage.php');
62 if(!isset($_GET['search'])) { $_GET['search'] = null; }
64 </body>
65 </html>
66 <?php
67 if($_GET['search']==null&&$_GET['type']==null) {
68 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Searching",$Settings['use_gzip'],$GZipEncode['Type']); }
69 if($_GET['search']!=null&&$_GET['type']!=null) {
70 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$_GET['search'],$Settings['use_gzip'],$GZipEncode['Type']); }