Mini Shell Moded By TiGER HeX
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
mnt
/
volume_sfo2_01
/
50mmla
/
Linux midnightridazz 4.19.0-11-cloud-amd64 #1 SMP Debian 4.19.146-1 (2020-09-17) x86_64
Upload File :
New :
File
Dir
/mnt/volume_sfo2_01/50mmla/forumSearch.php
<?php include_once('includes/static/configure.php'); include_once('includes/static/util.php'); include_once('includes/static/dbcon.php'); include_once('includes/static/gdimg.php'); include_once('includes/static/sessions.php'); include_once('includes/appTop.php'); ?> <? if(!is_authorized()){ header("Location: login.php?refurl=".urlencode($_SERVER['REQUEST_URI'])); exit(); } if(is_banned()){ header("Location: banned.php"); exit(); } $topic_id= 0; if(isset($_REQUEST['topicId'])){ $topic_id = $_REQUEST['topicId']; } $pgnum = 1; if(isset($_REQUEST['pgnum'])){ $pgnum = $_REQUEST['pgnum']; } /* if you try and use a join during any of these searches you'll be sorry becasue the mysql server will probably come to a halt*/ $result_array = Array(); $search = false; if(isset($_REQUEST['searchType'])){ $search = true; $fsurl = append_query("forums.php","searchType",$_REQUEST['searchType']); $fsurl = append_query($fsurl,"showThreads",1); $fsurl = append_query($fsurl,"keyword",urlencode($_REQUEST['keyword'])); if($_REQUEST['searchType']=="title"){ $sql = "SELECT DISTINCT topic_id, title FROM 50mm_forum_topics WHERE title REGEXP '[[:<:]]".$_REQUEST['keyword']."[[:>:]]'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } while($row = $db->sql_fetchrow($result)){ array_push($result_array,$row); } } if($_REQUEST['searchType']=="body"){ //search thread topics $sql = "SELECT DISTINCT topic_id, title FROM 50mm_forum_topics WHERE body REGEXP '[[:<:]]".$_REQUEST['keyword']."[[:>:]]'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } while($row = $db->sql_fetchrow($result)){ array_push($result_array,$row); } //search thread replies $sql = "SELECT DISTINCT t.topic_id, t.title FROM 50mm_forum_topics t,50mm_forum_replies r WHERE t.topic_id=r.topic_id AND r.body REGEXP '[[:<:]]".$_REQUEST['keyword']."[[:>:]]'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } while($row = $db->sql_fetchrow($result)){ array_push($result_array,$row); } } if($_REQUEST['searchType']=="user"){ $sql = "SELECT DISTINCT t.topic_id, t.title FROM 50mm_forum_topics t,50mm_users u WHERE t.user_id = u.user_id AND u.username REGEXP '[[:<:]]".$_REQUEST['keyword']."[[:>:]]'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } while($row = $db->sql_fetchrow($result)){ array_push($result_array,$row); } $sql = "SELECT DISTINCT t.topic_id, t.title FROM 50mm_forum_topics t, 50mm_forum_replies r,50mm_users u WHERE t.topic_id=r.topic_id AND r.user_id = u.user_id AND u.username REGEXP '[[:<:]]".$_REQUEST['keyword']."[[:>:]]'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } while($row = $db->sql_fetchrow($result)){ array_push($result_array,$row); } } } $pg_name = basename($_SERVER['PHP_SELF']); include_once('includes/header.php'); //content $sql = "SELECT page_body FROM 50mm_pages WHERE page_name ='forums'"; if( !($result = $db->sql_query($sql)) ){ $sql_error = $db->sql_error(); die($sql_error['message']); } $row = $db->sql_fetchrow($result); echo stripslashes($row['page_body']); ?> <script> errDivs = new Array('errorTitle','errorBody','errorUser'); function search(theForm,errDiv){ for(i=0;i<errDivs.length;i++){ visibleOff(errDivs[i]);//turn off every div } keyword = theForm['keyword'].value; if(keyword == ""){ visibleOn(errDiv);//turn on errDiv return false; }else{ return true; } } </script> <? $pgnum = 1; if(isset($_REQUEST['pgnum'])){ $pgnum = $_REQUEST['pgnum']; } //make sure that there are no duplicate entries //$result_array = array_unique($result_array); $pgnav = "<div class=\"hilite\">Your search produced ".count($result_array)." result(s)</div>"; ?> <table border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td> <? if($search){ ?> <table cellpadding="0" cellspacing="0" border="0" height="45"> <tr nowrap> <td><?echo $pgnav?></td> </tr> <tr> <td>Topics:</td> </tr> </table> <? //list results //create topics list $topics ="<div class=\"topics\">\n"; $topics.="<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n"; if(count($result_array) > 0 ){ while(list($key,$row) = each($result_array)){ $topics.="<tr>"; $link = append_query($fsurl,"topicId",$row['topic_id']); $topics.="<td width=\"160\"><a href=\"".$link."\">".get_trim_string($row['title'],18)."</a></td>\n"; //$topics.="<td width=\"10\"> </td>\n"; //$topics.="<td>".$row['num']."</td>\n"; $topics.="</tr>\n"; } }else{ $topics.="<tr>"; $topics.="<td width=\"160\" class=\"hilite\">No matches found!</td>\n"; $topics.="</tr>\n"; } $topics.="</table>"; $topics.="</div>"; echo $topics; include_once('includes/forumNav.php'); }else{ include_once('includes/forumNav.php'); include_once('includes/forumTopics.php'); } ?> <br> <!-- AdRevenue Ad Code <script src="http://www.50mmlosangeles.com/advertise/index.php?section=serve&id=39&output=js"></script> <a href="http://www.50mmlosangeles.com/advertise/index.php">advertise here...</a></td>--> <td width="50"> </td> <td valign="top"> <img src="images/spacer.gif" height="45"><br><!-- begin forum content --> <? if(!isset($_REQUEST['showThreads'])){ ?> <form action="<?echo $_SERVER['PHP_SELF']?>" onSubmit="return search(this,'errorTitle');"> Search Threads By Title:<br> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><input name="title" type="submit" class="button" value="Search"></td> <td width="5"><input type="hidden" name="searchType" value="title"></td> <td><input type="text" name="keyword" value="" class="field"></td> </tr> </table> <span id="errorTitle" style="visibility:hidden;" class="error"> Enter a search word!</span> </form> <form action="<?echo $_SERVER['PHP_SELF']?>" onSubmit="return search(this,'errorBody');"> Search Threads By Body:<br> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><input name="body" type="submit" class="button" value="Search"></td> <td width="5"><input type="hidden" name="searchType" value="body"></td> <td><input type="text" name="keyword" value="" class="field"></td> </tr> </table> <span id="errorBody" style="visibility:hidden;" class="error"> Enter a search word!</span> </form> <form action="<?echo $_SERVER['PHP_SELF']?>" onSubmit="return search(this,'errorUser');"> Search Threads By Users:<br> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><input name="user" type="submit" class="button" value="Search"></td> <td width="5"><input type="hidden" name="searchType" value="user"></td> <td><input type="text" name="keyword" value="" class="field"></td> </tr> </table> <span id="errorUser" style="visibility:hidden;" class="error"> Enter a username!</span> </form> <?}else{ include_once('includes/forumThreads.php'); }?> <!-- end forum content --> </td> </tr> </table> <br> <? include_once('includes/onlineUsers.php'); include_once('includes/footer.php'); include_once('includes/appBottom.php'); ?>