function create($sitemap_name = '') { if(!$sitemap_name) $sitemap_name = SS_ADMIN_TO_USERFILE . "/sitemap.xml"; if(empty($sitemap_name)) $sitemap_name = "sitemap_" . $rep_name . ".xml"; $changefreq = array('daily', 'weekly', 'monthly'); $priority = array('0.1', '0.5', '1.0'); $tab_archive = array(); rsort($tab_archive); $xml = simplexml_load_file(SS_ADMIN_TO_USERFILE . '/google/sitemap_base.xml'); //scan bdd $sql = "SELECT * FROM page WHERE etat = 1"; $res = CBdd::select($sql); while($page = mysql_fetch_array($res)) { $url = $xml->addChild('url'); $url->addChild('loc', CUrl::get_urlsite() . "/" . CFunction::formate_chaine(utf8_decode($page['nom']), '-') . "_p" . $page['id']. ".html"); $url->addChild('lastmod', CDate::formate_date($page['date'])); $url->addChild('changefreq', $changefreq[rand(0, 2)]); $url->addChild('priority', $priority[rand(0, 2)]); } $html = $xml->asXML(); file_put_contents($sitemap_name, $html); }
<script type="text/javascript" src="../plug/popup/popup.js"></script> <link href="../plug/jscalendar/calendar-win2k-1.css" rel="stylesheet" type="text/css"/> <link href="../plug/jquery/css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../plug/popup/popup.js"></script> <script type="text/javascript" src="../plug/jquery/js/jquery-1.3.2.js"></script> <script type="text/javascript" src="../plug/jquery/js/jquery-ui-1.7.2.custom.min.js"></script> <script type="text/javascript" src="../plug/jquery/js/ui/i18n/ui.datepicker-fr.js"></script> <script type="text/javascript" src="../plug/jquery/js/jquery.form.js"></script> <script type="text/javascript" src="../plug/panther/campagne.js"></script> <script type="text/javascript" src="../plug/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ mode : "exact", elements : "expediteur_publipostage, objet_publipostage, message_publipostage", theme : "advanced", document_base_url : "<?php echo CUrl::get_urlsite() ?>", relative_urls : false, remove_script_host : false, plugins :"safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager,fullpage", theme_advanced_buttons1 : "bold,italic,underline,pastetext,separator,strikethroughjustifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,styleselect,formatselect,code", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_toolbar_align : "left", theme_advanced_toolbar_location : "external" }); </script> <style type="text/css"> .margin-left { margin-left:40px; } input[type='text'] {
<div id="signe"></div> <div id="titre"><!-- InstanceBeginEditable name="titre" -->Sitemap<!-- InstanceEndEditable --></div> </div> </div> <div id="contentarea"> <div id="left"><?php include("../nav/menu_g.php"); ?></div> <div id="center"> <div id="page"><!-- InstanceBeginEditable name="page" --><?php echo CHtml::get_toolbar(array('add'=>1, 'add_label'=>'Gégérer')) ?><!-- InstanceEndEditable --></div> <div id="over"><!-- InstanceBeginEditable name="over" --><?php echo CHtml::get_msginfo($msginfo) ?><!-- InstanceEndEditable --></div> <div id="main"><!-- InstanceBeginEditable name="main" --> <?php $url = SS_ADMIN_TO_USERFILE . "/sitemap.xml"; if(is_file($url)) { ?> <h2>Contenu du fichier <a href="<?php echo $url ?>" target="_blank"><?php echo CUrl::get_urlsite() . "/sitemap.xml" ?></a></h2> <table style="width: 875px; margin-left: 1px;" border="1" cellpadding="0" cellspacing="0"> <tr align="center"> <th align="left">Url du fichier</th> <th>Fréquence changement</th> <th>Priorité d'exploration</th> <th>Derniere modification</th> </tr> <?php $xml = simplexml_load_file($url); foreach($xml->url as $url) { $loc = strtolower(utf8_decode($url->loc)); $lastmod = strtolower(utf8_decode($url->lastmod)); $changefreq = utf8_decode($url->changefreq); $priority = utf8_decode($url->priority);?> <tr>
</head> <body> <?php /*------------------------------------------------------ IMPORTATIONS --------------------------------------------------------*/ ?> <!-- InstanceBeginEditable name="php" --> <?php /*-------------------------------------------------------------------- INITIALISATIONS ----------------------------------------------------------------------*/ $msginfo = ""; $PATH_RACINE = CUrl::get_pathsite(); $URL_RACINE = CUrl::get_urlsite(); ?> <!-- InstanceEndEditable --> <div id="mainwrap"> <div id="header"><?php include("../nav/header.php"); ?></div> <div id="top"> </div> <div id="filet"> <div id="zonetitre"> <div id="signe"></div> <div id="titre"><!-- InstanceBeginEditable name="titre" -->Installation<!-- InstanceEndEditable --></div> </div> </div> <div id="contentarea"> <div id="left"><?php include("menu_g.php"); ?></div> <div id="center"> <div id="page"><!-- InstanceBeginEditable name="page" --><!-- InstanceEndEditable --></div>