Changeset 3596 for extensions/addThis/include
- Timestamp:
- Jul 15, 2009, 10:19:03 PM (15 years ago)
- Location:
- extensions/addThis/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/addThis/include/AddThis.class.php
r3411 r3596 2 2 /* 3 3 * Plugin Name: AddThis 4 * Version: 0.0. 14 * Version: 0.0.3 5 5 * Description: AddThis activation 6 6 * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=293 … … 19 19 global $template, $page, $user; 20 20 21 if ( (isset($page['page']) && ($page['page']) == 'plugin') 22 &&(isset($page['body_id']) && isset($page['section']) && ($page['section']) == 'theAdminPage')) 23 $cssfile = '<link href="./plugins/AddThis/js/addthis.css" rel="stylesheet" type="text/css" />'; 24 else 25 { 26 if (isset($page['section']) && ($page['section']) == 'categories') 27 { 28 // Selection du mode 'icones' 29 if ( (isset($page['image_id']) && $this->my_config['ImageButton'] == 8) 30 || (empty($page['category']) && $this->my_config['HomeButton'] == 8) 31 || (isset($page['category']) && $this->my_config['CategoryButton'] == 8) 32 ) 33 $cssfile = '<link href="./plugins/AddThis/js/addthis.css" rel="stylesheet" type="text/css" />'; 34 } 35 } 36 if (isset($cssfile)) 37 $template->append('head_elements',$cssfile); 21 if (isset($page['section']) && ($page['section']) == 'categories') 22 { 23 // Selection du mode 'icones' 24 if ( (isset($page['image_id']) && $this->my_config['ImageButton'] == 8) 25 || (empty($page['category']) && $this->my_config['HomeButton'] == 8) 26 || (isset($page['category']) && $this->my_config['CategoryButton'] == 8) 27 ) 28 // $cssfile = '<link href="./plugins/AddThis/js/addthis.css" rel="stylesheet" type="text/css" />'; 29 $cssfile = '<link href="'.ADDTHIS_JS_PATH.'addthis.css" rel="stylesheet" type="text/css" />'; 30 } 31 if (isset($cssfile)) 32 $template->append('head_elements',$cssfile); 38 33 39 34 } … … 69 64 ); 70 65 66 // Taille des boutons 67 $addthis_img_size = array( 68 '', 69 '125', 70 '83', 71 '123', 72 '83', 73 '125', 74 '16', 75 ''); 71 76 $addthis_option = ''; 72 77 $addthis_img = 0; … … 89 94 } 90 95 // pas d'affichage sur selection = 'desactive' ou si selection = 'icones' 91 if ($addthis_img > 0 && $addthis_img < 8)96 if ($addthis_img > 0 && $addthis_img < 9) 92 97 { 93 98 foreach ($this->my_config['addthis_options'] as $key => $value) … … 102 107 103 108 104 $tpl_code = (isset($page['image_id']) ? "\n".'<p align="left">' :"\n<li>") 105 .'<script type="text/javascript">' 106 .(strlen($addthis_option) != 0 ? 'var addthis_options = \''.$addthis_option.'\'': '') 107 .(strlen($this->my_config['addthis_pub']) != 0 ? "\n".'var addthis_pub = "'.$this->my_config['addthis_pub'].'";' : '') 108 .(strlen($this->my_config['addthis_brand']) != 0 ? "\n".'var addthis_brand = "'.$this->my_config['addthis_brand'].'";' : '') 109 .(strlen($this->my_config['addthis_header_color']) != 0 ? "\n".'var addthis_header_color = "'.$this->my_config['addthis_header_color'].'";' : '') 110 .(strlen($this->my_config['addthis_header_background']) != 0 ? "\n".'var addthis_header_background = "'.$this->my_config['addthis_header_background'].'";' : '') 111 112 .(strlen($this->my_config['addthis_offset_top']) != 0 ? "\n".'var addthis_offset_top = '.$this->my_config['addthis_offset_top'].';' : '') 113 .(strlen($this->my_config['addthis_offset_left']) != 0 ? "\n".'var addthis_offset_left = '.$this->my_config['addthis_offset_left'].';' : '') 114 .(strlen($this->my_config['addthis_hover_delay']) != 0 ? "\n".'var addthis_hover_delay = '.$this->my_config['addthis_hover_delay'].';' : '') 115 .(strlen($this->my_config['addthis_language']) != 0 ? "\n".'var addthis_language = "'.$this->my_config['addthis_language'].'";' : '') 116 117 .'</script> 118 <a href="http://www.addthis.com/bookmark.php?v=20" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()">' 109 $tpl_code = (isset($page['image_id']) ? "\n" :"\n<li>") 110 .'<script type="text/javascript">' 111 .(strlen($this->my_config['addthis_pub']) != 0 ? "\n".'var addthis_pub = "'.$this->my_config['addthis_pub'].'";' : '') 112 .(strlen($this->my_config['addthis_brand']) != 0 ? "\n".'var addthis_brand = "'.$this->my_config['addthis_brand'].'";' : '') 113 .(strlen($this->my_config['addthis_header_color']) != 0 ? "\n".'var addthis_header_color = "'.$this->my_config['addthis_header_color'].'";' : '') 114 .(strlen($this->my_config['addthis_header_background']) != 0 ? "\n".'var addthis_header_background = "'.$this->my_config['addthis_header_background'].'";' : '') 115 .(strlen($this->my_config['addthis_offset_top']) != 0 ? "\n".'var addthis_offset_top = '.$this->my_config['addthis_offset_top'].';' : '') 116 .(strlen($this->my_config['addthis_offset_left']) != 0 ? "\n".'var addthis_offset_left = '.$this->my_config['addthis_offset_left'].';' : '') 117 .(strlen($this->my_config['addthis_hover_delay']) != 0 ? "\n".'var addthis_hover_delay = '.$this->my_config['addthis_hover_delay'].';' : '') 118 .(strlen($this->my_config['addthis_language']) != 0 ? "\n".'var addthis_language = "'.$this->my_config['addthis_language'].'";' : '') 119 ."\n" ; 120 121 if ($addthis_img > 0 && $addthis_img < 8) 122 { 123 $tpl_code.=(strlen($addthis_option) != 0 ? 'var addthis_options = \''.$addthis_option.'\'': '') 124 ."\n" 125 .'</script>'; 126 127 128 $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()">' 129 ."\n" 119 130 .$addthis_img_src[$addthis_img] 131 ."\n" 120 132 // si selection du 7 121 133 .($addthis_img == 7 ? (strlen($this->my_config['addthis_icon_text']) != 0 ? $this->my_config['addthis_icon_text'] : 'Share' ) : '') 122 .'</a><script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>' 123 .(isset($page['image_id']) ? '</p>' :'</li>'); 124 125 } 126 else if ($addthis_img == 8) 127 { 128 129 $tpl_code = ' 130 <script type="text/javascript"> 131 addthis_title = document.title; 132 addthis_url = window.location.href; 133 addthis_clickout= true;' 134 .(strlen($this->my_config['addthis_pub']) != 0 ? "\n".'addthis_id = \''.$this->my_config['addthis_pub'].'\';' : '') 135 .'</script>' 136 ."\n"; 137 $nb_icons = 1; 138 foreach ($this->my_config['addthis_options'] as $key => $value) 139 { 140 if ($nb_icons <= $this->my_config['addthis_icon_nb']) 141 { 142 if ($value == true) 143 { 144 $nb_icons++; 145 146 $tpl_code .= (isset($page['image_id']) ? '' : '<li>') 147 .'<a href="/" title="'.$key.'" onclick="return addthis_invoke(\''.$key.'\', addthis_url, addthis_title, addthis_id);" class="at15t at15t_'.$key.'"> '.$key.'</span></a>' 148 .(isset($page['image_id']) ? '' : '</li>') 149 ."\n"; 150 151 // $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>'; 152 // $tpl_code .= '<li class="at15t at15t_'.$key.'"><a href="/" title="'.$key.'" onclick="return addthis_invoke(\''.$key.'\', addthis_url, addthis_title, addthis_id);" ></a></li>'; 153 } 154 } 155 } 156 $tpl_code .= '<script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>'."\n"; 157 158 } 159 134 ."\n" 135 .'</a><script type="text/javascript" src="'.ADDTHIS_JS_PATH.'addthis_widget.js"></script>' 136 ."\n" 137 .(isset($page['image_id']) ? '' :'</li>'); 138 } 139 140 else if ($addthis_img == 8) 141 { 142 $tpl_code .= '</script>'; 143 144 $tpl_code .= ' 145 <script type="text/javascript"> 146 addthis_title = document.title; 147 addthis_url = window.location.href; 148 addthis_clickout= true;' 149 .(strlen($this->my_config['addthis_pub']) != 0 ? 'addthis_id = \''.$this->my_config['addthis_pub'].'\';' : '') 150 ."\n" 151 .'</script>' 152 ."\n"; 153 154 $nb_icons = 1; 155 156 $tpl_code .= (isset($page['image_id']) ? '' : '<li>'); 157 158 $tpl_code .= '<div class="addthis_toolbox addthis_default_style">'; 159 160 foreach ($this->my_config['addthis_options'] as $key => $value) 161 { 162 if ($nb_icons <= $this->my_config['addthis_icon_nb']) 163 { 164 if ($value == true) 165 { 166 $nb_icons++; 167 if ($key == "more") 168 { 169 $tpl_code .='<span class="addthis_separator" style="padding:1px;">|</span>'; 170 $tpl_code .='<a href="http://www.addthis.com/bookmark.php?v=250" class="addthis_button_compact""></a>'; 171 } 172 else 173 $tpl_code .='<a class="addthis_button_'.$key.'" ></a>'; 174 175 } 176 } 177 } 178 // $tpl_code .= '<script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>'."\n"; 179 $tpl_code .= '<script type="text/javascript" src="'.ADDTHIS_JS_PATH.'addthis_widget.js"></script>'."\n"; 180 $tpl_code .= (isset($page['image_id']) ? '' : '</li>'); 181 182 183 } 184 185 } 160 186 if (isset($tpl_code)) 161 187 { 162 188 if (isset($page['image_id'])) 163 // $template->concat('PLUGIN_PICTURE_BEFORE', $tpl_code);164 189 $template->concat('PLUGIN_PICTURE_ACTIONS', $tpl_code); 165 190 else … … 170 195 171 196 172 // Add piclens pics to start slideshow173 // Another thanks to P@t174 197 175 198 /* Loading of the configuration file - If not exist -> load default values */ … … 222 245 } 223 246 224 225 function add_AddThis_action()226 {227 global $template, $page;228 229 $tpl_code = '<script type="text/javascript">var addthis_pub="4a0c1f674d14de33";</script>230 <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>';231 232 if (isset($tpl_code))233 {234 // $template->concat('PLUGIN_INDEX_ACTIONS', $tpl_code);235 $template->concat('PLUGIN_PICTURE_BEFORE', $tpl_code);236 237 }238 }239 240 247 241 248 function AddThis_admin_menu($menu) -
extensions/addThis/include/constants.inc.php
r3411 r3596 2 2 /* 3 3 * Plugin Name: AddThis 4 * Version: 0.0. 15 * Description: Addthis sactivation6 * Plugin URI: http://fr.piwigo.org/ext/extension_view.php 4 * Version: 0.0.3 5 * Description: Addthis activation 6 * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=293 7 7 * Author: Tiico 8 8 * Author URI: -
extensions/addThis/include/default_values.inc.php
r3411 r3596 2 2 /* 3 3 * Plugin Name: AddThis 4 * Version: 0.0. 14 * Version: 0.0.3 5 5 * Description: Addthiss activation 6 6 * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=293
Note: See TracChangeset
for help on using the changeset viewer.