Index: extensions/piclens/admin/config.php
===================================================================
--- extensions/piclens/admin/config.php	(revision 3615)
+++ extensions/piclens/admin/config.php	(revision 3619)
@@ -59,4 +59,5 @@
   $me->my_config['piclens_bestrated_active'] = isset($_POST['piclens_bestrated_active']);
   $me->my_config['piclens_favorites_active'] = isset($_POST['piclens_favorites_active']);
+  $me->my_config['piclens_tags_active'] = isset($_POST['piclens_tags_active']);
 
   $me->my_config['piclens_recursive_mode'] = $_POST['recursive_mode'];
@@ -67,8 +68,4 @@
 }
 
-//$template->assign('PICLENS_ACTIVATED', $me->my_config['piclens_active'] ? 'checked="checked"' : '' );
-//$template->assign('PICLENS_RECURSIVE_ACTIVATED', $me->my_config['piclens_recursive'] ? 'checked="checked"' : '' );
-//$template->assign('PICLENS_GALLERIE_ACTIVATED', $me->my_config['piclens_gallerie_active'] ? 'checked="checked"' : '' );
-
 // Affichage des coix miniature possibles pour la recursivite de l'option 'Activer gallerie'
 $i=1;
@@ -78,19 +75,4 @@
 	$i++;	
 }
-//$template->assign('PICLENS_GALLERIE_TYPE', $me->my_config['piclens_gallerie_type']);
-
-//$template->assign('PICLENS_LITE_ACTIVATED', $me->my_config['piclens_lite_active'] ? 'checked="checked"' : '' );
-
-//$template->assign('PICLENS_SECUREIMAGE', get_db_plugins('active','secureImages'));
-//$template->assign('PICLENS_SECUREIMAGE_ACTIVATED', $me->my_config['piclens_secureimage'] ? 'checked="checked"' : '' );
-
-//$template->assign('PICLENS_EXTENDEDDESC', get_db_plugins('active','ExtendedDescription') );
-//$template->assign('PICLENS_EXTENDEDDESC_ACTIVATED', $me->my_config['piclens_extendeddesc'] ? 'checked="checked"' : '' );
- 
-//$template->assign('PICLENS_RECENTPICS_ACTIVATED', $me->my_config['piclens_recentpics_active'] ? 'checked="checked"' : '' );
-//$template->assign('PICLENS_RECENTCATS_ACTIVATED', $me->my_config['piclens_recentcats_active'] ? 'checked="checked"' : '' );
-//$template->assign('PICLENS_MOSTVISITED_ACTIVATED', $me->my_config['piclens_mostvisited_active'] ? 'checked="checked"' : '' );
-//$template->assign('PICLENS_BESTRATED_ACTIVATED', $me->my_config['piclens_bestrated_active'] ? 'checked="checked"' : '' );
-//$template->assign('PICLENS_FAVORITES_ACTIVATED', $me->my_config['piclens_favorites_active'] ? 'checked="checked"' : '' );
 
 $template->assign(array(
@@ -109,4 +91,5 @@
 	'PICLENS_BESTRATED_ACTIVATED'	=> ($me->my_config['piclens_bestrated_active'] ? 'checked="checked"' : '' ),
 	'PICLENS_FAVORITES_ACTIVATED'	=> ($me->my_config['piclens_favorites_active'] ? 'checked="checked"' : '' ),
+	'PICLENS_TAGS_ACTIVATED'		=> ($me->my_config['piclens_tags_active'] ? 'checked="checked"' : '' ),
 	$me->my_config['piclens_recursive_mode'].'_CHECKED' => 'checked="checked"',
 	'ICON_INFO' => PICLENS_ADMIN_PATH . 'info.png',
Index: extensions/piclens/admin/config.tpl
===================================================================
--- extensions/piclens/admin/config.tpl	(revision 3615)
+++ extensions/piclens/admin/config.tpl	(revision 3619)
@@ -102,4 +102,6 @@
 			<input type="checkbox" name="piclens_recentcats_active" {$PICLENS_RECENTCATS_ACTIVATED}/> {'piclens_recentcats_label'|@translate} 
 		    <br/>
+			<input type="checkbox" name="piclens_tags_active" {$PICLENS_TAGS_ACTIVATED}/> {'piclens_tags_label'|@translate} 
+		    <br/>
 
 		</TD>
Index: extensions/piclens/admin/piclenswallconfig.php
===================================================================
--- extensions/piclens/admin/piclenswallconfig.php	(revision 3615)
+++ extensions/piclens/admin/piclenswallconfig.php	(revision 3619)
@@ -45,4 +45,5 @@
   $me->my_config['piclens_wall_spec_bestrated'] = isset($_POST['piclens_wall_spec_bestrated']);
   $me->my_config['piclens_wall_spec_favorites'] = isset($_POST['piclens_wall_spec_favorites']);
+  $me->my_config['piclens_wall_spec_tags'] = isset($_POST['piclens_wall_spec_tags']);
 
   $me->my_config['piclens_wall_swflocal'] = isset($_POST['piclens_wall_swflocal']);
@@ -104,4 +105,5 @@
 	'PICLENS_WALL_SPEC_BESTRATED'						=> ($me->my_config['piclens_wall_spec_bestrated'] ? 'checked="checked"' : '' ),
 	'PICLENS_WALL_SPEC_FAVORITES'						=> ($me->my_config['piclens_wall_spec_favorites'] ? 'checked="checked"' : '' ),
+	'PICLENS_WALL_SPEC_TAGS'							=> ($me->my_config['piclens_wall_spec_tags'] ? 'checked="checked"' : '' ),
 	'PICLENS_WALL_SWFLOCAL'								=> ($me->my_config['piclens_wall_swflocal'] ? 'checked="checked"' : '' )
 	));
