فهرست منبع

Applied to sitemap.php

seavenois 9 سال پیش
والد
کامیت
44ab618930
1فایلهای تغییر یافته به همراه18 افزوده شده و 17 حذف شده
  1. 18 17
      www/sitemap.php

+ 18 - 17
www/sitemap.php

@@ -3,13 +3,14 @@
 	$http_host = $_SERVER['HTTP_HOST'];
 	$http_host = $_SERVER['HTTP_HOST'];
 	include("functions.php");
 	include("functions.php");
 	$con = startdb();
 	$con = startdb();
+	$proto = getProtocol();
 	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
 	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
 ?>
 ?>
 <urlset
 <urlset
 	xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
 	xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
 	xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
 	xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
 	<url>
 	<url>
-		<loc>http://<?php echo $http_host; ?>/</loc>
+		<loc><?php echo $proto$http_host; ?>/</loc>
 		<?php
 		<?php
 			$res_date = mysqli_query($con, "(SELECT DATE_FORMAT(dtime, '%Y-%m-%d') AS cdate FROM post) UNION (SELECT DATE_FORMAT(dtime, '%Y-%m-%d') AS cdate FROM activity) UNION (SELECT DATE_FORMAT(uploaded, '%Y-%m-%d') AS cdate FROM photo) ORDER BY cdate DESC LIMIT 1;");
 			$res_date = mysqli_query($con, "(SELECT DATE_FORMAT(dtime, '%Y-%m-%d') AS cdate FROM post) UNION (SELECT DATE_FORMAT(dtime, '%Y-%m-%d') AS cdate FROM activity) UNION (SELECT DATE_FORMAT(uploaded, '%Y-%m-%d') AS cdate FROM photo) ORDER BY cdate DESC LIMIT 1;");
 			$row_date = mysqli_fetch_array($res_date);
 			$row_date = mysqli_fetch_array($res_date);
@@ -17,28 +18,28 @@
 		<changefreq>weekly</changefreq>
 		<changefreq>weekly</changefreq>
 		<priority>0.8</priority>
 		<priority>0.8</priority>
 		<image:image>
 		<image:image>
-			<image:loc>http://<?php echo $http_host; ?>/img/logo/GasteizkoMargolariak.png</image:loc>
+			<image:loc><?php echo $proto$http_host; ?>/img/logo/GasteizkoMargolariak.png</image:loc>
 			<image:caption>Gasteizko Margolariak</image:caption>
 			<image:caption>Gasteizko Margolariak</image:caption>
 			<image:title>Gasteizko Margolariak</image:title>
 			<image:title>Gasteizko Margolariak</image:title>
 		</image:image>
 		</image:image>
 		<image:image>
 		<image:image>
-			<image:loc>http://<?php echo $http_host; ?>/img/logo/GasteizkoMargolariak-0.png</image:loc>
+			<image:loc><?php echo $proto$http_host; ?>/img/logo/GasteizkoMargolariak-0.png</image:loc>
 			<image:caption>Gasteizko Margolariak Original</image:caption>
 			<image:caption>Gasteizko Margolariak Original</image:caption>
 			<image:title>Gasteizko Margolariak Original</image:title>
 			<image:title>Gasteizko Margolariak Original</image:title>
 		</image:image>
 		</image:image>
 	</url>
 	</url>
 	<url>
 	<url>
-		<loc>http://<?php echo $http_host; ?>/ayuda/</loc>
+		<loc><?php echo $proto$http_host; ?>/ayuda/</loc>
 		<changefreq>monthly</changefreq>
 		<changefreq>monthly</changefreq>
 		<priority>0.5</priority>
 		<priority>0.5</priority>
 	</url>
 	</url>
 	<url>
 	<url>
-		<loc>http://<?php echo $http_host; ?>/nosotros/</loc>
+		<loc><?php echo $proto$http_host; ?>/nosotros/</loc>
 		<changefreq>monthly</changefreq>
 		<changefreq>monthly</changefreq>
 		<priority>0.6</priority>
 		<priority>0.6</priority>
 	</url>
 	</url>
 	<url>
 	<url>
-		<loc>http://<?php echo $http_host; ?>/blog/</loc>
+		<loc><?php echo $proto$http_host; ?>/blog/</loc>
 		<?php
 		<?php
 			$res_date = mysqli_query($con, "SELECT DATE_FORMAT(dtime, '%Y-%m-%d') AS cdate FROM post ORDER BY cdate DESC LIMIT 1;");
 			$res_date = mysqli_query($con, "SELECT DATE_FORMAT(dtime, '%Y-%m-%d') AS cdate FROM post ORDER BY cdate DESC LIMIT 1;");
 			$row_date = mysqli_fetch_array($res_date);
 			$row_date = mysqli_fetch_array($res_date);
