<?php
require'fun.php';
if($go!='xml'&&$go!='txt'&&$go!='rss')
$go='html';
$titlu.=' '.mb_strtoupper($go).$titlul;
if($go=='xml')
{
header('Content-Type: application/xml; charset=utf-8');
$x1='<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';
$x2='</urlset>';
$x3='<url><loc>';
$x4='</loc>';
}
elseif($go=='txt')
{
header('Content-type: text/plain; charset=utf-8');
$x1='';
$x2='';
$x3='';
$x4='
';
}
elseif($go=='rss')
{
header('Content-Type: application/rss+xml; charset=utf-8');
$link=$adresasite[0].$_SERVER['REQUEST_URI'];
$x1='<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>'.$titlu.'</title><atom:link href="'.$link.'" rel="self" type="application/rss+xml" /><link>'.$link.'</link><description>'.$titlu.'</description><lastBuildDate>'.date('r').'</lastBuildDate><language>ro-RO</language><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><generator>'.$adresasite[0].'</generator><image><title>'.$titlu.'</title><url>'.$domenii_statice[2].'rss.gif</url><link>'.$link.'</link><width>16</width><height>16</height></image>';
$x2='</channel></rss>';
$x3='<item><link>';
$x4='</item>';
}
else
{
header('Content-Type: text/html; charset=utf-8');
header('Content-Language: ro-RO');
$x1='<!DOCTYPE html><html lang="ro-RO"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><meta name="robots" content="noindex,follow,noarchive,noodp,noydir" /><meta name="googlebot" content="nosnippet" /><title>'.$titlu.'</title><link rel="stylesheet" type="text/css" href="'.$domenii_statice[1].'css_js/stil.css" /></head><body><div class="margine">'.$div[4].$titlu.$div[5];
$x2='</div></body></html>';
$x3=$div[1].'<a href="';
$x4='</a>'.$div[0];
}
if($_SERVER['REQUEST_URI']=='/sitemap.xml')
{
$x1='<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd">';
$x2='</sitemapindex>';
$x3='<sitemap><loc>';
$x4='</loc></sitemap>';
}
header('Last-Modified: '.gmdate('D, d M Y H:i:s T'));
header('Cache-Control: no-store,no-cache,must-revalidate,max-age=0,post-check=0,pre-check=0');
header('Expires: -1');
if($go!='txt'&&$go!='html')
echo'<?xml version="1.0" encoding="utf-8"?>';
echo$x1;
$pepagyna=10;
$y1=1;
$z1=1;
function sitemap($link,$titlu,$descriere='',$data='')
{
global$go,$x3,$x4,$titlul;
return$x3.$link.($go=='rss'||$go=='html'?($go=='rss'?'</link><title><![CDATA[':'" title="').$titlu.$titlul.($go=='rss'?']]></title>'.($data>0?'<pubDate>'.date('r',$data).'</pubDate>':''):'">'.$titlu):'').$x4.($go=='xml'&&$_SERVER['REQUEST_URI']!='/sitemap.xml'?($data>0?'<lastmod>'.date('Y-m-d',$data).'</lastmod>':'').'<changefreq>always</changefreq></url>':'');
}