Index: extensions/piclens/admin/piclenswallconfig.tpl
===================================================================
--- extensions/piclens/admin/piclenswallconfig.tpl	(revision 3615)
+++ extensions/piclens/admin/piclenswallconfig.tpl	(revision 3619)
@@ -139,4 +139,6 @@
 		    <br/>
 				 <input type="checkbox" name="piclens_wall_spec_recentpics" {$PICLENS_WALL_SPEC_RECENTPICS}/> {'piclens_recentpics_label'|@translate} 
+		    <br/>
+				 <input type="checkbox" name="piclens_wall_spec_tags" {$PICLENS_WALL_SPEC_TAGS}/> {'piclens_tags_label'|@translate} 
 			
 			</TD>
Index: extensions/piclens/admin/rssfeed.php
===================================================================
--- extensions/piclens/admin/rssfeed.php	(revision 3615)
+++ extensions/piclens/admin/rssfeed.php	(revision 3619)
@@ -19,16 +19,11 @@
 $me = get_plugin_data($plugin_id);
 
-//$order_list = array('Defaut Piwigo', 'Date de Creation', 'Date d\'ajout', 'Note Moyenne', 'Plus vues', 'Nom du fichier', 'Id', 'Al&eacute;atoire', 'Cat&eacute;gories');
 $order_list = array(l10n('piclens_label_orderPiwigo'), l10n('piclens_label_orderCreDate'), l10n('piclens_label_orderAddDate'), l10n('piclens_label_orderRank'), l10n('piclens_label_orderBest'), l10n('piclens_label_orderName'), l10n('piclens_label_orderID'), l10n('piclens_label_orderRand'), l10n('piclens_label_orderCat'));
-//$sort_list = array('Defaut Piwigo', 'Croissant', 'Decroissant');
 $sort_list = array(l10n('piclens_label_sortPiwigo'), l10n('piclens_label_sortUp'), l10n('piclens_label_sortDown'));
 
-//$thumb_list = array('Miniature', 'Normal');
 $thumb_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'));
-//$normal_list = array('Miniature', 'Normal', 'High');
 $normal_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'), l10n('piclens_label_TypeHigh'));
-//$nameformat_list = array('Nom vignette : taille', 'Nom vignette', 'Nom de l\'image');
+
 //$nameformat_list = array(l10n('piclens_label_Name1'), l10n('piclens_label_Name2'), l10n('piclens_label_Name3'));
-//$descformat_list = array('Rien', 'Nom de l\'image', 'Description de l\'image');
 //$descformat_list = array(l10n('piclens_label_Desc1'), l10n('piclens_label_Desc2'), l10n('piclens_label_Desc3'));
  
@@ -61,4 +56,5 @@
   $me->my_config['piclens_rss_name'] = $_POST['piclens_rss_name'];
   $me->my_config['piclens_rss_desc'] = $_POST['piclens_rss_desc'];
+  $me->my_config['piclens_exclude_double'] = isset($_POST['piclens_exclude_double']);
     
 
@@ -147,4 +143,5 @@
 $template->assign('PICLENS_RSS_NAME', $me->my_config['piclens_rss_name']);
 $template->assign('PICLENS_RSS_DESC', $me->my_config['piclens_rss_desc']);
