?PNG
IHDR ? f ??C1 sRGB ?? gAMA ?a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
'',CONCAT(Domain,'.".$DOMAIN_NAME."'),'".$DOMAIN_NAME."'))='".$host."'",$LinkID);
if (mysql_num_rows($res)) {
list($SiteID) = mysql_fetch_row($res);
mysql_free_result($res);
$cache[$host]=(int)$SiteID;
return (int)$SiteID;
}
update_site_info();
if ($cache_site){
foreach ($cache_site as $site_id => $site){
$Mirrors = &$site['Mirrors'];
for ($i=0;$i"," "), "\n", $row['Mirrors']);
$Mirrors = str_replace("\n\n", "\n", $Mirrors);
$row['Mirrors'] = $Mirrors = explode("\n",$Mirrors);
$cache_site[(int)$row['Site_ID']]=$row;
}
}
#### ФУНКЦИИ КОНТРОЛЯ ЛИЦЕНЗИИ ####
function checkLicense(){
global $domain,$cache_site,$mirror_limit;
//if (substr($domain,strlen($domain)-3) == '.bi'){ return 1; }
//DebugBreak();
//return true;
$wdomain = str_replace("www.","",$domain);
$site = GetSiteID($domain);
if ($site && $cache_site[$site] === null){
update_site_info($site);
}
$info=&$cache_site[$site];
if ($info === null) {
print_r($cache_site);
licenseNotice(3,1);
}
if (substr($info['Domain'],0,4) == 'www.'){ licenseNotice(2,0); }
if (generateLicense($info['Domain']) != cleanLicenseKey($info['Site_License'])){ licenseNotice(1,1); }
$dmirrors=array();
$domain_parts=array_reverse(explode('.',$info['Domain']));
foreach ($info['Mirrors'] as $mirror){
if ($mirror === '') continue;
$mirror=trim($mirror);
if (substr($mirror,0,4)=='www.') continue;
$mirror_parts=array_reverse(explode('.',$mirror));
if (count($mirror_parts)>2) continue;
$flag=true;
for ($i=0; $i $mirror_limit) {
licenseNotice(6,1); // превышен лимит на разнородные зеркала
}
return 1;
}
function cleanLicenseKey($license){ $license = substr($license,5,5); return $license; }
function generateLicense($domain){ return substr(base64_encode($domain),0,5);}
function licenseNotice($code,$iscritical = false){
echo '';
switch($code){
case 1: echo "EMPTY KEY/FIELD DOES NOT EXIST! "; break; // поле не задано или ключ пустой
case 2: echo "BASE DOMAIN NAME CANNOT BE WITH www.! "; break; // поле не задано или ключ пустой
case 3: echo "SITE VERSION NOT FOUND! - ".$_SERVER['HTTP_HOST']; break; // поле не задано или ключ пустой
case 6: echo "LIMIT ON VERSION MIRRORS EXCEEDED "; break;
}
echo '';
if($iscritical){ exit;}
}
checkLicense();
require_once ($INCLUDE_FOLDER."main.inc.php");
require_once ($INCLUDE_FOLDER."filters.inc.php");
function ObjectExists ($classID,$sysTbl,$object,$keyword) {
global $LinkID;
$res = mysql_query("SELECT ".($sysTbl?"".(LOWER_CASE_TABLES ? "user" : "User")."":"".(LOWER_CASE_TABLES ? "data" : "Data")."")."_ID FROM `".($sysTbl?"".(LOWER_CASE_TABLES ? "user" : "User")."":"".(LOWER_CASE_TABLES ? "data" : "Data")."".$classID)."` WHERE `Keyword`='$keyword'",$LinkID);
#echo "SELECT ".($sysTbl?"User":"Data")."_ID FROM ".($sysTbl?"User":"Data$classID")." WHERE Keyword='$keyword'";
if (mysql_num_rows($res)) {
list($msgID) = mysql_fetch_row($res);
mysql_free_result($res);
return ($msgID);
} else {
return false;
}
}
function GetSectionID ($site, $path) {
global $LinkID;
$res = mysql_query("SELECT `Section_ID` FROM `".(LOWER_CASE_TABLES ? "section" : "Section")."` WHERE `Site_ID`='".$site."' AND `Hidden_URL`='".$path."'", $LinkID);
list($section) = mysql_fetch_row($res);
mysql_free_result($res);
return $section;
}
function GetPathBySectionID ($section) {
global $LinkID;
$res = mysql_query("SELECT `Hidden_URL` FROM `".(LOWER_CASE_TABLES ? "section" : "Section")."` WHERE `Section_ID`='".$section."'", $LinkID);
list($path) = mysql_fetch_row($res);
mysql_free_result($res);
return $path;
}
function ParseQuery ($query_string) {
$param_str = explode("&",$query_string);
for ($i = 0; $i < count ($param_str); $i++) {
$param_arg = explode ("=", $param_str[$i]);
if (count($param_arg) && $param_arg[0])
@eval("\$getVars[\"".(strchr($param_arg[0],"[")?substr(urldecode($param_arg[0]),0,strlen(urldecode($param_arg[0]))-strlen(strchr($param_arg[0],"["))):urldecode($param_arg[0]))."\"]".strchr($param_arg[0],"[")." = \"".urldecode($param_arg[1])."\";");
}
return $getVars;
}
/*
function AttemptToSection_Redirect ($url) {
global $LinkID, $REDIRECT_STATUS;
$res = mysql_query("SELECT REPLACE(NewURL,'*','\\\'),REPLACE(OldURL,'*','([[:alnum:]]+)') FROM Section_Redirect WHERE '".$url."' LIKE CONCAT('http://',REPLACE(OldURL,'*','%')) OR '".$url."' LIKE CONCAT('http://www.',REPLACE(OldURL,'*','%'))", $LinkID);
if (!mysql_num_rows($res)) return 0;
list($new_url,$old_url) = mysql_fetch_row($res);
mysql_free_result($res);
if (strchr($new_url,"\\")) $result_url = ereg_replace($old_url,$new_url,$url);
else $result_url = "http://".$new_url;
if ($REDIRECT_STATUS=="on")
header("Location: $result_url");
else
echo "";
exit;
}
*/
function AttemptToSection_Redirect ($url) {
global $LinkID, $REDIRECT_STATUS;
$old_path = mysql_real_escape_string(parse_url($url, PHP_URL_PATH));
$new_path = SQLSelectOne("SELECT `NewURL` FROM `".(LOWER_CASE_TABLES ? "section_redirect" : "Section_Redirect")."` WHERE `OldURL` = '$old_path'", 'NewURL');
if (!empty($new_path)){
if ($REDIRECT_STATUS=="on"){
header("HTTP/1.0 301 Moved Permanently");
header("Location: $new_path");
}else{
echo "";
};
exit;
};
}
function check_server() {
// if (preg_match("/^(207.44|209.152)/",$_SERVER["SERVER_ADDR"]) > 0)
return 1;
return 0;
}
if (check_server() == 0) {
switch ($CMS_PHP_TYPE) {
case "module": header("HTTP/1.0 500 Internal Server Error"); exit;
case "cgi": header("Status: 500 Internal Server Error"); exit;
}
}
$client_url = urldecode("http://".$_SERVER['HTTP_HOST'].cms_process_filters($_SERVER['REQUEST_URI']));
//$m_url=parse_url('http://domus.bi');
$parsed_url = parse_url($client_url);
if (!isset($parsed_url['path'])) $parsed_url['path'] = '';
if (!isset($parsed_url['query'])) $parsed_url['query'] = '';
if (!isset($parsed_url['scheme'])) $parsed_url['scheme'] = '';
if (!isset($parsed_url['user'])) $parsed_url['user'] = '';
if (!isset($parsed_url['pass'])) $parsed_url['pass'] = '';
if (!isset($parsed_url['host'])) $parsed_url['host'] = '';
if (!isset($parsed_url['port'])) $parsed_url['port'] = '';
$myhost = explode('.',$parsed_url['host']);
if($myhost[0]!="www" && $REDIRECT_TO_WWW){
header("HTTP/1.0 301 Moved Permanently");
header("Location: ".$parsed_url['scheme'].'://www.'.$parsed_url['host'].$parsed_url['path'].$parsed_url['query']);
exit;
} elseif($myhost[0]=="www" && $REDIRECT_FROM_WWW){
header("HTTP/1.0 301 Moved Permanently");
header("Location: ".$parsed_url['scheme'].'://'.str_replace("www.","",$parsed_url['host'].$parsed_url['path'].$parsed_url['query'])) ;
exit;
}
// Generating print link
if (strpos($parsed_url['path'], ".html") > 0) {
$CMS_PRINT_LINK = str_replace(".html", ".".$CMS_PRINT_FILTER.".html", $parsed_url['path']).$parsed_url['query'];
} else {
$T=substr($parsed_url['path'], -1);
$CMS_PRINT_LINK = ((substr($parsed_url['path'], -1) == "/") ? $parsed_url['path']:"/")."print/".($parsed_url['query'] ? "?".$parsed_url['query'] : "");
}
$client_source_url = $parsed_url['scheme']."://".($parsed_url['user']?$parsed_url['user']:"").($parsed_url['pass']?":".$parsed_url['pass']:"").(($parsed_url['user'] || $parsed_url['pass'])?"@":"").$parsed_url['host'].($parsed_url['port']?":".$parsed_url['port']:"").$parsed_url['path'];
parse_str ($parsed_url['query'], $_GET); extract ($_GET);
$site = "";
$section = "";
$object = "";
$classID = "";
$user_table_mode = false;
$as_admin = false;
$cached_inserts=0;
$cached_requests=0;
$cache_site=array();
LoadModuleEnv();
$site = GetSiteID($parsed_url['host']);
$res = mysql_query("SELECT `E404_Section_ID`,`Title_Section_ID` FROM `".(LOWER_CASE_TABLES ? "site" : "Site")."` WHERE `Site_ID`='".$site."'",$LinkID);
list ($e404_section,$title_section) = mysql_fetch_row($res);
$cache_site[$site]['E404_Section_ID']=$e404_section;
$cache_site[$site]['Title_Section_ID']=$Title_Section_ID = $title_section;
mysql_free_result($res);
$redirect_to_url = '';
$object_keyword = '';
if (!isset($action)) $action = '';
if (($req_file = strrchr($parsed_url['path'],"/")) <> "/") {
$req_file = substr($req_file,1,strlen($req_file) - 1);
$req_file_parts = explode(".",$req_file);
$fname = $req_file_parts[0];
$fext = strtolower($req_file_parts[count($req_file_parts)-1]);
if ($fext == "html") {
$parsed_url['path'] = substr ($parsed_url['path'], 0, strlen($parsed_url['path']) - strlen($req_file));
if (ereg ("/([0-9]{4}/)", $parsed_url['path'], $regs)) {
$date_tmp = $regs[1];
$date_tmp = substr($date_tmp,0,strlen($date_tmp)-1);
$parsed_url_pathtmp = substr($parsed_url['path'],0,strlen($parsed_url['path'])-strlen($regs[0])+1);
}
if (ereg ("/([0-9]{4})/([0-9]{1,2}/)", $parsed_url['path'], $regs)) {
$date_tmp = $regs[1]."-".$regs[2];
$date_tmp = substr($date_tmp,0,strlen($date_tmp)-1);
$parsed_url_pathtmp = substr($parsed_url['path'],0,strlen($parsed_url['path'])-strlen($regs[0])+1);
}
if (ereg ("/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2}/)", $parsed_url['path'], $regs)) {
$date_tmp = $regs[1]."-".$regs[2]."-".$regs[3];
$date_tmp = substr($date_tmp,0,strlen($date_tmp)-1);
$parsed_url_pathtmp = substr($parsed_url['path'],0,strlen($parsed_url['path'])-strlen($regs[0])+1);
}
#echo "SELECT a.Section_ID,b.Section_Object_ID,b.Object_ID,c.System_ID FROM Section AS a,Section_Object AS b,Object AS c WHERE (a.Hidden_URL='".$parsed_url['path']."' OR a.Hidden_URL='".$parsed_url_pathtmp."') AND a.Site_ID=".$site." AND a.Section_ID=b.Section_ID AND b.Object_ID=c.Object_ID ORDER BY b.Checked,b.Priority";
$res = mysql_query("SELECT a.`Section_ID`,b.`Section_Object_ID`,b.`Object_ID`,c.`System_ID` FROM `".(LOWER_CASE_TABLES ? "section" : "Section")."` AS a,`".(LOWER_CASE_TABLES ? "section_object" : "Section_Object")."` AS b,`Object` AS c WHERE (a.Hidden_URL='".$parsed_url['path']."' OR a.`Hidden_URL`='".$parsed_url_pathtmp."') AND a.`Site_ID`=".$site." AND a.`Section_ID`=b.`Section_ID` AND b.`Object_ID`=c.`Object_ID` ORDER BY b.`Checked`,b.`Priority`",$LinkID);
if (mysql_num_rows($res)) {
for ($i=0;$i".$parsed_url['path']."<-- ";
#echo "-->".$parsed_url_pathtmp."<-- ";
if (!$message) {
if ($parsed_url_pathtmp)
$object_keyword = strrchr(substr($parsed_url_pathtmp,0,strlen($parsed_url_pathtmp) - 1),"/");
else
$object_keyword = strrchr(substr($parsed_url['path'],0,strlen($parsed_url['path']) - 1),"/");
if ($object_keyword = substr($object_keyword,1,strlen($object_keyword) - 1)) {
if (preg_match("([0-9]+)", $fname)) {
$message = $fname;
$action = "view";
} elseif ($fname=="add" || $fname=="search" || $fname=="subscribe") {
$action = $fname;
} else $object_keyword = $fname;
} else $object_keyword = $fname;
}
} else {
$parsed_url['path'] .= "/";
$redirect_to_url = $client_source_url."/".($parsed_url['query']?"?".$parsed_url['query']:"").($parsed_url[fragment]?"#".$parsed_url[fragment]:"");
}
}
if (preg_match("|/([0-9]{4}/)|", $parsed_url['path'], $regs)) {
$date_tmp = $regs[1];
$date_tmp = substr($date_tmp,0,strlen($date_tmp)-1);
$parsed_url_pathtmp = substr($parsed_url['path'],0,strlen($parsed_url['path'])-strlen($regs[0])+1);
}
if (preg_match("|/([0-9]{4})/([0-9]{1,2}/)|", $parsed_url['path'], $regs)) {
$date_tmp = $regs[1]."-".$regs[2];
$date_tmp = substr($date_tmp,0,strlen($date_tmp)-1);
$parsed_url_pathtmp = substr($parsed_url['path'],0,strlen($parsed_url['path'])-strlen($regs[0])+1);
}
if (preg_match ("|/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2}/)|", $parsed_url['path'], $regs)) {
$date_tmp = $regs[1]."-".$regs[2]."-".$regs[3];
$date_tmp = substr($date_tmp,0,strlen($date_tmp)-1);
$parsed_url_pathtmp = substr($parsed_url['path'],0,strlen($parsed_url['path'])-strlen($regs[0])+1);
}
if ($parsed_url['path'] == "/") $section = $title_section;
else $section = GetSectionID ($site, $parsed_url['path']);
$date = '';
if (!$section) {
$section = GetSectionID ($site, $parsed_url_pathtmp);
if ($section) $date = $date_tmp;
}
if ($section) {
$current_section = get_section_info($section);
if ($current_section['ExternalURL'] && $current_section['do_redirect']){
$redirect_to_url = ((substr($current_section['ExternalURL'],0,7) != 'http://') ? 'http://'.$_SERVER['HTTP_HOST'] : "").$current_section['ExternalURL'];
}
}
if ($section && $redirect_to_url) {
if ($REDIRECT_STATUS == "on") {
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$redirect_to_url}");
exit;
}
}
#echo "-->section=".$section."<-- ";
#echo "-->object_keyword=".$object_keyword."<-- ";
if ($section) {
if ($section == $e404_section) $skip_redirect = 1;
if ($object_keyword) {
$res = mysql_query("SELECT `Section_Object_ID` FROM `".(LOWER_CASE_TABLES ? "section_object" : "Section_Object")."` WHERE `Section_ID`='".$section."' AND `LinkName`='".$object_keyword."'",$LinkID);
list($object) = mysql_fetch_row($res);
mysql_free_result($res);
if (!$object) $section = $e404_section;
} elseif(!$object) {
$query = "SELECT `Section_Object_ID` FROM `".(LOWER_CASE_TABLES ? "section_object" : "Section_Object")."` WHERE `Section_ID`='".$section."' AND `Checked`=1 ORDER BY `Priority` ASC LIMIT 1";
$res = mysql_query($query,$LinkID);
list($object) = mysql_fetch_row($res);
mysql_free_result($res);
if (!$object) $no_object = true; else $no_object = false;
}
#echo "-->object=".$object."<-- ";
if ($object) {
$res = mysql_query("SELECT `Object_ID`,`DefaultAction` FROM `".(LOWER_CASE_TABLES ? "section_object" : "Section_Object")."` WHERE `Section_Object_ID`='".$object."'",$LinkID);
#echo "SELECT Object_ID,DefaultAction FROM Section_Object WHERE Section_Object_ID='".$object."'";
list($classID,$default_action,$system_table) = mysql_fetch_row($res);
mysql_free_result($res);
$res = mysql_query("SELECT `System_ID` FROM `".(LOWER_CASE_TABLES ? "object" : "Object")."` WHERE `Object_ID`='".$classID."'",$LinkID);
list($system_table) = mysql_fetch_row($res);
mysql_free_result($res);
if (!$action) $action = $default_action;
if ($system_table) $user_table_mode = true;
}
if ($object && $date) {
$res = mysql_query("SELECT `Object_Field_ID` FROM `".(LOWER_CASE_TABLES ? "object_field" : "Object_Field")."` WHERE `Format`='event' AND `TypeOfData_ID`=8 AND `Object_ID`='".$classID."' LIMIT 1",$LinkID);
list($Object_FieldID) = mysql_fetch_row($res);
mysql_free_result($res);
if (!$Object_FieldID) $section = $e404_section;
}
if ($no_object && $date) $section = $e404_section;
if ($object && $message && $action=="view") {
$res = mysql_query("SELECT ".($user_table_mode?"User":"Section_Object")."_ID FROM ".($user_table_mode?"User":"Data{$tblID}")." WHERE Checked=1 AND ".($user_table_mode?"User":"Data")."_ID='".$message."'",$LinkID);
$msg_count = mysql_num_rows($res);
list($object)=mysql_fetch_row($res);
if (!$msg_count) $section = $e404_section;
mysql_free_result($res);
}
} else {
AttemptToSection_Redirect($client_source_url);
$section = $e404_section;
}
if (($section == $e404_section) && (!$skip_redirect)) {
header("HTTP/1.0 301 Moved Permanently");
if(GetPathBySectionID($e404_section)=='/index/'){
// редиректим на самую главную!
header("Location: /");
header("Connection: close");
exit;
}
header("Location: ".GetPathBySectionID($e404_section));
header("Connection: close");
exit;
} else {
if($parsed_url['path']=="/404/"||$parsed_url['path']=="/index/"){
header("HTTP/1.0 404 Not Found");
} else {
switch ($CMS_PHP_TYPE) {
case "module": header("HTTP/1.0 200 OK"); break;
case "cgi": header("Status: 200 OK"); break;
}
}
}
// Front user mode
if ($action != "index" &&
$action != "view" &&
$action != "add" &&
$action != "search" &&
$action != "subscribe") $action = "index";
if (isset($MODULE_VARS['users']["USER_MODIFY_SECTION"]) && $section == $MODULE_VARS['users']["USER_MODIFY_SECTION"]) {
$action = "edit";
$user_table_mode = true;
}
if (!$action) $action = "index";
if (!$site && !$section) exit;
$passed_thru_404 = true;
if ($action != "index") {
require_once $ROOT_FOLDER."action/".$action."/index.php";
} else {
//DebugBreak();
require_once $ROOT_FOLDER."index.php";
}
$build_time= getmicrotime() - $build_start;
if ($CMS_DEBUG) echo '';
?>