Index: extensions/rv_sitemap/changelog.txt
===================================================================
--- extensions/rv_sitemap/changelog.txt	(revision 16026)
+++ extensions/rv_sitemap/changelog.txt	(revision 16301)
@@ -1,2 +1,6 @@
+2.4.b
+	- urls for picture pages
+	- extended as images sitemap
+
 2.4.a
 	- compatible piwigo 2.4
Index: extensions/rv_sitemap/sitemap.php
===================================================================
--- extensions/rv_sitemap/sitemap.php	(revision 16026)
+++ extensions/rv_sitemap/sitemap.php	(revision 16301)
@@ -20,5 +20,5 @@
   out_xml('<?xml version="1.0" encoding="UTF-8"?'.'>
 <?xml-stylesheet type="text/xsl" href="'.get_root_url().'plugins/'.basename(dirname(__FILE__)).'/sitemap.xsl"?'.'>
-<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">', $gzip );
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">', $gzip );
 }
 
@@ -39,5 +39,5 @@
 }
 
-function add_url($url, $lastmod=null, $changefreq=null, $priority=null)
+function add_url($url, $lastmod=null, $changefreq=null, $priority=null, $images_xml=null)
 {
   $xml=
@@ -63,4 +63,7 @@
  <priority>'.$priority.'</priority>';
 
+  if ( isset($images_xml) )
+    $xml .= "\n".$images_xml;
+  
   $xml .= '
 </url>';
@@ -123,5 +126,5 @@
 while ($row = mysql_fetch_assoc($result))
 {
-  array_push($categories, $row);
+  $categories[] = $row;
 }
 usort($categories, 'global_rank_compare');
@@ -129,7 +132,4 @@
 $tags = get_available_tags();
 usort($tags, 'name_compare');
-
-// END AS GUEST
-$user = $save_user;
 
 if ( isset($_POST['submit']) )
@@ -163,4 +163,6 @@
   $freq_tags = $_POST['freq_tags'];
 
+  $photo_count = intval($_POST['photo_count']);
+  
   set_make_full_url();
 
@@ -223,4 +225,29 @@
     }
   }
+  
+  if ($photo_count > 0)
+  {
+    $query = 'SELECT DISTINCT i.* FROM '.IMAGES_TABLE.' i
+  INNER JOIN '.IMAGE_CATEGORY_TABLE.' on i.id=image_id 
+'.get_sql_condition_FandF( array('forbidden_categories' => 'category_id', 'forbidden_images'=>'i.id'), 'WHERE ' ).'
+  ORDER BY date_available DESC
+  LIMIT '.$photo_count;
+    $result = pwg_query($query);
+    while ($row = mysql_fetch_assoc($result))
+    {
+      $url = make_picture_url( array(
+        'image_id' => $row['id'],
+        'image_file' => $row['file'],
+        ) );
+      $src_image = new SrcImage($row);
+      $images_xml = '';
+      foreach( array(IMG_THUMB, $conf['derivative_default_size']) as $derivative_type)
+      {
+        $deriv_url = DerivativeImage::url($derivative_type, $src_image);
+        $images_xml .= '<image:image><image:loc>'.$deriv_url.'</image:loc></image:image>';
+      }
+      add_url($url, $row['date_available'], null, null, $images_xml);
+    }
+  }
   unset_make_full_url();
   end_xml($gzip);
@@ -237,5 +264,5 @@
   $x = compact( 'filename', 'selected_tag_urls', 'prio_tags', 'freq_tags',
   'selected_categories', 'prio_categories', 'freq_categories',
-  'selected_specials' );
+  'selected_specials', 'photo_count' );
   $file = fopen( sitemaps_get_config_file_name(), 'w' );
   fwrite($file, serialize($x) );
@@ -251,4 +278,5 @@
   $freq_categories = 'monthly';
   $freq_tags = 'monthly';
+  $photo_count = 0;
   
   $conf_file_name = sitemaps_get_config_file_name();
@@ -281,4 +309,7 @@
 }
 
+// END AS GUEST
+$user = $save_user;
+
 
 $template->assign( array(
@@ -288,4 +319,5 @@
   'PRIO_CATEGORIES' => $prio_categories,
   'PRIO_TAGS' => $prio_tags,
+  'PHOTO_COUNT' => $photo_count,
     )
   );
Index: extensions/rv_sitemap/sitemap.tpl
===================================================================
--- extensions/rv_sitemap/sitemap.tpl	(revision 16026)
+++ extensions/rv_sitemap/sitemap.tpl	(revision 16301)
@@ -48,4 +48,9 @@
 </fieldset>
 
+<fieldset>
+<legend>{'Recent photos'|@translate}</legend>
+<input type="input" size="4" name="photo_count" value="{$PHOTO_COUNT}"/>
+</fieldset>
+
 
 <p>
Index: extensions/rv_sitemap/sitemap.xsl
===================================================================
--- extensions/rv_sitemap/sitemap.xsl	(revision 16026)
+++ extensions/rv_sitemap/sitemap.xsl	(revision 16301)
@@ -2,4 +2,5 @@
 <xsl:stylesheet version="2.0" 
                 xmlns:html="http://www.w3.org/TR/REC-html40"
+				xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
                 xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
@@ -10,24 +11,55 @@
 				<title>XML Sitemap</title>
 				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+				<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