+$template->assign('PICLENS_EXCLUDE_DOUBLE', $me->my_config['piclens_exclude_double'] ? 'checked="checked"' : '' );
 
 
Index: extensions/piclens/admin/rssfeed.tpl
===================================================================
--- extensions/piclens/admin/rssfeed.tpl	(revision 3615)
+++ extensions/piclens/admin/rssfeed.tpl	(revision 3619)
@@ -134,4 +134,11 @@
 		</TD>
 	</TR>
+	<TR>
+		<TD > 
+		     - <input type="checkbox" name="piclens_exclude_double" {$PICLENS_EXCLUDE_DOUBLE}/> {'piclens_rsscfg_exclude_double'|@translate}
+		</TD > 
+		<TD colspan="2"> 	&nbsp;
+		</TD>
+	</TR>
 
 </TABLE> 
Index: extensions/piclens/generate_rss.php
===================================================================
--- extensions/piclens/generate_rss.php	(revision 3615)
+++ extensions/piclens/generate_rss.php	(revision 3619)
@@ -178,4 +178,24 @@
 		}
 
+		// Gestion des tags
+		elseif (($page['section']) == 'tags')
+		{
+//			$row = get_image_ids_for_tags($page['tags_id']);
+			// $cat need to bo not null...
+			array_push($cat, "1");
+			$query = 'SELECT DISTINCT(tag.image_id) , img.id, img.file, img.date_available, img.date_creation, img.tn_ext, img.name, 
+					  img.comment, img.author, img.hit ,img.filesize, img.average_rate, img.has_high, img.path, 
+					  img.level , ic.category_id, cat.name AS catname, cat.comment AS catcomment, cat.rank, cat.status, 
+					  cat.visible, cat.uppercats, cat.permalink, cat.dir '
+					.' FROM '.IMAGE_TAG_TABLE.' AS tag '."\n"
+					.' INNER JOIN '.IMAGES_TABLE.' AS img ON tag.image_id = img.id'
+					.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON img.id = ic.image_id'
+					.' INNER JOIN '.CATEGORIES_TABLE.' AS cat ON ic.category_id = cat.id'			
+					.' WHERE tag.tag_id IN ('.implode(',', $page['tag_ids']).') '
+				    .$forbidden
+					.' '.$conf['order_by'].';';
+		}
+		
+		
 		elseif (($page['section']) == 'categories')
 		{
@@ -320,4 +340,5 @@
 		{
 			$result = pwg_query($query);
+			
 			while ($row = mysql_fetch_assoc($result))
 			{
@@ -329,10 +350,26 @@
 						&& ((isset($row['catname']) ? !(substr_count($row['catname'],  $piclens_extdesc_hidden)) : true))
 						))
-					array_push($pictures, $row);
+				{
+					// Suppression des doublons (même path)
+					if ($obj->my_config['piclens_exclude_double'])
+					{
+						$double = false;
+						foreach ($pictures as $key => $values)
+							// même path
+							if ($row['path'] == $values['path'])
+								$double=true;
+
+						// pas de double trouvé
+						if (!$double)
+							array_push($pictures, $row);
+					}
+					else
+						array_push($pictures, $row);
+				}
 			}
 		}
 		// Fin requetes recherches photos
 
-		
+
 		// Creation du fichier xml (flux rss)
 		// It's a rss file
@@ -366,9 +403,7 @@
 
 		// Icone de la gallerie dans le flux RSS
-//		echo '<logo url="'.get_root_url().'template-common/favicon.ico"></logo>';
 		echo "\n";
 		echo '<atom:icon>'.$obj->root_site_piclens.'template-common/favicon.ico</atom:icon>';
 		echo "\n";
-//   <atom:link href="http://mywebsite.com/photos.rss" rel="self" type="application/rss+xml" />
 
 		// Pour chacune des images, preparation du flux xml
@@ -544,5 +579,4 @@
 			echo "<link>" . $url . "</link>\n";
 
-//			echo "<guid>" . $row['id'] . "\</guid>\n";				
 			echo "<guid isPermaLink=\"false\">\"" . $row['id'] . "\"</guid>\n";
 			