@@ -51,14 +52,14 @@
 		$priority = 0.75;
 		$priority = 0.75;
 		while ($row_post = mysqli_fetch_array($res_post)){
 		while ($row_post = mysqli_fetch_array($res_post)){
 			echo "\t<url>\n";
 			echo "\t<url>\n";
-			echo "\t\t<loc>http://$http_host/blog/$row_post[permalink]</loc>\n";
+			echo "\t\t<loc>$proto$http_host/blog/$row_post[permalink]</loc>\n";
 			echo "\t\t<lastmod>$row_post[cdate]</lastmod>\n";
 			echo "\t\t<lastmod>$row_post[cdate]</lastmod>\n";
 			echo "\t\t<changefreq>weekly</changefreq>\n";
 			echo "\t\t<changefreq>weekly</changefreq>\n";
 			echo "\t\t<priority>$priority</priority>\n";
 			echo "\t\t<priority>$priority</priority>\n";
 			$q_i = mysqli_query($con, "SELECT image FROM post_image WHERE post = $row_post[id] ORDER BY idx;");
 			$q_i = mysqli_query($con, "SELECT image FROM post_image WHERE post = $row_post[id] ORDER BY idx;");
 			while ($r_i = mysqli_fetch_array($q_i)){
 			while ($r_i = mysqli_fetch_array($q_i)){
 				echo("\t\t<image:image>\n");
 				echo("\t\t<image:image>\n");
-				echo("\t\t\t<image:loc>http://$http_host/img/blog/view/$r_i[image]</image:loc>\n");
+				echo("\t\t\t<image:loc>$proto$http_host/img/blog/view/$r_i[image]</image:loc>\n");
 				echo("\t\t\t<image:title>$row_post[title_es]</image:title>\n");
 				echo("\t\t\t<image:title>$row_post[title_es]</image:title>\n");
 				echo("\t\t</image:image>\n");
 				echo("\t\t</image:image>\n");
 			} 
 			} 
@@ -69,7 +70,7 @@
 		}
 		}
 	?>
 	?>
 	<url>
 	<url>
-		<loc>http://<?php echo $http_host; ?>/actividades/</loc>
+		<loc><?php echo $proto$http_host; ?>/actividades/</loc>
 		<?php
 		<?php
 			$res_date = mysqli_query($con, "SELECT DATE_FORMAT(dtime, '%Y-%m-%d') AS cdate FROM activity ORDER BY cdate DESC LIMIT 1;");
 			$res_date = mysqli_query($con, "SELECT DATE_FORMAT(dtime, '%Y-%m-%d') AS cdate FROM activity ORDER BY cdate DESC LIMIT 1;");
 			$row_date = mysqli_fetch_array($res_date);
 			$row_date = mysqli_fetch_array($res_date);
@@ -82,14 +83,14 @@
 		$priority = 0.95;
 		$priority = 0.95;
 		while ($row = mysqli_fetch_array($res)){
 		while ($row = mysqli_fetch_array($res)){
 			echo "\t<url>\n";
 			echo "\t<url>\n";
-			echo "\t\t<loc>http://$http_host/actividades/$row[permalink]</loc>\n";
+			echo "\t\t<loc>$proto$http_host/actividades/$row[permalink]</loc>\n";
 			echo "\t\t<lastmod>$row[cdate]</lastmod>\n";
 			echo "\t\t<lastmod>$row[cdate]</lastmod>\n";
 			echo "\t\t<changefreq>weekly</changefreq>\n";
 			echo "\t\t<changefreq>weekly</changefreq>\n";
 			echo "\t\t<priority>$priority</priority>\n";
 			echo "\t\t<priority>$priority</priority>\n";
 			$q_i = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $row[id] ORDER BY idx;");
 			$q_i = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $row[id] ORDER BY idx;");
 			while ($r_i = mysqli_fetch_array($q_i)){
 			while ($r_i = mysqli_fetch_array($q_i)){
 				echo("\t\t<image:image>\n");
 				echo("\t\t<image:image>\n");
-				echo("\t\t\t<image:loc>http://$http_host/img/actividades/view/$r_i[image]</image:loc>\n");
+				echo("\t\t\t<image:loc>$proto$http_host/img/actividades/view/$r_i[image]</image:loc>\n");
 				echo("\t\t\t<image:title>$row[title_es]</image:title>\n");
 				echo("\t\t\t<image:title>$row[title_es]</image:title>\n");
 				echo("\t\t</image:image>\n");
 				echo("\t\t</image:image>\n");
 			} 
 			} 
@@ -100,7 +101,7 @@
 		}
 		}
 	?>
 	?>
 	<url>
 	<url>
