Update killglobals.php
[iDB.git] / search.php
blob3c86fc7b29d9ed485567cb4eeb3c596801e4e986
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-2023 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12 Copyright 2004-2023 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
14 $FileInfo: search.php - Last Update: 6/22/2023 SVN 984 - 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_html = htmlentities($Settings['board_name'].$idbpowertitle, ENT_QUOTES, $Settings['charset']);
30 <meta itemprop="title" property="og:title" content="<?php echo $title_html; ?>" />
31 <meta itemprop="sitename" property="og:site_name" content="<?php echo $title_html; ?>" />
32 <meta itemprop="title" property="twitter:title" content="<?php echo $title_html; ?>" />
33 <meta name="title" content="<?php echo $title_html; ?>" />
34 <title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
35 <?php $iWrappers['TITLETAG'] = ob_get_clean();
36 ob_start("idb_suboutput_handler"); ?>
37 </head>
38 <body>
39 <?php $iWrappers['BODYTAG'] = ob_get_clean();
40 ob_start("idb_suboutput_handler");
41 require($SettDir['inc'].'navbar.php');
42 $iWrappers['NAVBAR'] = ob_get_clean();
43 ob_start("idb_suboutput_handler");
44 if($Settings['enable_search']=="off"||
45 $GroupInfo['CanSearch']=="no") {
46 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
47 header("Content-Type: text/plain; charset=".$Settings['charset']);
48 ob_clean(); echo "Sorry you do not have permission to do a search."; $urlstatus = 302;
49 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
50 if($Settings['enable_search']=="on"||$GroupInfo['CanSearch']=="yes") {
51 if($_GET['act']=="getactive") {
52 $_GET['act'] = "topics";
53 $_GET['type'] = "getactive"; }
54 if(isset($_GET['type'])&&$_GET['type']=="getactive") {
55 $_POST['type'] = "getactive"; }
56 if(!isset($_GET['search'])) { $_GET['search'] = null; }
57 if(!isset($_POST['search'])) { $_POST['search'] = null; }
58 if($_GET['search']==null&&
59 $_POST['search']!=null) {
60 $_GET['search'] = $_POST['search']; }
61 if(!isset($_GET['type'])) { $_GET['type'] = null; }
62 if(!isset($_POST['type'])) { $_POST['type'] = null; }
63 if($_GET['type']==null&&
64 $_POST['type']!=null) {
65 $_GET['type'] = $_POST['type']; }
66 if(!isset($_POST['act'])) { $_POST['act'] = null; }
67 if($_GET['act']==null||$_GET['act']=="topic"||
68 $_POST['act']=="topic"||$_POST['act']=="topics")
69 { $_GET['act']="topics"; }
70 if(!in_array($_GET['act'], $idbactcheck))
71 { $_GET['act']="topics"; }
72 if(!isset($_GET['msearch'])) { $_GET['msearch'] = null; }
73 if(!isset($_POST['msearch'])) { $_POST['msearch'] = null; }
74 if($_GET['msearch']==null&&
75 $_POST['msearch']!=null) {
76 $_GET['msearch'] = $_POST['msearch']; }
77 if($_GET['act']=="topics") {
78 require($SettDir['inc'].'searches.php'); } }
79 if($_GET['act']=="opensearch") {
80 redirect("location",$rbasedir.url_maker($exfile['rss'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss'],FALSE));
81 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
82 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
83 $iWrappers['CONTENT'] = ob_get_clean();
84 ob_start("idb_suboutput_handler");
85 require($SettDir['inc'].'endpage.php');
86 $iWrappers['COPYRIGHT'] = ob_get_clean();
87 ob_start("idb_suboutput_handler");
88 if(!isset($_GET['search'])) { $_GET['search'] = null; }
90 </body>
91 </html>
92 <?php
93 $iWrappers['HTMLEND'] = ob_get_clean();
94 require($SettDir['inc'].'iwrapper.php');
95 if($_GET['search']==null&&$_GET['type']==null) {
96 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Searching",$Settings['use_gzip'],$GZipEncode['Type']); }
97 if($_GET['search']!=null&&$_GET['type']!=null) {
98 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." ".$_GET['search'],$Settings['use_gzip'],$GZipEncode['Type']); }
99 if($_GET['type']=="getactive") {
100 change_title($Settings['board_name']." ".$ThemeSet['TitleDivider']." Todays Active Topics",$Settings['use_gzip'],$GZipEncode['Type']); }