Index: extensions/addThis/include/AddThis.class.php
===================================================================
--- extensions/addThis/include/AddThis.class.php	(revision 3411)
+++ extensions/addThis/include/AddThis.class.php	(revision 3596)
@@ -2,5 +2,5 @@
 /*
  * Plugin Name: AddThis
- * Version: 0.0.1
+ * Version: 0.0.3
  * Description: AddThis activation
  * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=293
@@ -19,21 +19,16 @@
 	    global $template, $page, $user;
 
-			if (  (isset($page['page']) && ($page['page']) == 'plugin')
-				&&(isset($page['body_id']) && isset($page['section']) && ($page['section']) == 'theAdminPage'))
-					$cssfile = '<link href="./plugins/AddThis/js/addthis.css" rel="stylesheet" type="text/css" />';
-			else
-			{
-				if (isset($page['section']) && ($page['section']) == 'categories')
-				{			
-					// Selection du mode 'icones'
-					if (	(isset($page['image_id']) && $this->my_config['ImageButton'] == 8)
-						 ||	(empty($page['category']) && $this->my_config['HomeButton'] == 8)
-						 ||	(isset($page['category']) && $this->my_config['CategoryButton'] == 8)
-						)
-						$cssfile = '<link href="./plugins/AddThis/js/addthis.css" rel="stylesheet" type="text/css" />';
-				}
-			}
-			if (isset($cssfile))		
-				$template->append('head_elements',$cssfile);		
+        if (isset($page['section']) && ($page['section']) == 'categories')
+        {			
+            // Selection du mode 'icones'
+            if (	(isset($page['image_id']) && $this->my_config['ImageButton'] == 8)
+                 ||	(empty($page['category']) && $this->my_config['HomeButton'] == 8)
+                 ||	(isset($page['category']) && $this->my_config['CategoryButton'] == 8)
+                )
+//						$cssfile = '<link href="./plugins/AddThis/js/addthis.css" rel="stylesheet" type="text/css" />';
+                $cssfile = '<link href="'.ADDTHIS_JS_PATH.'addthis.css" rel="stylesheet" type="text/css" />';
+        }
+        if (isset($cssfile))		
+            $template->append('head_elements',$cssfile);		
 	    
 	}
@@ -69,4 +64,14 @@
 						);
 
+		// Taille des boutons
+		$addthis_img_size = array(
+			'',
+			'125',
+			'83',
+			'123',
+			'83',
+			'125',
+			'16',
+			'');					
 		$addthis_option = '';
 		$addthis_img = 0;
@@ -89,5 +94,5 @@
 		}
 		// pas d'affichage sur selection = 'desactive' ou si selection = 'icones'
-		if ($addthis_img > 0 && $addthis_img < 8)
+		if ($addthis_img > 0 && $addthis_img < 9)
 		{
 			foreach ($this->my_config['addthis_options'] as $key => $value) 
@@ -102,64 +107,84 @@
 	                                                          
 
-				$tpl_code = (isset($page['image_id']) ? "\n".'<p align="left">' :"\n<li>")
-				.'<script type="text/javascript">'
-				.(strlen($addthis_option) != 0 ? 'var addthis_options = \''.$addthis_option.'\'': '')
-				.(strlen($this->my_config['addthis_pub']) != 0 ? "\n".'var addthis_pub = "'.$this->my_config['addthis_pub'].'";' : '')
-				.(strlen($this->my_config['addthis_brand']) != 0 ? "\n".'var addthis_brand = "'.$this->my_config['addthis_brand'].'";' : '')
-				.(strlen($this->my_config['addthis_header_color']) != 0 ? "\n".'var addthis_header_color = "'.$this->my_config['addthis_header_color'].'";' : '')
-				.(strlen($this->my_config['addthis_header_background']) != 0 ? "\n".'var addthis_header_background = "'.$this->my_config['addthis_header_background'].'";' : '')
-
-				.(strlen($this->my_config['addthis_offset_top']) != 0 ? "\n".'var addthis_offset_top = '.$this->my_config['addthis_offset_top'].';' : '')
-				.(strlen($this->my_config['addthis_offset_left']) != 0 ? "\n".'var addthis_offset_left = '.$this->my_config['addthis_offset_left'].';' : '')
-				.(strlen($this->my_config['addthis_hover_delay']) != 0 ? "\n".'var addthis_hover_delay = '.$this->my_config['addthis_hover_delay'].';' : '')
-				.(strlen($this->my_config['addthis_language']) != 0 ? "\n".'var addthis_language = "'.$this->my_config['addthis_language'].'";' : '')
-
-				.'</script>
-				<a href="http://www.addthis.com/bookmark.php?v=20" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()">'
+            $tpl_code = (isset($page['image_id']) ? "\n" :"\n<li>")
+            .'<script type="text/javascript">'
+            .(strlen($this->my_config['addthis_pub']) != 0 ? "\n".'var addthis_pub = "'.$this->my_config['addthis_pub'].'";' : '')
+            .(strlen($this->my_config['addthis_brand']) != 0 ? "\n".'var addthis_brand = "'.$this->my_config['addthis_brand'].'";' : '')
+            .(strlen($this->my_config['addthis_header_color']) != 0 ? "\n".'var addthis_header_color = "'.$this->my_config['addthis_header_color'].'";' : '')
+            .(strlen($this->my_config['addthis_header_background']) != 0 ? "\n".'var addthis_header_background = "'.$this->my_config['addthis_header_background'].'";' : '')
+            .(strlen($this->my_config['addthis_offset_top']) != 0 ? "\n".'var addthis_offset_top = '.$this->my_config['addthis_offset_top'].';' : '')
+            .(strlen($this->my_config['addthis_offset_left']) != 0 ? "\n".'var addthis_offset_left = '.$this->my_config['addthis_offset_left'].';' : '')
+            .(strlen($this->my_config['addthis_hover_delay']) != 0 ? "\n".'var addthis_hover_delay = '.$this->my_config['addthis_hover_delay'].';' : '')
+            .(strlen($this->my_config['addthis_language']) != 0 ? "\n".'var addthis_language = "'.$this->my_config['addthis_language'].'";' : '')
+             ."\n" ;
+                
+            if ($addthis_img > 0 && $addthis_img < 8)
+            {
+                $tpl_code.=(strlen($addthis_option) != 0 ? 'var addthis_options = \''.$addthis_option.'\'': '')
+                ."\n"
+                .'</script>';
+
+                
+				$tpl_code .= '<a style="padding:4px;'.(isset($addthis_img_size[$addthis_img]) ? 'width:'.$addthis_img_size[$addthis_img].'px;' : '').'" href="http://www.addthis.com/bookmark.php?v=250" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()">'
+                 ."\n" 
 				.$addthis_img_src[$addthis_img]
+                 ."\n"
 				// si selection du 7
 				.($addthis_img == 7 ? (strlen($this->my_config['addthis_icon_text']) != 0 ? $this->my_config['addthis_icon_text'] : 'Share' ) : '')
-				.'</a><script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>'
-				.(isset($page['image_id']) ? '</p>' :'</li>');
-
-		}
-		else if ($addthis_img == 8)
-		{
-
-			$tpl_code = '
-			<script type="text/javascript">	
-			addthis_title 	= document.title;
-			addthis_url 	= window.location.href;
-			addthis_clickout= true;'
-			.(strlen($this->my_config['addthis_pub']) != 0 ? "\n".'addthis_id = \''.$this->my_config['addthis_pub'].'\';' : '')
-			.'</script>'
-			."\n";
-			$nb_icons = 1;
-			foreach ($this->my_config['addthis_options'] as $key => $value) 
-			{
-				if ($nb_icons <= $this->my_config['addthis_icon_nb'])
-				{
-					if ($value == true)
-					{		
-						$nb_icons++;
-
-						$tpl_code .= (isset($page['image_id']) ? '' : '<li>')
-						.'<a href="/" title="'.$key.'" onclick="return addthis_invoke(\''.$key.'\', addthis_url, addthis_title, addthis_id);" class="at15t at15t_'.$key.'"> &nbsp;'.$key.'</span></a>'
-						.(isset($page['image_id']) ? '' : '</li>')
-						."\n";	
-
-//						$tpl_code .= '<td width="10"></td><td class="c1"><a href="javascript:sets(\''.$key.'\');" class="c1a" onclick="return omc(\''.$key.'\')"><span class="at15t at15t_'.$key.'"></span></a></td>';
-//					$tpl_code .= '<li class="at15t at15t_'.$key.'"><a  href="/" title="'.$key.'" onclick="return addthis_invoke(\''.$key.'\', addthis_url, addthis_title, addthis_id);" ></a></li>';					
-					}
-				}
-			}
-			$tpl_code .= '<script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>'."\n";
-
-		}
-			
+				."\n"
+                .'</a><script type="text/javascript" src="'.ADDTHIS_JS_PATH.'addthis_widget.js"></script>'
+				."\n"
+                .(isset($page['image_id']) ? '' :'</li>');
+            }
+
+            else if ($addthis_img == 8)
+            {
+                $tpl_code .= '</script>';
+
+                $tpl_code .= '
+                <script type="text/javascript">	
+                addthis_title 	= document.title;
+                addthis_url 	= window.location.href;
+                addthis_clickout= true;'
+                .(strlen($this->my_config['addthis_pub']) != 0 ? 'addthis_id = \''.$this->my_config['addthis_pub'].'\';' : '')
+                ."\n"
+                .'</script>'
+                ."\n";
+                
+                $nb_icons = 1;
+
+                $tpl_code .= (isset($page['image_id']) ? '' : '<li>');
+
+                $tpl_code .= '<div class="addthis_toolbox addthis_default_style">';
+
+                foreach ($this->my_config['addthis_options'] as $key => $value) 
+                {
+                    if ($nb_icons <= $this->my_config['addthis_icon_nb'])
+                    {
+                        if ($value == true)
+                        {		
+                            $nb_icons++;
+                            if ($key == "more")	
+                            {
+    							$tpl_code .='<span class="addthis_separator" style="padding:1px;">|</span>';
+                                $tpl_code .='<a href="http://www.addthis.com/bookmark.php?v=250" class="addthis_button_compact""></a>';
+                            }
+                            else
+                                $tpl_code .='<a class="addthis_button_'.$key.'" ></a>';
+
+                        }
+                    }
+                }
+//                $tpl_code .= '<script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>'."\n";
+                $tpl_code .= '<script type="text/javascript" src="'.ADDTHIS_JS_PATH.'addthis_widget.js"></script>'."\n";
+    			$tpl_code .= (isset($page['image_id']) ? '' : '</li>');
+
+                
+            }
+
+		}
 		if (isset($tpl_code))
 		{
 			if (isset($page['image_id']))
-//				$template->concat('PLUGIN_PICTURE_BEFORE', $tpl_code);
 				$template->concat('PLUGIN_PICTURE_ACTIONS', $tpl_code);
 			else
@@ -170,6 +195,4 @@
 
 
-	// Add piclens pics to start slideshow
-	// Another thanks to P@t
 
 	/* Loading of the configuration file - If not exist -> load default values */
@@ -222,20 +245,4 @@
 	}
 	
-		  
-	function add_AddThis_action()
-	{
-		global $template, $page;
-
-			$tpl_code = '<script type="text/javascript">var addthis_pub="4a0c1f674d14de33";</script>
-<a href="http://www.addthis.com/bookmark.php?v=20" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()" class="button"><img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" ></a><script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>';
-
-		if (isset($tpl_code))
-		{
-//			$template->concat('PLUGIN_INDEX_ACTIONS', $tpl_code);
-			$template->concat('PLUGIN_PICTURE_BEFORE', $tpl_code);
-	
-		}
-	}
-
 	
 	function AddThis_admin_menu($menu)
