Location: PHPKode > projects > FBC-Market > market/rules.php
<?php 
include_once('inc_dbcon.php'); 
require_once('admin/config.php');
require_once($languageFile);

// Preview descrition length in characters
$previewLength = 240;

// check to see if in admin mode and validate key
global $keyOut;
$keyOut = "";
if (isset($_GET["k"]))
	if($_GET["k"] == $key){ // Key comes from admin/password.php file
		$keyOut = "&k=" . $key;
	}
		
global $category;
$category = "%";
if (isset($_GET["category"]))
	$category = mysql_real_escape_string($_GET["category"]);

$msg = "";
if (isset($_GET["msg"]))
	$msg = mysql_real_escape_string($_GET["msg"]);

// SEARCH CODE START
$searchQuery = "";
if (isset($_GET["q"]))
	$searchQuery = mysql_real_escape_string($_GET["q"]);

if ($searchQuery != "") 
{
	$query_Recordset1 = "SELECT postId,category,title,description,isAvailable,description,price,confirmPassword,category,imgURL,imgURLThumb,DATE_FORMAT(timeStamp,'%b %d, %Y %l:%i %p') AS timeStamp1 FROM md_postings WHERE isConfirmed = '1' AND title like '%$searchQuery%' OR description like '%searchQuery%' ORDER BY `timeStamp` DESC";
} else {
	// this following line was pulled from about ten lines below if you are updating an older version
	$query_Recordset1 = "SELECT postId,category,title,description,isAvailable,description,price,confirmPassword,category,imgURL,imgURLThumb,DATE_FORMAT(timeStamp,'%b %d, %Y %l:%i %p') AS timeStamp1 FROM md_postings WHERE isConfirmed = '1' AND category like '$category' ORDER BY `timeStamp` DESC";
}
// SEARCH CODE END - see also line 113 below

$maxRows_Recordset1 = 100;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = mysql_real_escape_string($_GET['pageNum_Recordset1']);
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1);
	if (!$Recordset1){    
		print("It appears we have a problem: " . mysql_error());    
		exit();  
	}
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
  $totalRows_Recordset1 = mysql_real_escape_string($_GET['totalRows_Recordset1']);
} else {
  $all_Recordset1 = mysql_query($query_Recordset1);
  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_Recordset1") == false && 
        stristr($param, "totalRows_Recordset1") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title><?php echo $sitetitle;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="md_style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript">
function doFilter(dis)
{
	window.location.href = "index.php?category=<?php echo $category ?>&type=" + dis.value + "<?php echo $keyOut;?>"
}	
</script>
</head>
<body>
<?php
 include_once("inc_header.php");;
 include_once("inc_navigation.php") ;?>
<div id="md_container"><br><br><br>

<h3>Rules</h3>

<p>Edit <b>rules.php</b> and add your rules.</p>

	</div>
</div>
<?php include_once("inc_footer.php");?>
</body>
</html>
<?php 	mysql_close($dbConn); ?>
Return current item: FBC-Market