Links
// # THE FOLLOWING BLOCK IS USED TO RETRIEVE AND DISPLAY LINK INFORMATION.
// # PLACE THIS ENTIRE BLOCK IN THE AREA YOU WANT THE DATA TO BE DISPLAYED.
$UserKey = "365";
// # YOU MAY MODIFY THE VARIABLES BELOW:
// # The following variable defines whether links are opened in a new window
// # (1 = Yes, 0 = No)
$OpenInNewWindow = "1";
// # The following variable determines whether the search function is enabled
// # for your links page (1 = Yes, 0 = No)
$AllowSearch = "1";
// # DO NOT MODIFY ANYTHING ELSE BELOW THIS LINE!
// ----------------------------------------------
$ThisPage = $_SERVER["PHP_SELF"];
$QueryString = "script=php";
$QueryString .= "&UserKey=" .urlencode($UserKey);
$QueryString .= "&ScriptName=" .urlencode($ThisPage);
$QueryString .= "&OpenInNewWindow=" .urlencode($OpenInNewWindow);
$QueryString .= "&AllowSearch=" .urlencode($AllowSearch);
foreach ($_GET as $key => $value) {
$value = urlencode(stripslashes($value));
$QueryString .= “&$key=$value”;
}
// congfigure our headers
if(intval(get_cfg_var(’allow_url_fopen’)) && function_exists(’readfile’)) {
if(!@readfile(”http://www.linkscitadel.com/gl//get_pages.php?”.$QueryString)) {
echo “Error processing request”;
}
}
elseif(intval(get_cfg_var(’allow_url_fopen’)) && function_exists(’file’)) {
if(!($content = @file(”http://www.linkscitadel.com/gl//get_pages.php?”.$QueryString))) {
echo “Error processing request”;
}
else {
echo @join('’, $content);
}
}
elseif(function_exists(’curl_init’)) {
$agent = “Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,”http://www.linkscitadel.com/gl//get_pages.php?”.$QueryString);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
$rez= curl_exec ($ch);
if(curl_errno($ch)){
curl_close ($ch);
echo “Error processing request”;
return;
}
curl_close ($ch);
echo $rez;
}
else {
echo “It seems that web host has disabled all functions for handling remote pages and as a result the links software will not function on your web site. Please contact your web host and ask them to enable PHP curl or fopen.”;
}
?>
