Small update
[iDB.git] / search.php
blob0a2d8d4b3e033ff5cda582c0904bdffba8348114
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-2019 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12 Copyright 2004-2019 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
14 $FileInfo: search.php - Last Update: 08/02/2019 SVN 905 - 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", "getactive");
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($_GET['act']=="getactive") {
46 $_GET['act'] = "topics";
47 $_GET['type'] = "getactive"; }
48 if(isset($_GET['type'])&&$_GET['type']=="getactive") {
49 $_POST['type'] = "getactive"; }
50 if(!isset($_GET['search'])) { $_GET['search'] = null; }
51 if(!isset($_POST['search'])) { $_POST['search'] = null; }
52 if($_GET['search']==null&&
53 $_POST['search']!=null) {
54 $_GET['search'] = $_POST['search']; }
55 if(!isset($_GET['type'])) { $_GET['type'] = null; }
56 if(!isset($_POST['type'])) { $_POST['type'] = null; }
57 if($_GET['type']==null&&
58 $_POST['type']!=null) {
59 $_GET['type'] = $_POST['type']; }
60 if(!isset($_POST['act'])) { $_POST['act'] = null; }
61 if($_GET['act']==null||$_GET['act']=="topic"||
62 $_POST['act']=="topic"||$_POST['act']=="topics")
63 { $_GET['act']="topics"; }
64 if(!in_array($_GET['act'], $idbactcheck))
65 { $_GET['act']="topics"; }
66 if(!isset($_GET['msearch'])) { $_GET['msearch'] = null; }
67 if(!isset($_POST['msearch'])) { $_POST['msearch'] = null; }
68 if($_GET['msearch']==null&&
69 $_POST['msearch']!=null) {
70 $_GET['msearch'] = $_POST['msearch']; }
71 if($_GET['act']=="topics") {
72 require($SettDir['inc'].'searches.php'); } }
73 if($_GET['act']=="opensearch") {
74 redirect("location",$rbasedir.url_maker($exfile['rss'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss'],FALSE));
75 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
76 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
77 $iWrappers['CONTENT'] = ob_get_clean();
78 ob_start("idb_suboutput_handler");
79 require($SettDir['inc'].'endpage.php');
80 $iWrappers['COPYRIGHT'] = ob_get_clean();
81 ob_start("idb_suboutput_handler");
82 if(!isset($_GET['search'])) { $_GET['search'] = null; }
84 </body>
85 </html>
86 <?php
87 $iWrappers['HTMLEND'] = ob_get_clean();
88 require($SettDir['inc'].'iwrapper.php');
89 if($_GET['search']==null&&$_GET['type']==null) {
90 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Searching",$Settings['use_gzip'],$GZipEncode['Type']); }
91 if($_GET['search']!=null&&$_GET['type']!=null) {
92 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$_GET['search'],$Settings['use_gzip'],$GZipEncode['Type']); }
93 if($_GET['type']=="getactive") {
94 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Todays Active Topics",$Settings['use_gzip'],$GZipEncode['Type']); }