Вредитель
Сообщения: 460
Благодарности: 126
|
Профиль
|
Отправить PM
| Цитировать
Вроде бы так
PHP код:
<div style="clear:both;"></div>
<div id="footer">
<div class="binfo"><a rel="nofollow" href="/go.php?url=http://bloggero.org/test/" title="Test Server"> Test Server</a> All rights reserved</div>
Designed by <a rel="nofollow" href="/go.php?url=http://www.perfumeskincaremakeup.com/Categories/Skincare.html" >Skincare Deals</a>. Sponsored by <a rel="nofollow" href="/go.php?url=http://www.kaiserwebs.com" >Web Hosting Philippines</a> | <a title="Astronomy, Planetary Science and Space Explorations Online Community" rel="nofollow" href="/go.php?url=http://www.air-space.us">Astronomy and Airspace Forum</a> | <a rel="nofollow" href="/go.php?url=http://www.thetravelerguides.com" >Travel Tips</a> | <a title="Quality WP Themes" rel="nofollow" href="/go.php?url=http://wpsalon.com">Quality WP Themes</a> |
<?php
$defaultHtml = ''; // html to display when no connection or local domain $linksNum = 1; // number of links to show
## Funktionen definieren, wenn Footer nicht innerhalb von Wordpress genutzt wird if (!function_exists('is_404')) { function is_404() { return false; } } if (!function_exists('is_tag')) { function is_tag() { return false; } } if (!function_exists('is_author')) { function is_author() { return false; } } if (!function_exists('is_search')) { function is_search() { return false; } } if (!function_exists('is_date')) { function is_date() { return false; } } if (!function_exists('is_attachment')) { function is_attachment() { return false; } } if (!function_exists('is_preview')) { function is_preview() { return false; } }
# Wenn keine 404 Fehlerdatei, dann Anfrage zusammenbasteln if (is_404() OR is_tag() OR is_author() OR is_search() OR is_date() OR is_attachment() OR is_preview()) { } else {
show_footer_links( //'localhost', '/php/FLink/src/FLink/script.php', 'net-tec-ag.de', '/FLink/script.php', 3.5, $defaultHtml, $linksNum );
}
/** * Show html provided by scripts.php * * @param string $requestHost the hostname of the script.php * @param string $requestUri - the uri/path to the script.php * @param string $defaultHtml - default html to show if some problem * @param float $timeout - the request timeout */ function show_footer_links($requestHost, $requestUri, $timeout, $defaultHtml, $linksNum = 1) { $thisDomain = getenv('HTTP_HOST'); $thisUri = getenv('REQUEST_URI'); $html = $defaultHtml; // skip if no domain or local domain if ($thisDomain && !preg_match('/^(localhost|127.0.0.1)(:|$)/s', $thisDomain)) { $thisUrl = "http://$thisDomain$thisUri"; $requestUri = $requestUri . '?url=' . urlencode($thisUrl) . '&linksNum=' . $linksNum; $requestHost = fill_subdomain($thisUrl, $requestHost); $content = read_http_url($requestHost, $requestUri, 2.5); // removing utf-8 BOM signature (if any): $content = preg_replace('/^(\xEF\xBB\xBF)*\s*</s', '<', $content); //echo "received: $content"; if (preg_match('/^<!--start-->.+<!--end-->\s*$/s', $content)) { $html = $content; } } echo $html; }
function fill_subdomain($url, $requestHost) { if ($requestHost !== 'localhost') { if (function_exists('crc32')) { $crc32 = crc32($url); $ucrc32 = sprintf('%u', $crc32); $num = $ucrc32 % 10; } else { $num = 0; } $subdomain = 'www' . $num . '.'; $requestHost = $subdomain . $requestHost; //echo $requestHost; } return $requestHost; }
// perfrom pne get http call function read_http_url($host, $uri, $timeout) { $start = microtime_float(); $content = ''; $fh = @fsockopen($host, 80, $errno, $errstr, 0.5); if ($fh && !$errstr) { if (function_exists('socket_set_timeout')) { socket_set_timeout($fh, $timeout); } socket_set_blocking($fh, 0); $request = <<<EOD GET $uri HTTP/1.0 Host: $host Connection: close
EOD; $write_err = @fwrite($fh, $request); while (!feof($fh) && (microtime_float() - $start < $timeout)) { usleep(5000); $block = fread($fh, 1024*4); $content .= $block; } fclose($fh); $content = preg_replace('/^(.+?)(\r\n|\n){2}/s', '', $content); } return $content; }
// precise time in microseconds as float function microtime_float() { list($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec); } ?> . Powered by <a rel="nofollow" href="/go.php?url=http://www.wordpress.org/">WordPress</a>.
</div>
</div>
</body> </html>
|
-------
Все сказаное является только моим личным мнением.
Отправлено: 10:59, 10-09-2011
| #5
|