+				<!-- <script type="text/javascript" src="jquery.tablesorter.min.js"></script>
+				<script	type="text/javascript"><![CDATA[
+					$(document).ready(function() { 
+				        $("#sitemap").tablesorter( { widgets: ['zebra'] } ); 
+					});
+				]]></script> -->
 				<style type="text/css">
 					body {
-						font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana;
-						font-size:13px;
+						font-family: Helvetica, Arial, sans-serif;
+						font-size: 13px;
+						color: #545353;
 					}
-					
-					#intro {
-						border:1px black solid;
-						padding:5px 13px 5px 13px;
-						margin:10px;
+					table {
+						border: none;
+						border-collapse: collapse;
 					}
-					
-					#intro p {
-						line-height:	16.8667px;
+					#sitemap tr.odd {
+						background-color: #eee;
 					}
-					
+					#sitemap tbody tr:hover {
+						background-color: #ccc;
+					}
+					#sitemap tbody tr:hover td, #sitemap tbody tr:hover td a {
+						color: #000;
+					}
+					#content {
+						margin: 0 auto;
+						width: 1000px;
+					}
+					.expl {
+						margin: 10px 3px;
+						line-height: 1.3em;
+					}
+					.expl a {
+						color: #da3114;
+						font-weight: bold;
+					}
+					a {
+						color: #000;
+						text-decoration: none;
+					}
+					a:visited {
+						color: #777;
+					}
+					a:hover {
+						text-decoration: underline;
+					}
 					td {
 						font-size:11px;
 					}
-					
 					th {
 						text-align:left;
@@ -35,67 +67,60 @@
 						font-size:11px;
 					}
-					
-					tr.high {
-						background-color:whitesmoke;
-					}
-					
-					#footer {
-						padding:2px;
-						margin:10px;
-						font-size:8pt;
-						color:gray;
-					}
-					
-					#footer a {
-						color:gray;
-					}
-					
-					a {
-						color:black;
+					thead th {
+						border-bottom: 1px solid #000;
+						cursor: pointer;
 					}
 				</style>
 			</head>
 			<body>
-				<h1>XML Sitemap</h1>
-				<div id="intro">
-					<p>
-						This is a XML Sitemap which is supposed to be processed by search engines like <a href="http://www.google.com">Google</a>, <a href="http://search.msn.com">MSN Search</a> and <a href="http://www.yahoo.com">YAHOO</a>.<br />
-						You can find more information about XML sitemaps on <a href="http://sitemaps.org">sitemaps.org</a> and Google's <a href="http://code.google.com/sm_thirdparty.html">list of sitemap programs</a>.
+				<div id="content">
+					<h1>XML Sitemap</h1>
+					<p class="expl">
+						Generated by <a href="http://yoast.com/">Yoast</a>'s WordPress SEO plugin, this is an XML Sitemap, meant for consumption by search engines.
 					</p>
-				</div>
-				<div id="content">
-					<table cellpadding="5">
-						<tr style="border-bottom:1px black solid;">
-							<th>URL</th>
-							<th>Priority</th>
-							<th>Change Frequency</th>
-							<th>LastChange</th>
-						</tr>
-						<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
-						<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
-						<xsl:for-each select="sitemap:urlset/sitemap:url">
+					<p class="expl">
+						You can find more information about XML sitemaps on <a href="http://sitemaps.org">sitemaps.org</a>.
+					</p>
+					<p class="expl">
+						This sitemap contains <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs.
+					</p>			
+					<table id="sitemap" cellpadding="3">
+						<thead>
 							<tr>
-								<xsl:if test="position() mod 2 != 1">
-									<xsl:attribute  name="class">high</xsl:attribute>
-								</xsl:if>
-								<td>
-									<xsl:variable name="itemURL">
-										<xsl:value-of select="sitemap:loc"/>
-									</xsl:variable>
-									<a href="{$itemURL}">
-										<xsl:value-of select="sitemap:loc"/>
-									</a>
-								</td>
-								<td>
-									<xsl:value-of select="concat(sitemap:priority*100,'%')"/>
-								</td>
-								<td>
-									<xsl:value-of select="concat(translate(substring(sitemap:changefreq, 1, 1),concat($lower, $upper),concat($upper, $lower)),substring(sitemap:changefreq, 2))"/>
-								</td>
-								<td>
-									<xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
-								</td>
+								<th width="75%">URL</th>
+								<th width="5%">Priority</th>
+								<th width="5%">Images</th>
+								<th width="5%">Change Freq.</th>
+								<th width="10%">Last Change</th>
 							</tr>
-						</xsl:for-each>
+						</thead>
+						<tbody>
+							<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
+							<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
+							<xsl:for-each select="sitemap:urlset/sitemap:url">
+								<tr>
+									<td>
+										<xsl:variable name="itemURL">
+											<xsl:value-of select="sitemap:loc"/>
+										</xsl:variable>
+										<a href="{$itemURL}">
+											<xsl:value-of select="sitemap:loc"/>
+										</a>
+									</td>
+									<td>
+										<xsl:value-of select="concat(sitemap:priority*100,'%')"/>
+									</td>
+									<td>
+										<xsl:value-of select="count(image:image)"/>
+									</td>
+									<td>
+										<xsl:value-of select="concat(translate(substring(sitemap:changefreq, 1, 1),concat($lower, $upper),concat($upper, $lower)),substring(sitemap:changefreq, 2))"/>
+									</td>
+									<td>
+										<xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
+									</td>
+								</tr>
+							</xsl:for-each>
+						</tbody>
 					</table>
 				</div>
