Location: PHPKode > projects > Sound PHP Engine > s-p-e-0.3.0/s-p-e-0.3.0/index.php
<?php 
// ===================================================== 
// 
// s-p-e - Content management system. 
// Copyright (C) 2004, 2005, 2006, 2010, 2011 Vladimir B. Tsarkov
// 
// This file is part of s-p-e. 
// 
// s-p-e is free software; you can redistribute it and/or modify 
// it under the terms of the GNU General Public License as published by 
// the Free Software Foundation, either version 3 of the License, or 
// (at your option) any later version. 
// 
// s-p-e is distributed in the hope that it will be useful, 
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
// GNU General Public License for more details. 
// 
// You should have received a copy of the GNU General Public License 
// along with s-p-e. If not, see <http://www.gnu.org/licenses/>.
//
// ------
//
//  You can contact me via e-mail: lipetsk-gnu-lug at bk period ru
//
//  index.php
//
//  Abstract: Index page incorporates the output of several
//  	      scripts on one page.
//  
//  Revision History:
// 
//	1  2004-03-27 - 2005-07-02 vbt
//	2  2005-07-20 vbt
//	3  2005-08-03 vbt
//	4  2006-02-24 vbt
//	5  2010-06-24 vbt
//	6  2011-01-22 vbt
//
// =====================================================
header("Content-Type: text/html; charset=UTF-8");

$inside = "include/page.php";
include("include/functions.php");
require_once("data/configure/specfg.php");

if(isset($_GET["lng"]))
{
	$lng = $_GET["lng"];
	$lng = langch($lng);
	$shortlng = substr($lng, 0, 2);
	language($lng);
} 
else 
{
	language($cfg["deflangvisitor"]);
	$shortlng = substr($cfg["deflangvisitor"], 0, 2);
}

if(isset($_GET["ins"]) == false)
{
	if(isset($_GET["id"]))
	{
		$id = $_GET["id"];
	}
	if(isset($id) && ctype_digit($id) == false)
	{
		$attack = 1;
	}
	if(isset($id) == false)
	{
		$out = $cfg["std"];
	}
}

if(isset($_GET["ins"]))
{
	if(isset($_GET["id"]))
	{
		$id = $_GET["id"];
	}
	if(isset($_GET["rid"]))
	{
		$rid = $_GET["rid"];
	}
	
	if(isset($id) && ctype_digit($id) == false)
	{
		$attack = 1;
	}
	
	if(isset($rid) && ctype_digit($rid) == false)
	{
		$attack = 1;
	}
	
	if(isset($_GET["ins"]))
	{
		$ins = $_GET["ins"];
	}
	if(isset($ins) && $ins == "view")
	{
		$inside = "view.php";
	}
	if(isset($ins) && $ins == "com")
	{
		$inside = "comment.php";
	}
	if(isset($ins) && $ins == "board")
	{
		$inside = "moutput.php";
		
		if(isset($_GET["mpage"]) && ctype_digit($_GET["mpage"]))
		{
			$mpage = $_GET["mpage"];
		}
	}
	if(isset($ins) && $ins == "search")
	{
		
		$inside = "search.php";
		
		if(isset($_GET["q"]))
		{
			$ns_q = $_GET["q"];
			#$ns_q = space($ns_q);
			$stringarray = preg_split("//", $ns_q, -1, PREG_SPLIT_NO_EMPTY);
	
			for($j = 0; isset($stringarray[$j]); $j++)
			{
				$stringarray[$j] = preg_replace("/(40)|(5[b-f])|(2[a-f])|(2[1-9])|(3[a-f])|(7[b-f])/", "", bin2hex($stringarray[$j]));
			}
			for($j = 0; isset($stringarray[$j]); $j++)
			{
				if($j == 0)
				{
					$ns_q = $stringarray[$j];
				} 
				else 
				{
					$ns_q = $ns_q.$stringarray[$j];
				}
			}
			$ns_q = pack('H*', $ns_q);
			#$ns_q = space($ns_q);
			$ns_q = mysql_escape_string($ns_q);
		}
		if(isset($_GET["m"]))
		{
			$ns_m = $_GET["m"];
			$ns_m = base64_decode($ns_m);
		}
		if(isset($_GET["d"]) && ctype_digit(base64_decode($_GET["d"])))
		{
			$ns_date_range = base64_decode($_GET["d"]);
		}
		if(isset($_GET["w"]))
		{
			$ns_within = $_GET["w"];
			$ns_within = base64_decode($ns_within);
		}
		if(isset($_GET["r"]) && ctype_digit(base64_decode($_GET["r"])))
		{
			$ns_results = base64_decode($_GET["r"]);
		}
		if(isset($_GET["s"]) && ctype_digit(base64_decode($_GET["s"])))
		{
			$ns_summary = base64_decode($_GET["s"]);
		}
		if(isset($_GET["p"]) && ctype_digit($_GET["p"]))
		{
			$p = $_GET["p"];
		}
	}
	if(isset($ins) && $ins == "tips")
	{
		$inside = "searchtips.php";
	}
	if(isset($ins) && $ins == "map")
	{
		$inside = "map.php";
	}
}

if(isset($_GET["page"]))
{
	$page = $_GET["page"];
}
if(isset($_GET["out"]))
{
	$out = $_GET["out"];
}

include("starter.php");
?>
Return current item: Sound PHP Engine