', print_r($_SESSION), ''; $lngModule = "INDEX_PAGE"; $lngFile = basename(__FILE__); $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $_SESSION['protocol'] = $protocol; // GET THE IP if(!isset($_SESSION['visitor_ip'])) { // Get client's IP address if (isset($_SERVER['HTTP_CLIENT_IP']) && array_key_exists('HTTP_CLIENT_IP', $_SERVER)) { $visitor_ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) { $visitor_ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); $visitor_ips = array_map('trim', $visitor_ips); $visitor_ip = $visitor_ips[0]; } else { $visitor_ip = $_SERVER['REMOTE_ADDR'] ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0'; } $visitor_ip = filter_var($visitor_ip, FILTER_VALIDATE_IP); $visitor_ip = ($visitor_ip === false) ? '0.0.0.0' : $visitor_ip; $_SESSION['visitor_ip'] = $visitor_ip; } //$screenshot_url = 'https://images.thumbshots.com/image.aspx?cid=wAQzqmGmx3A%3d&v=1&'; $screenshot_url = 'https://cypruspics.com/thumbshot/?'; function gzip_PrintFourChars($Val) { for ($i = 0; $i < 4; $i ++) { echo chr($Val % 256); $Val = floor($Val / 256); } } function print_gzipped_page($ppp_contents, $params) { global $protocol, $line_domain, $ultra_domainname, $meta_og, $og_lang, $lang2iso, $_SID, $full_uri; if( headers_sent() ){ $encoding = false; }elseif( strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false ){ $encoding = 'x-gzip'; }elseif( strpos($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip') !== false ){ $encoding = 'gzip'; }else{ $encoding = false; } /**** Prepare contents ********/ $contents = $ppp_contents; $send404 = false; if(isset($params['send404']) && intval($params['send404']) == 1) { header("HTTP/1.0 404 Not Found"); // Empty the contents and refill with the 404 page $contents = null; $url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $part = str_replace($full_uri, "", $url); $contents = file_get_contents(__DIR__ . "/modules/404/index.html"); $contents = str_replace("{{HOMEPAGE}}", $full_uri, $contents); $contents = str_replace("{{WEBSITE}}", $line_domain['domainname'], $contents); $contents = str_replace("{{WEBSITE_TITLE}}", stripslashes($line_domain['title_en']), $contents); $contents = str_replace("{{URL_PART}}", "/$part", $contents); $send404 = true; } //echo '
', print_r($params), '
'; if(isset($params) && count($params)>0 && !$send404) { if(isset($params['stylesheet_file'])) { $contents = str_replace("@STYLESHEET_FILE@", $params['stylesheet_file'], $contents); } if(isset($params['javascript_file'])) { $contents = str_replace("@JAVASCRIPT_FILE@", $params['javascript_file'], $contents); } if(isset($params['api_load']) && count($params['api_load'])>0) { if(isset($params['api_load']['file']) && count($params['api_load']['file']) > 0) { $insert_js_file_load = ""; foreach ($params['api_load']['file'] as $i=>$js_file_load) { $insert_js_file_load .= '' . "\n"; } $contents = str_replace("", $insert_js_file_load, $contents); } if(isset($params['api_load']['static']) && count($params['api_load']['static']) > 0) { $insert_js_static_load = ''; $contents = str_replace("", $insert_js_static_load, $contents); } } // Update ROOT_URL $contents = str_replace("[/ROOT_URL/]", $params['root_url'], $contents); // Addition to Page Title $_webpagetitle = ''; if(isset($params['webpagetitle'])) $_webpagetitle = $params['webpagetitle']; $contents = str_replace("[/webpagetitle/]", $_webpagetitle, $contents); $_robots = ''; if(isset($params['robots'])) { $_robots = ''; $contents = str_replace("", $_robots, $contents); } $_metadescription = ''; if(isset($params['metadescription'])) $_metadescription = $params['metadescription']; $contents = str_replace("[/metadescription/]", $_metadescription, $contents); $_keywords = ''; if(isset($params['keywords'])) { $_keywords = $params['keywords']; $contents = str_replace("[/keywords/]", $_keywords, $contents); } $_openx_zone = ''; if(isset($params['openx_zone'])) { $_openx_zone = $params['openx_zone']; foreach ($_openx_zone as $ox_i => $ox_data) { $ox_z_id = $ox_data['openx_zone_id']; $ox_z_code = stripslashes($ox_data['openx_zone_code']); $contents = str_replace("[/$ox_z_id/]", $ox_z_code, $contents); } } $_canonical_link = ''; if(isset($params['canonical_link'])) { $_canonical_link = trim($params['canonical_link']); $contents = str_replace("", '', $contents); } $_prev_page = ''; if(isset($params['prev_page'])) { $_prev_page = trim($params['prev_page']); $contents = str_replace("", '', $contents); } $_next_page = ''; if(isset($params['next_page'])) { $_next_page = trim($params['next_page']); $contents = str_replace("", '', $contents); } // Open Graph Implementation $og_meta = ''; if (isset($meta_og['fb:admins']) && $meta_og['fb:admins'] != "") { $og_meta .= ''; } if (isset($meta_og['fb:app_id']) && $meta_og['fb:app_id'] != "") { $og_meta .= ''; } $og_url = ($_canonical_link != "") ? $_canonical_link : $protocol.$ultra_domainname . $_SERVER['REQUEST_URI']; $og_url = str_replace(array( 'remove_cache=all', 'clean_cache=1', 'yp_renew=1', 'bl_renew=1', ), '', $og_url); $og_url = rtrim($og_url, '?'); $og_meta .= ''; $og_meta .= ''; $og_meta .= ''; if (isset($meta_og['description'])) { $og_meta .= ''; } else { $og_meta .= ''; } if (isset($meta_og['type']) && trim($meta_og['type'] != "")) { $og_meta .= ''; } else { $og_meta .= ''; } if (isset($meta_og['image'])) { if (is_array($meta_og['image'])) { foreach ($meta_og['image'] as $og_image) { if ($og_image != "") $og_meta .= ''; } } else { if ($meta_og['image'] != "") { $og_meta .= ''; } else { $og_meta .= ''; } } } else { $og_meta .= ''; } $og_meta .= ''; $contents = str_replace("", $og_meta, $contents); } else { //echo '
No Params'; } if (ob_get_length() > 0) { //ob_end_clean(); } /***** Prepare contents }********/ if(isset($params['send404']) && intval($params['send404']) == 1) { header("HTTP/1.0 404 Not Found"); // Empty the contents and refill with the 404 page $contents = null; $homepage = $full_uri; if(str_replace("www.", "", $_SERVER['HTTP_HOST']) != str_replace("www.", "", $line_domain['domainname'])) { $homepage .= "{$line_domain['addonname']}/"; } $url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $part = str_replace($homepage, "", $url); $contents = file_get_contents(__DIR__ . "/modules/404/index.html"); $contents = str_replace("{{HOMEPAGE}}", $homepage, $contents); $contents = str_replace("{{WEBSITE}}", $line_domain['domainname'], $contents); $contents = str_replace("{{WEBSITE_TITLE}}", stripslashes($line_domain['title_en']), $contents); $contents = str_replace("{{URL_PART}}", "/$part", $contents); } if(isset($params['send301']) && count($params['send301']) == 2) { header( "HTTP/1.1 301 Moved Permanently" ); header( "Location: {$params['send301']['url']}" ); } if( $encoding ){ header('Content-Encoding: '.$encoding); print("\x1f\x8b\x08\x00\x00\x00\x00\x00"); $Size = strlen($contents); $Crc = crc32($contents); $size = strlen($contents); $contents = gzcompress($contents, 9); $contents = substr($contents, 0, strlen($contents) - 4); // Show only the compressed data echo $contents; // Output the CRC, then the size of the original gzip_PrintFourChars($Crc); gzip_PrintFourChars($Size); exit(); } else{ echo $contents; exit; } } if(!isset($_SESSION[$_SID]['lang']) || $_SESSION[$_SID]['lang']=="") { unset($_SESSION[$_SID]['lang']); unset($_SESSION[$_SID]['domainname']); unset($_SESSION[$_SID]['hosting_server']); unset($_SESSION[$_SID]['alt_ip']); unset($_SESSION[$_SID]['countrySHORT']); unset($_SESSION[$_SID]['countryLONG']); } $general_path = "./"; $modules_path = "modules"; $out_path = "../"; $full_uri = $protocol . str_replace("/", "", $_SERVER['HTTP_HOST']) . "/"; ob_start(); ob_implicit_flush(0); include_once($general_path."locales.inc.php"); include_once($general_path."config.php"); require_once(dirname(__FILE__) . "/data.cache.php"); $www_cache = new Cy_Cache_Filesystem($ultra_domainname); if(isset($_REQUEST['page']) && $_REQUEST['page'] == 1 && isset($_REQUEST['module_page'])){ $include_page_file = ""; $module_page = mysql_real_escape_string(trim($_REQUEST['module_page'])); $qmod = "select * from module where url='$module_page';"; $rmod = @mysql_query($qmod); if($rmod && mysql_num_rows($rmod)>0) { $rowmod = mysql_fetch_assoc($rmod); $mc_module_id = $rowmod['module_id']; } if(substr($module_page, -4) != ".php") { if(isset($_REQUEST['action'])) { $action = $_REQUEST['action']; if(substr($action, -4) == ".php") { $include_page_file = $modules_path."/$module_page/$action"; } else { $include_page_file = "$modules_path/$module_page/$action.php"; } } else { if(file_exists("$modules_path/$module_page.php")) $include_page_file = "$modules_path/$module_page.php"; else { if(is_dir("$modules_path/$module_page")) { $include_page_file = "$modules_path/$module_page/$module_page.php"; } } } } else { $include_page_file = "$modules_path/$module_page.php"; } if(file_exists($include_page_file)) { include_once($include_page_file); } else { echo "
[$include_page_file] The content of this page is no longer available!"; } } elseif(isset($_REQUEST['page']) && $_REQUEST['page'] == 1){ if(isset($module_page)) { if(file_exists("$modules_path/$module_page.php")) { $include_page_file = "$modules_path/$module_page.php"; } else { if(is_dir("$modules_path/$module_page")) { $include_page_file = "$modules_path/$module_page/$module_page.php"; } } if(file_exists($include_page_file)) { include_once($include_page_file); } } } else{ include_once($general_path."top_include.inc.php"); if($show_lang_bar == 1) { include_once($general_path."languages_bar.php"); } else { echo ''; } if($header_active == "yes") { if($header_default == "yes") { //print $header_default; include_once ($general_path."header.php"); } else { $qhead = "select * from theaders where id='$header_file'"; $rhead = mysql_query($qhead) or die(mysql_error()); if($rhead && mysql_num_rows($rhead)>0) { $rowhead = mysql_fetch_array($rhead); $header_path = $rowhead['path']; $header_file = "$general_path".$header_path."header.htm"; $header_css_file = "$general_path".$header_path."header.css"; if(file_exists($header_file)) { //include_once($header_file); $need_eval = false; $custom_header_code = file_get_contents($header_file); $custom_header_code = str_replace("../all_files/headers", "all_files/headers", $custom_header_code); $custom_header_code = str_replace("//images", "/images", $custom_header_code); if(strpos($custom_header_code, '[/SEARCH/]') !== false && $line_domain['header_adv_srch'] == "yes") { $need_eval = true; $search_script = ''; $search_script .= '
'; $search_script .= ''; $search_script .= '
'; $custom_header_code = preg_replace('/\[\/SEARCH\/\]/i', "$search_script", $custom_header_code); } else { $custom_header_code = preg_replace('/\[\/SEARCH\/\]/i', "", $custom_header_code); } if(strpos($custom_header_code, '[/GOOGLESEARCH/]') !== false && !$send404) { $need_eval = true; $search_script = ''; $search_script .= ''; $custom_header_code = preg_replace('/\[\/GOOGLESEARCH\/\]/i', "$search_script", $custom_header_code); } else { $custom_header_code = preg_replace('/\[\/GOOGLESEARCH\/\]/i', "", $custom_header_code); } // Detect AdSense in header if(strpos($custom_header_code, '[/GOOGLEADSLOT') !== false && !$send404) { $gas = preg_match('/\[\/GOOGLEADSLOT=([0-9]+)\/\]/', $custom_header_code, $gas_matches); if($gas) { $gas_replace_str = $gas_matches[0]; $gas_google_ad_slot = $gas_matches[1]; include_once($modules_path.'/wsbin/lib/nusoap.php'); include_once($modules_path.'/public_functions/web_services.php'); $gas_google_ad_slot_code = getAdSenseCodeBySlot($gas_google_ad_slot); $custom_header_code = str_replace($gas_replace_str, "$gas_google_ad_slot_code", $custom_header_code); } else { $custom_header_code = str_replace('[/GOOGLEADSLOT/]', "", $custom_header_code); } /* $search_script = ''; $search_script .= ''; $custom_header_code = preg_replace('/\[\/GOOGLESEARCH\/\]/i', "$search_script", $custom_header_code); */ } if(strpos($custom_header_code, '[/LOGOIMAGE/]') !== false) { $need_eval = true; $logoname_script = ''; $logoname_script .= ''; $custom_header_code = preg_replace('/\[\/LOGOIMAGE\/\]/i', "$logoname_script", $custom_header_code); } if(strpos($custom_header_code, '[/TEXTIMAGE/]') !== false) { $need_eval = true; $logoimage_script = ''; $logoimage_script .= ''; $custom_header_code = preg_replace('/\[\/TEXTIMAGE\/\]/i', "$logoimage_script", $custom_header_code); } if(strpos($custom_header_code, '[/LOGOTEXT/]') !== false) { $need_eval = true; $logotext_script = ''; $logotext_script .= stripslashes($line_domain["logo_text"]); $custom_header_code = preg_replace('/\[\/LOGOTEXT\/\]/i', "$logotext_script", $custom_header_code); } $custom_header_code = str_replace('[/ROOT_URL/]', $full_addon_uri, $custom_header_code); if($need_eval) { eval("?>".$custom_header_code); } else { echo $custom_header_code; } } else { include_once ($general_path."header.php"); } } } //print "../headers/".$path."header.htm"; } ?>
" . $qmc . "
aaa
"; $rmc = mysql_query($qmc) or die("$qmc".mysql_error()); if($rmc && mysql_num_rows($rmc)>0) { $rowmc = mysql_fetch_array($rmc); $mc_module_id = $rowmc['module_id']; $mc_module_params = $rowmc['module_params']; if($mc_module_params && !empty($mc_module_params) ) { $module_params = unserialize(base64_decode($mc_module_params)); //print_r($module_params); } } else { $send404 = true; } } if(is_dir( "$modules_path/$module_page")) { $include_page = "$modules_path/$module_page/".$module_page.".php"; if(isset($_REQUEST['action'])) { $action = $_REQUEST['action']; if(file_exists("$modules_path/$module_page/".$action.".php")) { $include_page = "$modules_path/$module_page/".$action.".php"; $have_middle_content = 1; } } } else { if(file_exists("$modules_path/".$module_page.".php")) { $include_page = "$modules_path/".$module_page.".php"; $have_middle_content = 1; } } } if($have_middle_content == 0) { $include_page = $general_path."middle_content.php"; } if(!isset($include_page) || !file_exists($include_page)){ $include_page = $general_path."middle_content.php"; } if(isset($_REQUEST['mreg']) || (isset($_SESSION[$_SID]['auth_id']) && intval($_SESSION[$_SID]['auth_id']) > 0 && isset($_SESSION[$_SID]['member_id'])) ) { if(isset($_SESSION[$_SID]['member_id']) && intval($_SESSION[$_SID]['member_id']) > 0) { $my_account_menu_path = $modules_path."/my_account/my_account_menu.php"; //echo $my_account_menu_path; if(file_exists($my_account_menu_path)) { include_once($my_account_menu_path); $user_menu_included = true; } } else { if(isset($_SESSION[$_SID]['auth_id']) && intval($_SESSION[$_SID]['auth_id']) > 0) { // } else { //$logmsg = '
' . t_("Ooops! This page requires authentication!") . '
' . t_("You are not logged in. Please login or signup in order to access this page.") . '
'; //$logmsg = '
' . t_("Ooops! This page requires authentication!") . '
' . t_("Some errors occured. PLEASE TRY TO LOGIN AGAIN!.") . '
'; ?> ', var_export($_SESSION, true), ''; } } } if(!isset($send404) || !$send404) { if(isset($logmsg) && trim($logmsg) != "") { echo $logmsg; } else { if(file_exists($include_page)) { include($include_page); } } if(isset($module_params)) { unset($module_params); } } else { include("$modules_path/404/404.php"); } ?>
} ?> 0) { $css_lastmodified = 0; $js_lastmodified = 0; if(count($optres['css'])>0) { $optres['css'][] = $css_path . 'print.css'; foreach ($optres['css'] as $i=>$css_file) { if(substr($css_file, 0, 4) == "http") { $css_file = str_replace("$path", "../", $css_file); $optres['css'][$i] = $css_file; } $res_path = realpath($css_file); $css_lastmodified = max($css_lastmodified, filemtime($res_path)); } } /**/ if(count($optres['js'])>0) { foreach ($optres['js'] as $i=>$js_file) { if(substr($js_file, 0, 4) == "http") { $js_file = str_replace("$path", "../", $js_file); $optres['js'][$i] = $js_file; } $res_path = realpath($js_file); $js_lastmodified = max($js_lastmodified, filemtime($res_path)); } } /**/ $all_cache_folder = "all_cache"; $all_cache_folder = str_ireplace("//", "/", $all_cache_folder); $all_cache_res = "$all_cache_folder/resources"; /* Check if cache folders are in place ******************************************************/ $have_res_cache_folder = false; if(!file_exists("$all_cache_folder") || !is_dir("$all_cache_folder")) { if( @mkdir("$all_cache_folder", 0755) ) { if( @mkdir("$all_cache_res", 0755) ) { $have_res_cache_folder = true; } } } else { if(!file_exists("$all_cache_res") || !is_dir("$all_cache_res")) { if( @mkdir("$all_cache_res", 0755) ) { $have_res_cache_folder = true; } } } if(file_exists($all_cache_res) && is_dir($all_cache_res)) { $have_res_cache_folder = true; } /* END Check for cache folders *************************************************************/ if($have_res_cache_folder) { // Do the css $css_cache_mesh = "cache-" . md5(implode(",", $optres['css'])).".css"; $css_cache_file = "$all_cache_res/$css_cache_mesh"; if(file_exists($css_cache_file) && $css_lastmodified <= filemtime($css_cache_file)) { // Use the cache file /**** ?> " media="all"/> 0 ) { $res_dump = ""; foreach ($optres['css'] as $res_file) { if(file_exists($res_file)) { $res_path = realpath($res_file); $file_css_content = file_get_contents($res_file); $file_css_content = str_replace("moduleres/", $protocol . $_SERVER['HTTP_HOST'] . "/" . $modules_path . "/", $file_css_content); $file_css_content = str_replace("cssres/", $protocol . $_SERVER['HTTP_HOST'] . "/" . $path . "/", $file_css_content); $file_css_content = str_replace("images/", $protocol . $_SERVER['HTTP_HOST'] . "/" ."$css_path/images/", $file_css_content); $file_css_content = str_replace("//images", "/images", $file_css_content); $res_dump .= "\n\n" . $file_css_content; } else { //echo "
$res_file does not exist"; } } $rfile = @fopen("$css_cache_file", "w"); fwrite($rfile, $res_dump, strlen($res_dump)); /**** ?> "/> 0); if($have_js_array) { $js_cache_mesh = "cache-" . md5(implode(",", $optres['js'])).".js"; } else { $js_cache_mesh = "cache-" . md5("no_js_file").".js"; } $js_cache_file = "$all_cache_res/$js_cache_mesh"; if(file_exists($js_cache_file) && $js_lastmodified <= filemtime($js_cache_file) && $have_js_array) { // Use the cache file /****** ?> 0 ) { $res_dump = ""; foreach ($optres['js'] as $res_file) { if(file_exists($res_file)) { $res_path = realpath($res_file); $res_dump .= "\n\n" . file_get_contents($res_file); } } $rfile = @fopen("$js_cache_file", "w"); fwrite($rfile, $res_dump, strlen($res_dump)); /**** ?> folder $all_cache_res does not exist"; } } if(isset($js_to_bottom) && count($js_to_bottom)>0) { $js_to_bottom = array_unique($js_to_bottom); foreach ($js_to_bottom as $k=>$src) { echo '' . "\n"; } } ?> $stylesheet_file, "javascript_file" => $javascript_file, "api_load" => $google_api_load ); */ //echo '
', print_r($optres), '
'; $params = array( "stylesheet_file" => (isset($stylesheet_file)) ? "$stylesheet_file" : '', "javascript_file" => (isset($javascript_file)) ? "$javascript_file" : '', "api_load" => isset($google_api_load) ? $google_api_load : '' ); //echo '
', print_r($params), '
'; $params['root_url'] = $protocol . $_SERVER['HTTP_HOST']; if(str_ireplace("www.", "", $_SERVER['HTTP_HOST']) != $ultra_domainname) { $params['root_url'] = $protocol . $_SERVER['HTTP_HOST'] . "/$ultra_addonname"; } if(isset($canonical_link) && trim($canonical_link) != "") { $params['canonical_link'] = $canonical_link; } if(isset($rel_prev_page) && trim($rel_prev_page) != "") { $params ['prev_page'] = trim($rel_prev_page); } if(isset($rel_next_page) && trim($rel_next_page) != "") { $params ['next_page'] = trim($rel_next_page); } if(isset($webpagetitle)) { $params['webpagetitle'] = $webpagetitle; } elseif (isset($webpage_title_en)) { $params['webpagetitle'] = stripslashes($webpage_title_en); } if(isset($meta["description"])) { $params['metadescription'] = stripslashes(trim($meta["description"])); } if(isset($meta["keywords"])) { $params['keywords'] = stripslashes(trim($meta["keywords"])); } if(isset($meta["robots"]) && trim($meta['robots']) != "") { $params['robots'] = stripslashes(trim($meta["robots"])); } if(isset($meta["openx_zone"]) && count($meta["openx_zone"]) > 0) { $params['openx_zone'] = $meta["openx_zone"]; } if(isset($send404) && $send404 == true) { $params ['send404'] = 1; } $ppp_contents = ob_get_contents(); ob_end_clean(); if(!isset($no_page_cache) || $no_page_cache == false) { setcookie("lscache", "enable"); } else { setcookie("lscache", "", time()-86400*365); } print_gzipped_page($ppp_contents, $params); ?>