'."\n";
echo ''."\n";
echo ' '.htmlspecialchars($SITE_URL.'/').'daily1.0'."\n";
foreach ($DISTRICTS as $d) {
echo ' '.htmlspecialchars($SITE_URL.'/'.$d['slug']).'weekly0.8'."\n";
}
echo '';
exit;
}
if ($uri === '/robots.txt') {
header('Content-Type: text/plain; charset=utf-8');
echo "User-agent: *\nAllow: /\n\nSitemap: ".$SITE_URL."/sitemap.xml\n";
exit;
}
$slug = '';
if (isset($_GET['ilce']) && $_GET['ilce'] !== '') $slug = trim($_GET['ilce']);
else { $s = trim($uri, '/'); if ($s !== '' && strpos($s, '/') === false) $slug = $s; }
$district = null;
if ($slug !== '') foreach ($DISTRICTS as $d) if ($d['slug'] === $slug) { $district = $d; break; }
function e($s) { return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }
function initial($n) {
if (function_exists('mb_substr')) return mb_substr($n, 0, 1, 'UTF-8');
return substr($n, 0, 1);
}
$isHome = ($slug === '');
if ($isHome) {
$pageTitle = $SITE['title']; $pageDesc = $SITE['description'];
$canonical = $SITE_URL.'/'; $robots = 'index, follow, max-image-preview:large, max-snippet:-1';
} elseif ($district) {
$pageTitle = $district['meta_title']; $pageDesc = $district['meta_description'];
$canonical = $SITE_URL.'/'.$district['slug']; $robots = 'index, follow, max-image-preview:large, max-snippet:-1';
} else {
http_response_code(404);
$pageTitle = 'Sayfa Bulunamadı | '.$SITE['site_name']; $pageDesc = 'Aradığınız sayfa mevcut değil.';
$canonical = $SITE_URL.'/'; $robots = 'noindex, follow';
}
$schemas = array();
$schemas[] = array('@context'=>'https://schema.org','@type'=>'Organization',
'name'=>$SITE['site_name'],'url'=>$SITE_URL.'/','logo'=>$SITE_URL.'/logo.png',
'contactPoint'=>array('@type'=>'ContactPoint','telephone'=>'+90-000-000-0000',
'contactType'=>'customer service','areaServed'=>'TR'),
'sameAs'=>array($SITE_URL.'/'));
$schemas[] = array('@context'=>'https://schema.org','@type'=>'WebSite',
'name'=>$SITE['site_name'],'url'=>$SITE_URL.'/','inLanguage'=>'tr-TR',
'potentialAction'=>array('@type'=>'SearchAction',
'target'=>array('@type'=>'EntryPoint','urlTemplate'=>$SITE_URL.'/?q={search_term_string}'),
'query-input'=>'required name=search_term_string'));
$bread = array(array('@type'=>'ListItem','position'=>1,'name'=>'Ana Sayfa','item'=>$SITE_URL.'/'));
if ($district) $bread[] = array('@type'=>'ListItem','position'=>2,'name'=>$district['name'].' Escort','item'=>$canonical);
$schemas[] = array('@context'=>'https://schema.org','@type'=>'BreadcrumbList','itemListElement'=>$bread);
if ($district) {
$schemas[] = array('@context'=>'https://schema.org','@type'=>'LocalBusiness',
'name'=>$district['name'].' Escort — '.$SITE['site_name'],
'description'=>$district['meta_description'],'url'=>$canonical,
'telephone'=>'+90-000-000-0000','priceRange'=>'₺₺',
'address'=>array('@type'=>'PostalAddress','addressLocality'=>$district['name'],
'addressRegion'=>$SITE['site_name'],'addressCountry'=>'TR'),
'openingHoursSpecification'=>array(array('@type'=>'OpeningHoursSpecification',
'dayOfWeek'=>array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'),
'opens'=>'00:00','closes'=>'23:59')),
'areaServed'=>array('@type'=>'City','name'=>$SITE['site_name']),
'aggregateRating'=>array('@type'=>'AggregateRating','ratingValue'=>'4.9',
'reviewCount'=>max(20,count(isset($SITE['reviews'])?$SITE['reviews']:array())*3),
'bestRating'=>'5','worstRating'=>'1'));
}
if ($isHome && !empty($SITE['reviews'])) {
$schemas[] = array('@context'=>'https://schema.org','@type'=>'AggregateRating',
'itemReviewed'=>array('@type'=>'Organization','name'=>$SITE['site_name']),
'ratingValue'=>'4.9','reviewCount'=>max(30,count($SITE['reviews'])),
'bestRating'=>'5','worstRating'=>'1');
}
$faqsForSchema = array();
if ($district && !empty($district['faqs'])) $faqsForSchema = $district['faqs'];
elseif ($isHome && !empty($SITE['faqs'])) $faqsForSchema = $SITE['faqs'];
if (!empty($faqsForSchema)) {
$items = array();
foreach ($faqsForSchema as $f) {
$items[] = array('@type'=>'Question','name'=>$f['q'],
'acceptedAnswer'=>array('@type'=>'Answer','text'=>$f['a']));
}
$schemas[] = array('@context'=>'https://schema.org','@type'=>'FAQPage','mainEntity'=>$items);
}
if ($isHome) {
$items = array(); $pos = 1;
foreach ($DISTRICTS as $d) {
$items[] = array('@type'=>'ListItem','position'=>$pos++,
'name'=>$d['name'].' Escort','url'=>$SITE_URL.'/'.$d['slug']);
}
$schemas[] = array('@context'=>'https://schema.org','@type'=>'ItemList',
'name'=>$SITE['site_name'].' — Hizmet Bölgeleri','itemListElement'=>$items);
}
if ($isHome && !empty($SITE['reviews'])) {
foreach (array_slice($SITE['reviews'], 0, 6) as $r) {
$schemas[] = array('@context'=>'https://schema.org','@type'=>'Review',
'itemReviewed'=>array('@type'=>'Organization','name'=>$SITE['site_name']),
'reviewRating'=>array('@type'=>'Rating','ratingValue'=>(string)(isset($r['rating'])?$r['rating']:5),'bestRating'=>'5'),
'author'=>array('@type'=>'Person','name'=>$r['author']),
'reviewBody'=>$r['text'],
'datePublished'=>isset($r['date'])?$r['date']:date('Y-m-d'));
}
}
?>