Index: extensions/piclens/include/Piclens.class.php
===================================================================
--- extensions/piclens/include/Piclens.class.php	(revision 3615)
+++ extensions/piclens/include/Piclens.class.php	(revision 3619)
@@ -47,6 +47,20 @@
 			{
 
+				// Page Tags
+				if (($page['section']) == 'tags' && $this->my_config['piclens_tags_active'])
+				{
+					$tags = '';
+					foreach ($page['tag_ids'] as $id => $tag)
+						$tags .= '/'.$tag.'-'.$page['tags'][''.$id.'']['name'];
+					
+					$piclnkMaster='<link rel="alternate"'
+								. ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/tags'
+								.$tags
+								.'"'
+								.' type="application/rss+xml" title="" id="recent_pics"'
+								. ' >' . "\n";			
+				}
 				// Page images recentes
-				if (($page['section']) == 'recent_pics' && $this->my_config['piclens_recentpics_active'])
+				elseif (($page['section']) == 'recent_pics' && $this->my_config['piclens_recentpics_active'])
 				{
 					$piclnkMaster='<link rel="alternate"'
@@ -250,4 +264,5 @@
 					|| (($page['section']) == 'best_rated' && $this->my_config['piclens_bestrated_active'])
 					|| (($page['section']) == 'favorites' && $this->my_config['piclens_favorites_active'])
+					|| (($page['section']) == 'tags' && $this->my_config['piclens_tags_active'])
 					|| (($page['section']) == 'categories')
 					)
@@ -443,4 +458,11 @@
 				else if ($page['section'] == 'favorites' && $this->my_config['piclens_wall_spec_favorites'])
 					$rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/favorites';
+				else if ($page['section'] == 'tags' && $this->my_config['piclens_wall_spec_tags'])
+				{
+					$tags = '';
+					foreach ($page['tag_ids'] as $id => $tag)
+						$tags .= '/'.$tag.'-'.$page['tags'][''.$id.'']['name'];
+					$rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/tags'.$tags;
+				}
 			}
 			// Remplacement de la navigation
Index: extensions/piclens/include/default_values.inc.php
===================================================================
--- extensions/piclens/include/default_values.inc.php	(revision 3615)
+++ extensions/piclens/include/default_values.inc.php	(revision 3619)
@@ -53,4 +53,5 @@
 $piclens_default_values['piclens_bestrated_active'] = true;
 $piclens_default_values['piclens_favorites_active'] = true;
+$piclens_default_values['piclens_tags_active']	= true;
 
 $piclens_default_values['piclens_wall_spec'] = false; // remplacement navigation image dans categories par le mur 3D
@@ -60,4 +61,5 @@
 $piclens_default_values['piclens_wall_spec_bestrated'] = false;
 $piclens_default_values['piclens_wall_spec_favorites'] = false;
+$piclens_default_values['piclens_wall_spec_tags'] = false;
 
 $piclens_default_values['piclens_wall_swflocal'] = false;	// Flash swf local utilise pour le mur 3D (pas besoin du fichier crossdomain.xml mais pas de MAJ automatique du flash)
@@ -83,6 +85,7 @@
 
 
-$piclens_default_values['piclens_rss_name'] = "%I2"; // Nom
-$piclens_default_values['piclens_rss_desc'] = "%I3"; // Description
+$piclens_default_values['piclens_rss_name'] = "Nom : %I2"; // Nom
+$piclens_default_values['piclens_rss_desc'] = "(%I3)"; // Description
 
+$piclens_default_values['piclens_exclude_double']	= false; // Suppression des doublons
 ?>
Index: extensions/piclens/language/en_UK/plugin.lang.php
===================================================================
--- extensions/piclens/language/en_UK/plugin.lang.php	(revision 3615)
+++ extensions/piclens/language/en_UK/plugin.lang.php	(revision 3619)
@@ -207,4 +207,6 @@
 // Fin legende
 
+$lang['piclens_tags_label']		= 'Tags';
+$lang['piclens_rsscfg_exclude_double']	= 'Suppress double picture in the feed (same path)';
 
 ?>
Index: extensions/piclens/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/piclens/language/fr_FR/plugin.lang.php	(revision 3615)
+++ extensions/piclens/language/fr_FR/plugin.lang.php	(revision 3619)
@@ -210,3 +210,5 @@
 // Fin legende
 
+$lang['piclens_tags_label']		= 'Tags';
+$lang['piclens_rsscfg_exclude_double']	= 'Suppression des doublons d\'image dans le flux (même répertoire d\'accès)';
 ?>
Index: extensions/piclens/main.inc.php
===================================================================
--- extensions/piclens/main.inc.php	(revision 3615)
+++ extensions/piclens/main.inc.php	(revision 3619)
@@ -69,4 +69,6 @@
  /* 0.3.6 --> Ajout parametres supplementaires du mur embeded  */
  /* 0.4.0 --> Changement methode pour parametrer les noms et decriptions des images */
+ /* 		 Ajout integration piclens sur les tags */
+ /* 		 Ajout paramètre pour supprimer les doublons d'image dans le flux rss */
  
 