-		<loc>http://<?php echo $http_host; ?>/galeria/</loc>
+		<loc><?php echo $proto$http_host; ?>/galeria/</loc>
 		<?php
 		<?php
 			$res_date = mysqli_query($con, "SELECT DATE_FORMAT(uploaded, '%Y-%m-%d') AS cdate FROM photo ORDER BY cdate DESC LIMIT 1;");
 			$res_date = mysqli_query($con, "SELECT DATE_FORMAT(uploaded, '%Y-%m-%d') AS cdate FROM photo ORDER BY cdate DESC LIMIT 1;");
 			$row_date = mysqli_fetch_array($res_date);
 			$row_date = mysqli_fetch_array($res_date);
@@ -113,14 +114,14 @@
 		$priority = 0.75;
 		$priority = 0.75;
 		while ($row = mysqli_fetch_array($res)){
 		while ($row = mysqli_fetch_array($res)){
 			echo "\t<url>\n";
 			echo "\t<url>\n";
-			echo "\t\t<loc>http://$http_host/galeria/$row[permalink]</loc>\n";
+			echo "\t\t<loc>$proto$http_host/galeria/$row[permalink]</loc>\n";
 			echo "\t\t<lastmod>$row[cdate]</lastmod>\n";
 			echo "\t\t<lastmod>$row[cdate]</lastmod>\n";
 			echo "\t\t<changefreq>weekly</changefreq>\n";
 			echo "\t\t<changefreq>weekly</changefreq>\n";
 			echo "\t\t<priority>$priority</priority>\n";
 			echo "\t\t<priority>$priority</priority>\n";
 			$q_i = mysqli_query($con, "SELECT file, title_es FROM photo, photo_album WHERE id = photo AND album = $row[albumid];");
 			$q_i = mysqli_query($con, "SELECT file, title_es FROM photo, photo_album WHERE id = photo AND album = $row[albumid];");
 			while ($r_i = mysqli_fetch_array($q_i)){
 			while ($r_i = mysqli_fetch_array($q_i)){
 				echo("\t\t<image:image>\n");
 				echo("\t\t<image:image>\n");
-				echo("\t\t\t<image:loc>http://$http_host/img/galeria/view/$r_i[file]</image:loc>\n");
+				echo("\t\t\t<image:loc>$proto$http_host/img/galeria/view/$r_i[file]</image:loc>\n");
 				if (strlen($r_i['title_es']) > 0){
 				if (strlen($r_i['title_es']) > 0){
 					echo("\t\t\t<image:title>$r_i[title_es]</image:title>\n");
 					echo("\t\t\t<image:title>$r_i[title_es]</image:title>\n");
 				}
 				}
@@ -136,7 +137,7 @@
 		}
 		}
 	?>
 	?>
 	<url>
 	<url>
-		<loc>http://<?php echo $http_host; ?>/lablanca/</loc>
+		<loc><?php echo $proto$http_host; ?>/lablanca/</loc>
 		<?php
 		<?php
 			$res_lb = mysqli_query($con, 'SELECT value FROM settings WHERE name= "festivals";');
 			$res_lb = mysqli_query($con, 'SELECT value FROM settings WHERE name= "festivals";');
 			if (mysqli_num_rows($res_lb) > 0){
 			if (mysqli_num_rows($res_lb) > 0){
@@ -162,12 +163,12 @@
 		$priority = 0.55;
 		$priority = 0.55;
 		while ($row_years = mysqli_fetch_array($res_years)){
 		while ($row_years = mysqli_fetch_array($res_years)){
 			echo "\t<url>\n";
 			echo "\t<url>\n";
-			echo "\t\t<loc>http://$http_host/lablanca/$row_years[year]</loc>\n";
+			echo "\t\t<loc>$proto$http_host/lablanca/$row_years[year]</loc>\n";
 			echo "\t\t<changefreq>yearly</changefreq>\n";
 			echo "\t\t<changefreq>yearly</changefreq>\n";
 			echo "\t\t<priority>$priority</priority>\n";
 			echo "\t\t<priority>$priority</priority>\n";
 			if (strlen($row_years['img']) > 0){
 			if (strlen($row_years['img']) > 0){
 				echo("\t\t<image:image>\n");
 				echo("\t\t<image:image>\n");
-				echo("\t\t\t<image:loc>http://$http_host/img/fiestas/view/$row_years[img]</image:loc>\n");
+				echo("\t\t\t<image:loc>$proto$http_host/img/fiestas/view/$row_years[img]</image:loc>\n");
 				echo("\t\t\t<image:title>La Blanca $row_years[year]</image:title>\n");
 				echo("\t\t\t<image:title>La Blanca $row_years[year]</image:title>\n");
 				echo("\t\t</image:image>\n");
 				echo("\t\t</image:image>\n");
 			}
 			}