Index: /extensions/rv_db_integrity/check_db.php
===================================================================
--- /extensions/rv_db_integrity/check_db.php	(revision 3417)
+++ /extensions/rv_db_integrity/check_db.php	(revision 3417)
@@ -0,0 +1,160 @@
+<?php
+defined('PHPWG_ROOT_PATH') or trigger_error('Hacking attempt!', E_USER_ERROR);
+
+function check_table_ref($t, $f, $reft, $reff)
+{
+  $query = '
+DESCRIBE '.$reft.' '.$reff;
+  $row = mysql_fetch_assoc( pwg_query($query) );
+  $ref_nullable = ( $row['Null'] != '');
+
+  $query = '
+SELECT ref.'.$reff.'
+  FROM '.$reft.' ref LEFT JOIN '.$t.' main ON ref.'.$reff.' = main.'.$f.'
+  WHERE main.'.$f.' IS NULL';
+  if ($ref_nullable)
+    $query.=' AND ref.'.$reff.' IS NOT NULL';
+  $query.='
+  GROUP BY ref.'.$reff;
+
+  $result = pwg_query($query);
+  return mysql_num_rows($result);
+}
+
+$default_checked = count($_POST)==0 ? 'checked="checked"' : '';
+
+// Standard reference tests ---------------------------------------------------
+$reference_tests = array();
+
+$reference_tests[IMAGES_TABLE] = array(
+    array(CADDIE_TABLE,           'element_id'),
+    array(CATEGORIES_TABLE,       'representative_picture_id'),
+    array(COMMENTS_TABLE,         'image_id'),
+    array(FAVORITES_TABLE,        'image_id'),
+    array(IMAGE_CATEGORY_TABLE,   'image_id'),
+    array(IMAGE_TAG_TABLE,        'image_id'),
+    array(RATE_TABLE,             'element_id'),
+  );
+
+$reference_tests[CATEGORIES_TABLE] = array(
+    array(CATEGORIES_TABLE,       'id_uppercat'),
+    array(GROUP_ACCESS_TABLE,     'cat_id'),
+    array(IMAGE_CATEGORY_TABLE,   'category_id'),
+    array(IMAGES_TABLE,           'storage_category_id'),
+    array(OLD_PERMALINKS_TABLE,   'cat_id'),
+    array(USER_ACCESS_TABLE,      'cat_id'),
+    array(WAITING_TABLE,          'storage_category_id'),
+    array(USER_CACHE_CATEGORIES_TABLE, 'cat_id'),
+  );
+
+$reference_tests[TAGS_TABLE] = array(
+    array(IMAGE_TAG_TABLE,   'tag_id'),
+  );
+
+$reference_tests[GROUPS_TABLE] = array(
+    array(GROUP_ACCESS_TABLE,     'group_id'),
+    array(USER_GROUP_TABLE,       'group_id'),
+  );
+
+foreach ($reference_tests as $table=>$ref_test)
+{
+	$field_name = 'id';
+	$tpl_var =
+		array(
+			'ID' => 'test-'.$table,
+			'LABEL' => '#'.$table.'.'.$field_name,
+			'CHECKED' => isset($_POST['test-'.$table]) ? 'checked="checked"' : $default_checked,
+			'COUNT' => count($ref_test),
+		);
+
+	if ( isset($_POST['test-'.$table]) )
+	{
+		$failed = 0;
+		foreach ($ref_test as $test)
+		{
+			$err = check_table_ref($table, $field_name, $test[0], $test[1] );
+			if ($err)
+			{
+				$failed++;
+				$tpl_var['errors'][]= $err.' error references; #'.$test[0].'.'.$test[1].' referring to #'.$table.'.'.$field_name;
+			}
+		}
+		$tpl_var['result'] = $failed;
+	}
+	$template->append('reference_tests', $tpl_var);
+}
+
+// Permalinks test ------------------------------------------------------------
+$tpl_var = array(
+		'ID' => 'permalinks',
+		'LABEL' => 'Pemalinks',
+		'CHECKED' => isset($_POST['permalinks']) ? 'checked="checked"' : $default_checked,
+		'COUNT' => 1,
+	);
+if (isset($_POST['permalinks']))
+{
+	$query = '
+SELECT c.permalink, c.id, op.cat_id
+  FROM '.CATEGORIES_TABLE.' c INNER JOIN '.OLD_PERMALINKS_TABLE.' op ON c.permalink=op.permalink';
+	$result = pwg_query($query);
+	$tpl_var['result'] = mysql_num_rows($result);
+	while ($row=mysql_fetch_assoc($result))
+	{
+		$tpl_var['errors'][] = $row['permalink'].' matches categories '.$row['id'].' and '.$row['cat_id'];
+	}
+}
+$template->append('reference_tests', $tpl_var);
+
+
+// #images(id,storage_category_id) vs. #image_category(image_id,category_id) ---
+$tpl_var = array(
+		'ID' => 'id_storage_category_id',
+		'LABEL' => '#images(id,storage_category_id) in #image_category',
+		'CHECKED' => isset($_POST['id_storage_category_id']) ? 'checked="checked"' : $default_checked,
+		'COUNT' => 1,
+	);
+if (isset($_POST['id_storage_category_id']))
+{
+  $query = '
+SELECT i.id, i.storage_category_id, i.path
+  FROM '.IMAGES_TABLE.' i LEFT JOIN '.IMAGE_CATEGORY_TABLE.' ic ON ic.image_id=i.id AND ic.category_id=i.storage_category_id
+  WHERE (ic.category_id IS NULL OR ic.image_id IS NULL) AND i.storage_category_id IS NOT NULL';
+	$result = pwg_query($query);
+	$tpl_var['result'] = mysql_num_rows($result);
+	$i=0;
+	while ($row=mysql_fetch_assoc($result) and $i<=50 )
+	{
+		$tpl_var['errors'][] = $row['path'].' missing entry ('.$row['id'].','.$row['storage_category_id']. ') in #'.IMAGE_CATEGORY_TABLE;
+		$i++;
+	}
+}
+$template->append('reference_tests', $tpl_var);
+
+// uploadable virtual cats
+$tpl_var = array(
+		'ID' => 'uploadable_virtual_cats',
+		'LABEL' => 'Uploadable virtual cats',
+		'CHECKED' => isset($_POST['uploadable_virtual_cats']) ? 'checked="checked"' : $default_checked,
+		'COUNT' => 1,
+	);
+if (isset($_POST['uploadable_virtual_cats']))
+{
+  $query = '
+SELECT c.id, c.name
+  FROM '.CATEGORIES_TABLE.' c
+  WHERE c.dir IS NULL AND uploadable="true"';
+	$result = pwg_query($query);
+	$tpl_var['result'] = mysql_num_rows($result);
+	$i=0;
+	while ($row=mysql_fetch_assoc($result) and $i<=50 )
+	{
+		$tpl_var['errors'][] = $row['id'].' ('.$row['name'].') is uploadable';
+		$i++;
+	}
+}
+$template->append('reference_tests', $tpl_var);
+
+$template->set_filename('check', dirname(__FILE__).'/check_db.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'check');
+
+?>
Index: /extensions/rv_db_integrity/check_db.tpl
===================================================================
--- /extensions/rv_db_integrity/check_db.tpl	(revision 3417)
+++ /extensions/rv_db_integrity/check_db.tpl	(revision 3417)
@@ -0,0 +1,43 @@
+<div class="titrePage">
+  <h2>DB Integrity check</h2>
+</div>
+
+
+<form method="post" action="">
+
+<table class="table2">
+	<tr class="throw">
+		<td>Test</td>
+		<td>Result</td>
+	</tr>
+{foreach from=$reference_tests item=reference_test}
+	<tr>
+		<td>
+		<input type="checkbox" name="{$reference_test.ID}" {$reference_test.CHECKED}>
+		{$reference_test.LABEL} ({$reference_test.COUNT} references)
+		</td>
+		<td>
+		{if isset($reference_test.result)}
+		{if $reference_test.result>0}
+			<span style="color:white;background-color:red">{$reference_test.result} FAILED</span>
+		{else}
+			Passed
+		{/if}
+		{/if}
+		</td>
+	</tr>
+{if isset($reference_test.errors)}
+	<tr><td colspan="2">
+{foreach from=$reference_test.errors item=error}
+		{$error}<br/>
+{/foreach}
+	</td></tr>
+{/if}
+{/foreach}
+</table>
+
+<p>
+  <input type="submit" class="submit" value="{'Submit'|@translate}" name="submit" />
+</p>
+
+</form>
Index: /extensions/rv_db_integrity/main.inc.php
===================================================================
--- /extensions/rv_db_integrity/main.inc.php	(revision 3417)
+++ /extensions/rv_db_integrity/main.inc.php	(revision 3417)
@@ -0,0 +1,23 @@
+<?php /*
+Plugin Name: RV DB Integrity
+Version: 2.0.b
+Description: Checks database integrity. After install go to admin / Advanced features.
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=179
+Author: rvelices
+Author URI: http://www.modusoptimus.com
+*/
+
+add_event_handler('get_admin_advanced_features_links', 'rvint_get_admin_advanced_features_links');
+
+function rvint_get_admin_advanced_features_links($advanced_features)
+{
+  array_push($advanced_features,
+    array
+    (
+      'CAPTION' => 'Check database integrity',
+      'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/check_db.php')
+    ));
+  return $advanced_features;
+}
+
+?>
Index: /extensions/rv_sitemap/changelog.txt
===================================================================
--- /extensions/rv_sitemap/changelog.txt	(revision 3417)
+++ /extensions/rv_sitemap/changelog.txt	(revision 3417)
@@ -0,0 +1,12 @@
+2.0.a
+	- compatible with piwigo
+
+1.7.c
+	- fix issue with .php for tags page
+
+1.7.b
+	- put the correct xml namespace
+	- added an xsl stylesheet to the xml
+	
+1.7.a 
+	- first release
Index: /extensions/rv_sitemap/main.inc.php
===================================================================
--- /extensions/rv_sitemap/main.inc.php	(revision 3417)
+++ /extensions/rv_sitemap/main.inc.php	(revision 3417)
@@ -0,0 +1,23 @@
+<?php /*
+Plugin Name: RV sitemap
+Version: 2.0.a
+Description: Creates a sitemap for your gallery. Sitemaps are used to inform search engines about pages that are available for crawling.
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=78
+Author: rvelices
+Author URI: http://www.modusoptimus.com/
+*/
+
+add_event_handler('get_admin_plugin_menu_links', 'sitemap_plugin_admin_menu' );
+
+function sitemap_plugin_admin_menu($menu)
+{
+  array_push($menu,
+      array(
+        'NAME' => 'Sitemap',
+        'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/sitemap.php')
+      )
+    );
+  return $menu;
+}
+
+?>
Index: /extensions/rv_sitemap/sitemap.php
===================================================================
--- /extensions/rv_sitemap/sitemap.php	(revision 3417)
+++ /extensions/rv_sitemap/sitemap.php	(revision 3417)
@@ -0,0 +1,310 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+function sitemaps_get_config_file_name()
+{
+  global $conf;
+  $dir = $conf['local_data_dir'].'/plugins/';
+  mkgetdir( $dir );
+  return $dir.basename(dirname(__FILE__)).'.dat';
+}
+
+function start_xml($filename, $gzip)
+{
+  global $file;
+  $file = fopen( $filename.($gzip?'.gz':''), 'w' );
+  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 );
+}
+
+function out_xml($xml, $gzip)
+{
+  global $file;
+  if ($gzip)
+    fwrite($file, gzencode($xml, 9) );
+  else
+    fwrite($file, $xml);
+}
+
+function end_xml($gzip)
+{
+  global $file;
+  out_xml('</urlset>',$gzip );
+  fclose( $file );
+}
+
+function add_url($url, $lastmod=null, $changefreq=null, $priority=null)
+{
+  $xml=
+'<url>
+ <loc>'.$url.'</loc>';
+
+  if ( isset($lastmod) and strlen($lastmod)>0 )
+  {
+    if (strlen($lastmod)>11)
+    {
+      $lastmod[10] = 'T';
+      if (strlen($lastmod)==19)
+      	$lastmod .= '-05:00';
+    }
+    $xml.='
+ <lastmod>'.$lastmod.'</lastmod>';
+  }
+
+  if ( isset($changefreq) and $changefreq!='' ) $xml.='
+ <changefreq>'.$changefreq.'</changefreq>';
+
+  if ( isset($priority) and $priority!='' ) $xml.='
+ <priority>'.$priority.'</priority>';
+
+  $xml .= '
+</url>';
+global $gzip,$url_count;
+  $url_count++;
+  out_xml($xml, $gzip);
+}
+
+
+
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+check_status(ACCESS_ADMINISTRATOR);
+
+
+
+$frequencies = array(
+    '',
+    'always',
+    'hourly',
+    'daily',
+    'weekly',
+    'monthly',
+    'yearly',
+    'never',
+  );
+
+$specials = array(
+  'categories' => array('L'=>l10n('home'), 'P'=>0.9),
+  'best_rated' => array( 'L'=>l10n('best_rated_cat'), 'P'=>0.8 ) ,
+  'most_visited' => array('L'=>l10n('most_visited_cat'), 'P'=>0.8 ),
+  'recent_pics' => array('L'=>l10n('recent_pics_cat'), 'P'=>0.8, 'F'=>'weekly' ),
+  'tags' => array('L'=>l10n('Tags'), 'PAGE'=>'tags' . ($conf['php_extension_in_urls'] ? '.php' : '' ), 'P'=>0.8 ),
+  );
+
+$url_count=0;
+
+// BEGIN AS GUEST
+$save_user = $user;
+$user = build_user( $conf['guest_id'], true);
+
+$query = '
+SELECT id, name, permalink, uppercats, global_rank, IFNULL(date_last, max_date_last) AS date_last
+  FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
+  ON id = cat_id AND user_id = '.$conf['guest_id'].'
+  WHERE max_date_last IS NOT NULL
+  ORDER BY global_rank';
+$result = pwg_query($query);
+$categories = array();
+while ($row = mysql_fetch_assoc($result))
+{
+  array_push($categories, $row);
+}
+usort($categories, 'global_rank_compare');
+
+$tags = get_available_tags();
+usort($tags, 'name_compare');
+
+// END AS GUEST
+$user = $save_user;
+
+if ( isset($_POST['submit']) )
+{
+  // echo('<pre>'.var_export($_POST,true).'</pre>' );
+
+  if ( $_POST['filename'] != '' )
+    $filename = $_POST['filename'];
+  $gzip = @$_POST['gzip']=='on' ? true : false;
+
+  $selected_specials = array();
+  foreach ($specials as $key=>$value)
+  {
+    if ( @$_POST['special_'.$key]=='on' )
+      array_push( $selected_specials, $key );
+    $specials[$key]['P'] = $_POST['special_prio_'.$key];
+    $specials[$key]['F'] = $_POST['special_freq_'.$key];
+  }
+  if ( isset($_POST['categories']) )
+    $selected_categories = $_POST['categories'];
+  else
+    $selected_categories = array();
+  $prio_categories = $_POST['prio_categories'];
+  $freq_categories = $_POST['freq_categories'];
+
+  if ( isset($_POST['tags']) )
+    $selected_tags = $_POST['tags'];
+  else
+    $selected_tags = array();
+  $prio_tags = $_POST['prio_tags'];
+  $freq_tags = $_POST['freq_tags'];
+
+  set_make_full_url();
+
+  start_xml($filename, $gzip);
+
+  $r_selected_specials = array_flip($selected_specials);
+  foreach ($specials as $key=>$value)
+  {
+    if (! isset ($r_selected_specials[$key]) )
+      continue;
+    if ( isset($value['PAGE']) )
+      $url = get_root_url().$value['PAGE'];
+    else
+      $url = make_index_url( array('section'=>$key) );
+    add_url($url, null, $value['F'], $value['P'] );
+  }
+
+
+  $r_selected_categories = array_flip($selected_categories);
+  foreach ($categories as $cat)
+  {
+    if (! isset ($r_selected_categories[$cat['id']]) )
+      continue;
+
+    $url = make_index_url(
+            array(
+              'category'=>$cat
+            )
+        );
+    add_url($url, $cat['date_last'], $freq_categories, $prio_categories);
+  }
+
+  $r_selected_tags = array_flip($selected_tags);
+  if ( !empty($selected_tags) )
+  {
+    $query = 'SELECT tag_id, MAX(date_available) AS da, MAX(date_creation) AS dc, MAX(date_metadata_update) AS dm
+  FROM '.IMAGE_TAG_TABLE.' INNER JOIN '.IMAGES_TABLE.' ON image_id=id
+  WHERE tag_id IN ('.implode(',',$selected_tags).')
+  GROUP BY tag_id';
+    $result = pwg_query($query);
+    $tag_infos = array();
+    while ($row = mysql_fetch_assoc($result))
+    {
+      $tag_infos[$row['tag_id']]= max( $row['da'],$row['dc'],$row['dm']);
+    }
+
+    foreach( $tags as $tag)
+    {
+      if (!isset($r_selected_tags[ $tag['id'] ] ) )
+        continue;
+
+      $url = make_index_url(
+            array(
+              'section'=>'tags',
+              'tags'=> array( $tag )
+            )
+        );
+
+      add_url($url, $tag_infos[ $tag['id'] ], $freq_tags, $prio_tags);
+    }
+  }
+  unset_make_full_url();
+  end_xml($gzip);
+
+  $page['infos'][] = $url_count.' urls saved';
+
+  // save the data for future use
+  $selected_tag_urls = array();
+  foreach( $tags as $tag)
+  {
+    if (isset($r_selected_tags[ $tag['id'] ] ) )
+      array_push($selected_tag_urls, $tag['url_name']);
+  }
+  $x = compact( 'filename', 'selected_tag_urls', 'prio_tags', 'freq_tags',
+  'selected_categories', 'prio_categories', 'freq_categories',
+  'selected_specials' );
+  $file = fopen( sitemaps_get_config_file_name(), 'w' );
+  fwrite($file, serialize($x) );
+  fclose( $file );
+}
+else
+{
+  $filename = 'sitemap.xml';
+  $gzip = false;
+  $selected_specials = 'all';
+  $prio_categories = 0.5;
+  $prio_tags = 0.6;
+  $freq_categories = 'monthly';
+  $freq_tags = 'monthly';
+  
+  $conf_file_name = sitemaps_get_config_file_name();
+  $old_file = dirname(__FILE__).'/_sitemap.dat';
+  if (file_exists($old_file) and !file_exists($conf_file_name) )
+  {
+    copy($old_file, $conf_file_name);
+    unlink($old_file);
+  }
+
+  $x = @file_get_contents( $conf_file_name );
+  if ($x!==false)
+  {
+    $x = unserialize($x);
+    extract($x);
+    $selected_tags = array();
+    if (isset($selected_tag_urls))
+    {
+      foreach($tags as $tag)
+      {
+        if ( in_array($tag['url_name'], $selected_tag_urls ) )
+          array_push($selected_tags, $tag['id']);
+      }
+      unset($selected_tag_urls);
+    }
+  }
+
+  if (!is_array(@$selected_categories)) $selected_categories = array();
+  if (!is_array(@$selected_tags)) $selected_tags = array();
+}
+
+
+$template->assign( array(
+  'FILENAME' => $filename,
+  'U_FILENAME' => get_root_url().$filename.($gzip?'.gz':''),
+  'GZIP_CHECKED' => $gzip ? 'checked="checked"' : '',
+  'PRIO_CATEGORIES' => $prio_categories,
+  'PRIO_TAGS' => $prio_tags,
+    )
+  );
+
+foreach( $specials as $key=>$value)
+{
+  $checked='';
+  if ($selected_specials=='all' or in_array($key, $selected_specials) )
+    $checked = 'checked="checked"';
+
+  $template->append( 'specials',
+    array(
+      'NAME' => $key,
+      'LABEL' =>  $value['L'],
+      'CHECKED' => $checked,
+      'PRIO' => $value['P'],
+      'FREQ' => isset($value['F']) ? $value['F'] : 'monthly',
+      )
+    );
+}
+
+display_select_categories($categories, $selected_categories, 'categories', false );
+$template->assign('freq_categories_selected', $freq_categories);
+
+
+foreach( $tags as $tag)
+  $template->append( 'tags', array($tag['id']=>$tag['name']), true );
+$template->assign('tags_selected', $selected_tags);
+$template->assign('freq_tags_selected', $freq_tags);
+
+
+$template->assign('frequencies', $frequencies);
+
+$template->set_filename('sitemap', dirname(__FILE__).'/sitemap.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'sitemap');
+
+?>
Index: /extensions/rv_sitemap/sitemap.tpl
===================================================================
--- /extensions/rv_sitemap/sitemap.tpl	(revision 3417)
+++ /extensions/rv_sitemap/sitemap.tpl	(revision 3417)
@@ -0,0 +1,55 @@
+<div class="titrePage">
+  <h2>RV Sitemap</h2>
+</div>
+
+
+<form method="post" action="">
+
+<fieldset>
+<legend>Global</legend>
+<p>
+  <label for="filename">Filename<input type="input" name="filename" value="{$FILENAME}" /></label> <a href="{$U_FILENAME}">{$U_FILENAME}</a>
+  <label for="gzip">Gzip<input type="checkbox" name="gzip" {$GZIP_CHECKED} /></label>
+</p>
+{foreach from=$specials item=special}
+    <label><input type="checkbox" {$special.CHECKED} name="special_{$special.NAME}"/>{$special.LABEL}</label>
+    <input type="input" size="4" name="special_prio_{$special.NAME}" value="{$special.PRIO}"/>
+	<select name="special_freq_{$special.NAME}" >
+	  {html_options values=$frequencies output=$frequencies selected=$special.FREQ}
+	</select>
+    <br/>
+{/foreach}
+</fieldset>
+
+<fieldset>
+<legend>Categories</legend>
+<select style="width:500px" name="categories[]" multiple="multiple" size="15">
+  {html_options options=$categories selected=$categories_selected}
+</select>
+<label for="prio_categories">Priority<input name="prio_categories" size="4" value="{$PRIO_CATEGORIES}" /></label>
+<label for="freq_categories">Frequency
+<select name="freq_categories" >
+  {html_options values=$frequencies output=$frequencies selected=$freq_categories_selected}
+</select>
+</label>
+</fieldset>
+
+<fieldset>
+<legend>Tags</legend>
+<select style="width:200px" name="tags[]" multiple="multiple" size="15">
+  {html_options options=$tags selected=$tags_selected}
+</select>
+<label for="prio_tags">Priority<input name="prio_tags" size="4" value="{$PRIO_TAGS}" /></label>
+<label for="freq_tags">Frequency
+<select name="freq_tags" >
+  {html_options values=$frequencies output=$frequencies selected=$freq_tags_selected}
+</select>
+</label>
+</fieldset>
+
+
+<p>
+  <input type="submit" class="submit" value="{'Submit'|@translate}" name="submit" />
+</p>
+
+</form>
Index: /extensions/rv_sitemap/sitemap.xsl
===================================================================
--- /extensions/rv_sitemap/sitemap.xsl	(revision 3417)
+++ /extensions/rv_sitemap/sitemap.xsl	(revision 3417)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="2.0" 
+                xmlns:html="http://www.w3.org/TR/REC-html40"
+                xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
+	<xsl:template match="/">
+		<html xmlns="http://www.w3.org/1999/xhtml">
+			<head>
+				<title>XML Sitemap</title>
+				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+				<style type="text/css">
+					body {
+						font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana;
+						font-size:13px;
+					}
+					
+					#intro {
+						border:1px black solid;
+						padding:5px 13px 5px 13px;
+						margin:10px;
+					}
+					
+					#intro p {
+						line-height:	16.8667px;
+					}
+					
+					td {
+						font-size:11px;
+					}
+					
+					th {
+						text-align:left;
+						padding-right:30px;
+						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;
+					}
+				</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>.
+					</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">
+							<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>
+							</tr>
+						</xsl:for-each>
+					</table>
+				</div>
+			</body>
+		</html>
+	</xsl:template>
+</xsl:stylesheet>
