From f4fbb0753ee9f92a8f1c3c441450b7e36fcd4206 Mon Sep 17 00:00:00 2001 From: Kazuki Przyborowski Date: Tue, 17 Jul 2007 07:48:34 +0000 Subject: [PATCH] Added Search to navbar and edited search a little. git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@46 2b68903e-0b30-0410-9a39-a2e4f3c5be39 --- inc/filename.php | 6 +++--- inc/navbar.php | 10 +++++++--- inc/searchs.php | 17 ++++++++--------- search.php | 8 +++++--- setup/mktable.php | 4 ++-- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/inc/filename.php b/inc/filename.php index 41d2278..e254f91 100644 --- a/inc/filename.php +++ b/inc/filename.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: filename.php - Last Update: 07/15/2007 SVN 45 - Author: cooldude2k $ + $FileInfo: filename.php - Last Update: 07/17/2007 SVN 46 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="filename.php"||$File3Name=="/filename.php") { @@ -49,8 +49,8 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) { return $return_var; } // Version number and date stuff. :P $VER1[0] = 0; $VER1[1] = 1; $VER1[2] = 5; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2]; -$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 45; $RName = "iDB"; $SFName = "IntDB"; -$SVNDay[0] = 07; $SVNDay[1] = 15; $SVNDay[2] = 2007; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; +$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 46; $RName = "iDB"; $SFName = "IntDB"; +$SVNDay[0] = 07; $SVNDay[1] = 17; $SVNDay[2] = 2007; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; $VerInfo['iDB_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,false); $VerInfo['iDB_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,true); $VerInfo['iDB_Full_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[0],$SubVerN,false); diff --git a/inc/navbar.php b/inc/navbar.php index 215dcea..936703a 100644 --- a/inc/navbar.php +++ b/inc/navbar.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: navbar.php - Last Update: 07/13/2007 SVN 42 - Author: cooldude2k $ + $FileInfo: navbar.php - Last Update: 07/17/2007 SVN 46 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="navbar.php"||$File3Name=="/navbar.php") { @@ -42,8 +42,12 @@ if($ThemeSet['LogoStyle']!=null) { $logostyle = "style=\"".$ThemeSet['LogoStyle'  Welcome Guest ( ">Log in">Register ) Logged as: "> ( ">Log out ) - + +">Search ">Profile ">MailBox () diff --git a/inc/searchs.php b/inc/searchs.php index 1490516..0e24e12 100644 --- a/inc/searchs.php +++ b/inc/searchs.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: searchs.php - Last Update: 07/15/2007 SVN 44 - Author: cooldude2k $ + $FileInfo: searchs.php - Last Update: 07/17/2007 SVN 46 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="searchs.php"||$File3Name=="/searchs.php") { @@ -20,7 +20,8 @@ if ($File3Name=="searchs.php"||$File3Name=="/searchs.php") { if($Settings['enable_search']==false|| $GroupInfo['CanSearch']=="no") { redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); -ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']); +@header("Content-Type: text/plain; charset=".$Settings['charset']); +ob_clean(); echo "Sorry you do not have permission to do a search."; gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); } if($Settings['enable_search']==true|| $GroupInfo['CanSearch']=="yes") { @@ -71,6 +72,11 @@ if($_GET['type']=="wildcard") { $query = query("select * from `".$Settings['sqltable']."topics` where `TopicName` LIKE '%s' ORDER BY `Pinned` DESC, `LastUpdate` DESC", array($_GET['search'])); } $result=mysql_query($query); $num=mysql_num_rows($result); +if($num<=0) { +redirect("location",$basedir.url_maker($exfile['search'],$Settings['file_ext'],"act=topics",$Settings['qstr'],$Settings['qsep'],$prexqstr['search'],$exqstr['search'],false)); +@header("Content-Type: text/plain; charset=".$Settings['charset']); +ob_clean(); echo "Sorry could not find any search results."; @mysql_free_result($result); +gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); } //Start Topic Page Code (Will be used at later time) if($_GET['page']==null) { $_GET['page'] = 1; } if($_GET['page']<=0) { $_GET['page'] = 1; } @@ -195,11 +201,4 @@ echo "".$UsersName.""; } @mysql_free_result($result); ?>
 
- - - - - -
 
-
 
\ No newline at end of file diff --git a/search.php b/search.php index 138d5f3..6bef529 100644 --- a/search.php +++ b/search.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: search.php - Last Update: 07/15/2007 SVN 44 - Author: cooldude2k $ + $FileInfo: search.php - Last Update: 07/17/2007 SVN 46 - Author: cooldude2k $ */ require('preindex.php'); $usefileext = $Settings['file_ext']; @@ -23,9 +23,11 @@ $filewpath = $exfile['search'].$usefileext.$_SERVER['PATH_INFO'];