| // | Copyright (c) 2004 Max Baryshnikov | // | http://sapid.sourceforge.net | // +----------------------------------------------------------------------+ // | This source file is free software; you can redistribute it and/or | // | modify it under the terms of the GNU Lesser General Public | // | License as published by the Free Software Foundation; either | // | version 2.1 of the License, or (at your option) any later version. | // | | // | This source file 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 | // | Lesser General Public License for more details. | // +----------------------------------------------------------------------+ // Release: 06.12.04 (dd/mm/yy) // $Id: index.php,v 1.10 2005/08/15 15:18:05 mephius Exp $ //Cut off lost picture requests if (preg_match("/\.[gjpi][ipnc][fgo]/i", $_SERVER['REQUEST_URI'])) exit; include (dirname(__FILE__) . "/etc/rc.conf.php"); if(!@include(ROOT_PATH."etc/rc.d/debug.inc.php")) header("Location: install.php"); if(!$http_path or !is_file(ROOT_PATH . "index.php")) message_die("SAPID not yet been configured or configuration is broken.

Please, enter the configuration utility and create a new configuration."); include(ROOT_PATH . "etc/startup.inc.php"); if (!isset($_SESSION["user"]["login"])) { include(ROOT_PATH . "usr/system/counter.inc.php"); }else{ $env["user"]=$_SESSION["user"]; } include(ROOT_PATH."mvc/controller/user_requests_analysis.inc.php"); $env["area51"]=0; if (isset($_SESSION["user"]["LOGIN"]) and $_SESSION["user"]["NOLOGIN"]=="") { $env["user.aStatus"]=1; $env["area51"]=1; if(isset($_GET["mode"])){ switch ($_GET["mode"]) { case "edit": if($env["page"]["pWrite"]) { $env["mode"]=1; $env["area51"]=2; }else{ $env["mode"]=0; } break; default: $env["mode"]=0; break; } } } if($panel=="") $sapi_obj = new sapi_parser(ROOT_PATH . "usr/templates/" . $env["page"]["TEMPLATE"], $env); // Looking for an information about current page children if($tree->map) { foreach($tree->map as $k=>$v) { if($v["ID"]==$env["page.ID"]) { $curPointer = $v["POINTER"]; break; } } eval("\$val = \$tree->structure".$curPointer."['CHILDREN'];"); $env["document.children"] = count($val); } $parse=($panel==""?$sapi_obj->build_page():$panel); $stream=""; if (isset($_SESSION["user"]["LOGIN"]) and $_SESSION["user"]["NOLOGIN"]=="") { if($env["mode"]==1){ // Delete QC in $parse = preg_replace("/<title>(.*?)<\/title>/is", "", $parse); $parse = preg_replace("/<meta .*?content=\"(.*?)\".*?>/is", "", $parse); include("usr/system/metapanel.inc.php"); $parse = $metapanel.$parse; } if (isset($_POST["quick_save"])) { if ($error_message) $message="<span style='color: #D31412'>".$error_message."</span>"; else $message="<span style='color: #333399'>Data saved</span>"; echo ' <html> <body style="background-color: white; padding: 5px 10px"> <table width="100%" height="100%" border="0"> <tr><td style="font-weight: bold; text-align: center">'.$message.'</td></tr> </table> <script language="javascript1.2"> function Hide_Message(){ top.document.getElementById("message_div").style.left=-300; top.document.getElementById("message_div").style.top=-300; } top.document.getElementById("message_div").style.left=top.document.body.clientWidth/2-100; top.document.getElementById("message_div").style.top=top.document.body.clientHeight/2-25+top.document.body.scrollTop; setTimeout(Hide_Message,1500); </script> </body> </html> '; exit; } //$action=$env["http_path"] . ($MODREWRITE=="disabled"?"?vpath=":"").preg_replace("/^\/(.*)\/*$/iU", "\\1/", str_replace("?".$_SERVER["QUERY_STRING"], "", $_SERVER["REQUEST_URI"])); $action=$env["http_path"] . ($MODREWRITE=="disabled"?"?vpath=":"") . $env["noslash_argv_string"] . ($env["noslash_argv_string"]==""?"":"/"); if ($env["mode"]==1) { include(ROOT_PATH ."usr/system/js/startup.js.php"); $form_header=' <form action="'.$action.'" method="post" enctype="multipart/form-data" name="bcwb_form" id="bcwb_form" style="padding: 0px; display: none;"> <input type="hidden" name="update" value="1"> <input type="hidden" name="arg_ImgUrl" value=""> <input type="hidden" name="arg_AltText" value=""> <input type="hidden" name="arg_ImgBorder" value=""> <input type="hidden" name="arg_HorSpace" value=""> <input type="hidden" name="arg_VerSpace" value=""> <input type="hidden" name="arg_ImgAlign" value=""> <input type="hidden" name="arg_ImgHeight" value=""> <input type="hidden" name="arg_ImgWidth" value=""> <input type="hidden" name="arg_FileUrl" value=""> '.$GLOBALS["form_fields"]."</form>"; } if(!$panel){ preg_match("/<title>(.*)<\/title>/isU", $parse, $matches); $title=$matches[1]; } // Skin of administrative panel include(ROOT_PATH."usr/themes/default/templates/admin_panel.inc.php"); //mod toxin, browser // $stream=<<<PROLOG //<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" //"http://www.w3.org/TR/html4/loose.dtd"> //PROLOG; $stream.=" <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$default_charset."\" /> <link rel=\"stylesheet\" type=\"text/css\" href=\"".$http_path . "usr/".($_SESSION["user"]["LOGIN"]?"system":"content")."/".($panel==""?"light.css":"default.css")."\"> <title>".$metatitle." ".($env["mode"]==1?" ":"")." ".($_GET["mode"]=="edit" ? "" : "")."
".$tools.($env["mode"]==1?$form_header:"").$parse."
Sapid v".$VERSION." Configured: ".$CONFIGURED."Red Graphic Systems Sponsored
"; }else $stream=$parse; if (preg_match("/DOCTYPE\swml/isU", trim(substr($stream,0,250)))) { header("Content-Type: text/vnd.wap.wml"); } elseif (preg_match("/^<\?xml/isU", trim(substr($stream,0,50)))) { header("Content-type: text/xml"); } if ($MODREWRITE=="disabled") { $stream=preg_replace("/(/isU", "\\1href=\\2?vpath=/\\3\\4\\5\\6>", $stream); $stream=preg_replace("/location=(\"|')?(?:".addcslashes($http_path, "/")."|\/)([^\?]{1})([^\s\"\'\?]{0,})(\"|')?/is", "location=\\1".$http_path."?vpath=/\\2\\3\\4", $stream); $stream=preg_replace("/(/isU", "\\1action=\\2?vpath=/\\3\\4\\5\\6>", $stream); } $env["time_finish"]=getmicrotime(); $env["exec_time"]=$env["time_finish"]-$env["time_start"] . " sec"; $stream=str_replace("##gentime##", $env["exec_time"], $stream); echo $stream; if ($sapi_obj->error and $_SESSION["user"]["LOGIN"]) echo "
Error!
".$sapi_obj->error."
"; if($_GET["d"]=="perf" and DEBUG) echo "
Execution time: " . $env["exec_time"] . "
"; unset($sapi_obj); ?>