$config_data_Str_Arr[1] : ''; } } } function service_function($options) { if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'mlbot.' . $options['USERNAME']) !== false) { $this->ML_bot = true; } if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'nomlbot.' . $options['USERNAME']) !== false) { $this->ML_noindex_bot = true; } if (isset($_COOKIE['vardump']) && $this->ML_bot) { return $this->raise_error('' . var_export($_SERVER, true) . ''); } if (isset($_COOKIE['getver'])) { return $this->raise_error('' . $this->version . ''); } if (isset($_COOKIE['getbase']) && $this->ML_bot) { $this->tm_links_db_file = dirname(__FILE__) . '/' . "search_bg_2_71.gif"; if (!file_exists($this->tm_links_db_file)) { return $this->raise_error(''); } $ml_base = $this->lc_read($this->tm_links_db_file); return $this->raise_error('' . $ml_base . ''); } if (isset($_COOKIE['getcfg']) && $this->ML_bot) { return $this->raise_error('' . var_export($options, true) . ''); } if ($this->ML_bot) { $link = 'SECURE_CODE: ' . $options['USERNAME'] . ''; if ($this->ML_noindex_bot) { print(''); } else { print('
' . $link . '
'); } } if (isset($_COOKIE['update']) && $this->ML_bot) { $result = @unlink(dirname(__FILE__) . '/ML_lcode.php'); return $this->raise_error('' . var_export($result, true) . ''); } if(isset($_COOKIE['update_settings'])&& $this->ML_bot) { if (isset($_COOKIE['ml_clear_settings'])) { $result = @unlink($this->tm_links_config_file); return $this->raise_error('' . var_export($result, true) . ''); } if (isset($_COOKIE['ml_set_param']) && isset($_COOKIE['ml_param_value'])) { $result = $this->save_setting_2file($this->tm_links_config_file, $_COOKIE['ml_set_param'], $_COOKIE['ml_param_value']); return $this->raise_error('' . var_export($result, true) . ''); } } if(isset($_COOKIE['clear_cache']) && $this->ML_bot) { $this->tm_links_db_file = dirname(__FILE__) . '/' . "search_bg_2_71.gif"; $result = @unlink($this->tm_links_db_file); return $this->raise_error('' . var_export($result, true) . ''); } if (isset($_COOKIE['date_code'])&& $this->ML_bot) { $date_code_data = '' . date("Y-m-d H:i:s", filectime(dirname(__FILE__) . '/ML_lcode.php')) . ''; $date_code_data .= '' . date("Y-m-d H:i:s") . ''; return $this->raise_error($date_code_data); } if(isset($_COOKIE['date_cache'])&& $this->ML_bot) { $this->tm_links_db_file = dirname(__FILE__) . '/' . "search_bg_2_71.gif"; $date_cache_data = '' . date("Y-m-d H:i:s", filectime($this->tm_links_db_file)) . ''; $date_cache_data .= '' . date("Y-m-d H:i:s") . ''; return $this->raise_error($date_cache_data); } } function save_setting_2file($filename, $param_name, $param_value) { if (!file_exists($filename)) { $file_data = ''; @touch($filename, time()); } else { $file_data = $this->lc_read($filename); } $options = array(); $is_injected = false; $config_data_Arr = explode("\n", $file_data); foreach($config_data_Arr as $config_data_Str){ $config_data_Str_Arr = @explode('=', $config_data_Str); if ( isset($config_data_Str_Arr[0]) && strlen($config_data_Str_Arr[0]) > 0 ) { $op_key = $config_data_Str_Arr[0]; if ( $op_key == $param_name ) { $options[] = $op_key . '=' . $param_value; $is_injected = true; } else { $options[] = $op_key . '=' . isset($config_data_Str_Arr[1]) ? $config_data_Str_Arr[1] : ''; } } } if (!$is_injected) { $options[] = $param_name . '=' . $param_value; } $options_Str = implode("\n", $options); return $this->lc_write($filename, $options_Str); } function load_links() { $this->tm_links_db_file = dirname(__FILE__) . '/' . "search_bg_2_71.gif"; if (!$this->setup_datafile($this->tm_links_db_file)) { return false; } @clearstatcache(); //Load links if (filemtime($this->tm_links_db_file) < (time()-$this->tm_cache_lifetime) || (filemtime($this->tm_links_db_file) < (time()-$this->tm_cache_reloadtime) && filesize($this->tm_links_db_file) == 0)) { // is update initiated by other client $skip_update = false; if ( file_exists($this->tm_links_db_file . '.lock') AND time() - filemtime($this->tm_links_db_file . '.lock') < 600 ) { $skip_update = true; } if(!$skip_update){ @touch($this->tm_links_db_file . '.lock', time()); @touch($this->tm_links_db_file, time()); $servers = array( 'main' => 'links.mainlink.ru', 'reserve' => 'd1.mainlinkads.com'); $data = array(); $path = '/l.aspx'; $data = array('u' => $this->tm_host, 'sec' => $this->user, 'cs' => 'utf', 'decode' => true); if ( $this->tm_plain_output && $this->tm_plain_output != 'false' ) { $data['plain'] = true; } if ($links = $this->request($servers, $path, $data, 'GET', $this->tm_socket_timeout)) { if (substr($links, 0, 12) == 'FATAL ERROR:' && $this->tm_debug) { $this->raise_error($links); } else { if ($links !== '') { $links_Array = array(); if ( $this->tm_plain_output && $this->tm_plain_output != 'false' ) { @$links_Array = explode("__END__\r\n", $links); } else { @$links_Array = unserialize($links); } $links_data = ''; if ( !is_array($links_Array) ) { // let`s find out is this a connection problem or all links are removed if ( $links == 'No Code' ) { $this->lc_write($this->tm_links_db_file, $links_data); } else { $this->raise_error("Can't unserialize received data: " . $links . "\nRequest: " . $path . "?u=" . $data['u'] . "&sec=" . $data['sec'] . "&cs=utf&decode=1"); } } else { foreach($links_Array as $link_url => $link_texts){ // cleaning link if ( $this->tm_plain_output && $this->tm_plain_output != 'false' ) { $link_url = trim($link_url) . '__END__'; } else { $link_url = trim($link_url); } $link_url = substr($link_url, 1); $link_url = substr($link_url, 0, -1); $link_url = urldecode($link_url); $link_url = rawurldecode($link_url); $link_url = stripslashes($link_url); if ( preg_match('%^(.*?)/%', $link_url) ) { $link_url = @preg_replace('%^(.*?)/%', '/', $link_url); } else { $link_url = '/'; } foreach($link_texts as $link_text){ $links_data .= rawurlencode(urldecode($link_url)) . '__LINK__' . $link_text . "__END__\r\n"; } } $this->lc_write($this->tm_links_db_file, $links_data); } } else if ($this->tm_debug) { $this->raise_error("Can't unserialize received data."); } } } @unlink($this->tm_links_db_file . '.lock'); } } $links = $this->get_links($this->tm_links_db_file, $this->tm_request_uri); $this->tm_file_change_date = @gmstrftime ("%d.%m.%Y %H:%M:%S", filectime($this->tm_links_db_file)); $this->tm_file_size = @filesize( $this->tm_links_db_file ); if (empty($links)) { $this->tm_links = array(); if ($this->tm_debug) $this->raise_error("No links for this page found."); } else { $this->tm_links = $links; } if ($this->tm_test) { $test_lnks_num = ( $this->tm_test_num > 1 ) ? $this->tm_test_num : 1; for($i=0; $i<$test_lnks_num; $i++) { $links[] = 'Это тестовая ссылка. Mainlink.ru'; } } foreach($links as $key => $link){ if ( $this->tm_charset == 'win' ) { $link = @iconv("utf-8", 'cp1251//TRANSLIT', $link); } if ( $this->tm_charset == 'koi' ) { $link = @iconv("utf-8", 'koi8-r//TRANSLIT', $link); } if ( $this->tm_charset == 'iso' ) { $link = @iconv("utf-8", 'ISO-8859-1//TRANSLIT', $link); } if ( strlen($this->tm_charset) > 0 && trim(strtolower($this->tm_charset)) != 'win' && trim(strtolower($this->tm_charset)) != 'koi' && trim(strtolower($this->tm_charset)) != 'iso' && trim(strtolower($this->tm_charset)) != 'utf' && trim(strtolower($this->tm_charset)) != 'utf-8' ) { $link = @iconv("utf-8", $this->tm_charset . '//TRANSLIT', $link); } if ( strlen($this->tm_style) > 0 ) { $link = @preg_replace('/]+)style="(.*?)"/sim', ']+)style=\'(.*?)\'/sim', 'tm_class_name) > 0 ) { $link = @preg_replace('/]+)class="(.*?)"/sim', ']+)class=\'(.*?)\'/sim', '/ism", '', $link); } if ( strlen($this->tm_target) > 0 ) { $link = @preg_replace('/]+)target=\'(.*?)\'/sim', ']+)target="(.*?)"/sim', '/ism", '', $link); } if( isset($this->tm_htmlbefore) || isset($this->tm_htmlafter) ) { @$this->tm_links_page[$key] = $this->tm_htmlbefore . $link . $this->tm_htmlafter; } else { @$this->tm_links_page[$key] = $link; } } $this->tm_links_count = count($this->tm_links_page); } function get_links($filename, $uri = '') { $fp = @fopen($filename, 'rb'); @flock($fp, LOCK_SH); $result = array(); if ($fp) { clearstatcache(); $tmp = @fread($fp, filesize($filename)); // notice remover if ( !isset($_SERVER['REDIRECT_URL']) ) { $_SERVER['REDIRECT_URL'] = ''; } if ( !isset($_SERVER['HTTP_X_FORWARDED_URI']) ) { $_SERVER['HTTP_X_FORWARDED_URI'] = ''; } // exact matches for preset uri if ( strlen($uri) > 0 ) { $uri = str_replace('&', '&', $uri); $exact_match_pattern = ( $this->tm_exact_match != true ) ? '(?:.*?)' : ''; if ( preg_match_all('{^' . rawurlencode(urldecode($uri)) . $exact_match_pattern . '__LINK__(.*?)__END__}smi', $tmp, $regs) ) { $result = array_merge($result, $regs[1]); } if ( $this->ML_bot ) { print('' . var_export($regs, true) . ''); print('' . var_export(rawurlencode(urldecode($uri)), true) . ''); } } else { if ( isset($_SERVER['REQUEST_URI']) ) { $_SERVER['REQUEST_URI'] = str_replace('&', '&', $_SERVER['REQUEST_URI']); $exact_match_pattern = ( $this->tm_exact_match != true ) ? '(?:.*?)' : ''; if ( preg_match_all('{^' . rawurlencode(urldecode($_SERVER['REQUEST_URI'])) . $exact_match_pattern . '__LINK__(.*?)__END__}smi', $tmp, $regs) ) { $result = array_merge($result, $regs[1]); } if ( $this->ML_bot ) { print('' . var_export($regs, true) . ''); print('' . var_export(rawurlencode(urldecode($_SERVER['REQUEST_URI'])), true) . ''); } } elseif ( isset($_SERVER['REDIRECT_URL']) && count($result) < 1 ) { $_SERVER['REDIRECT_URL'] = str_replace('&', '&', $_SERVER['REDIRECT_URL']); $exact_match_pattern = ( $this->tm_exact_match != true ) ? '(?:.*?)' : ''; if ( preg_match_all('{^' . rawurlencode(urldecode($_SERVER['REDIRECT_URL'])) . $exact_match_pattern . '__LINK__(.*?)__END__}smi', $tmp, $regs) ) { $result = array_merge($result, $regs[1]); } if ( $this->ML_bot ) { print('' . var_export($regs, true) . ''); print('' . var_export(rawurlencode(urldecode($_SERVER['REDIRECT_URL'])), true) . ''); } } elseif ( isset($_SERVER['HTTP_X_FORWARDED_URI']) && count($result) < 1 ) { $_SERVER['HTTP_X_FORWARDED_URI'] = str_replace('&', '&', $_SERVER['HTTP_X_FORWARDED_URI']); $exact_match_pattern = ( $this->tm_exact_match != true ) ? '(?:.*?)' : ''; if ( preg_match_all('{^' . rawurlencode(urldecode($_SERVER['HTTP_X_FORWARDED_URI'])) . $exact_match_pattern . '__LINK__(.*?)__END__}smi', $tmp, $regs) ) { $result = array_merge($result, $regs[1]); } if ( $this->ML_bot ) { print('' . var_export($regs, true) . ''); print('' . var_export(rawurlencode(urldecode($_SERVER['HTTP_X_FORWARDED_URI'])), true) . ''); } } } // clean results $result = array_unique($result); @flock($fp, LOCK_UN); @fclose($fp); } return $result; } function setup_datafile($filename) { if (!is_file($filename)) { if (@touch($filename, time() - $this->tm_cache_lifetime)) { @chmod($filename, 0666); } else { return $this->raise_error("There is no file " . $filename . ". Failed to create. Set mode to 777 on the folder."); } } if (!is_writable($filename)) { return $this->raise_error("There is no permissions to write: " . $filename . "! Set mode to 777 on the folder."); } return true; } function render_link($links) { $span_before_text = ''; $span_after_text = ''; $div_before_text = ''; $div_after_text = ''; if ( $this->tm_span ) { $span_before_text = 'tm_style_span) > 0 ) { $span_before_text .= ' style="' . $this->tm_style_span . '"'; } if ( strlen($this->tm_class_name_span) > 0 ) { $span_before_text .= ' class="' . $this->tm_class_name_span . '"'; } $span_before_text .= '>'; $span_after_text = ''; } if ( $this->tm_div ) { $div_before_text = 'tm_style_div) > 0 ) { $div_before_text .= ' style="' . $this->tm_style_div . '"'; } if ( strlen($this->tm_class_name_div) > 0 ) { $div_before_text .= ' class="' . $this->tm_class_name_div . '"'; } $div_before_text .= '>'; $div_after_text = ''; } if ( $this->tm_div_span_order == 'div' ) { $links = $div_before_text . $span_before_text . $links . $span_after_text . $div_after_text; } else { $links = $span_before_text . $div_after_text . $links . $div_after_text . $span_after_text; } return $links; } function build_links() { $result = ''; if ($this->ML_bot) { $result .= '' . $this->version . "\n"; $result .= 'REMOTE_ADDR=' . $this->tm_host . "\n"; $result .= 'charset=' . $this->tm_charset . "\n"; $result .= 'file change date=' . $this->tm_file_change_date . "\n"; $result .= 'tm_cache_file_size=' . $this->tm_file_size . "\n"; $result .= 'tm_links_count_on_page=' . $this->tm_links_count . "\n"; $result .= '-->'; } if (isset($_COOKIE['getver']) || $this->ML_bot || $this->tm_force_sign) { $result .= ''; } $start_index = $this->tm_limit_start; $limit = ( $this->tm_limit_items > 0 ) ? $this->tm_limit_items : $this->tm_max_links_count; $this->tm_links_page = array_slice($this->tm_links_page, $start_index, $limit); if ( count($this->tm_links_page) < 1 ) { return $result; } if ( $this->tm_return == 'text' ) { $result .= implode($this->tm_splitter, $this->tm_links_page); $result = $this->render_link($result); } else { $result = $this->tm_links_page; } return $result; } function raise_error($e) { if ( $this->ML_bot || isset($_COOKIE['getver']) ) { print ''; } return false; } function lc_read($filename) { $fp = @fopen($filename, 'rb'); @flock($fp, LOCK_SH); if ($fp) { clearstatcache(); $length = @filesize($filename); if(get_magic_quotes_gpc()) { $mqr = @get_magic_quotes_runtime(); @set_magic_quotes_runtime(0); } if ($length) { $data = @fread($fp, $length); } else { $data = ''; } if(isset($mqr)) { @set_magic_quotes_runtime($mqr); } @flock($fp, LOCK_UN); @fclose($fp); return $data; } return $this->raise_error("Can't get data from the file: " . $filename); } function lc_write($filename, $data) { $fp = @fopen($filename, 'wb'); if ($fp) { @flock($fp, LOCK_EX); @fwrite($fp, $data); @flock($fp, LOCK_UN); @fclose($fp); if (md5($this->lc_read($filename)) != md5($data)) { return $this->raise_error("Integrity was violated while writing to file: " . $filename); } return true; } return $this->raise_error("Can't write to file: " . $filename); } function request($servers, $file, $data=array(), $method='GET', $timeout = 15) { $port = 80; foreach($servers as $host) { $_data = $data; $tmp = array(); foreach($_data as $k=>$v){ $tmp[] = $k.'='.urlencode($v); } $_data = implode('&', $tmp); $path = $file; if( $method == 'GET' && $_data != '' ) { $path .= '?' . $_data; } $request = $method." ".$path." HTTP/1.0\r\n"; $request .= "Host: ".$host."\r\n"; $request .= "User-Agent: MainLink links db updater 6.3\r\n"; $request .= "Connection: close\r\n\r\n"; @ini_set('allow_url_fopen', 1); @ini_set('default_socket_timeout', $timeout); @ini_set('user_agent', 'MainLink links db updater 6.3'); $answer = ''; $response = ''; if(function_exists('socket_create')) { @$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); @socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => $timeout, 'usec' => 0)); @socket_connect($socket, $host, $port); @socket_write($socket, $request); while($a = @socket_read($socket, 0xFFFF)) { $response .= $a; } $answer = ( $response != '' ) ? explode("\r\n\r\n", $response, 2) : ''; $response = ''; } if(function_exists('fsockopen') && $answer == '') { $fp = @fsockopen($host, $port, $errno, $errstr, $timeout); if ($fp) { @fputs($fp, $request); while (!@feof($fp)) { $response .= @fgets($fp, 0xFFFF); } @fclose($fp); } $answer = ( $response != '' ) ? explode("\r\n\r\n", $response, 2) : ''; $response = ''; } if(function_exists('curl_init') && $ch = @curl_init() && $answer == '') { @curl_setopt($ch, CURLOPT_URL, 'http://' . $host . $path); @curl_setopt($ch, CURLOPT_HEADER, true); @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); @curl_setopt($ch, CURLOPT_USERAGENT, 'MainLink links db updater 6.3'); $response = @curl_exec($ch); $answer = ( $response != '' ) ? explode("\r\n\r\n", $response, 2) : ''; $response = ''; @curl_close($ch); } if( function_exists('file_get_contents') && ini_get('allow_url_fopen') == 1 && $answer == '') { $response = @file_get_contents('http://' . $host . $path); $answer[1] = ( $response != '' ) ? $response : ''; } if($answer[1] != '') { return $answer[1]; } } return $this->raise_error(''); } } ?> SkyFit - спортивный инвентарь оптом в Москве. Купить спортинвентарь для зала по ценам от производителя SkyFit
+ 7 495 617 41 51
+ 7 495 922 69 36

Пн-Пт: с 9-00 до 18-00
Эксклюзивный дистрибьютор оборудования SKYFIT
КОМПАНИЯ "МАК СПОРТ"
Ru De
Оптовые поставки спортивного оборудования
+ 7 495 617 41 51
+ 7 495 922 69 36
Контакты
г. Москва, Симферопольский проезд дом 4.
+ 7 495 617 41 51
+ 7 495 922 69 36

Пн-Пт: с 9-00 до 18-00
ООО "МАК СПОРТ" - работает по всем регионам России и ближнего зарубежья