[3637] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | * Plugin Name: CoolIris-Piclens |
---|
[3645] | 4 | * File : piclens.class.php |
---|
| 5 | */ |
---|
[3637] | 6 | |
---|
| 7 | |
---|
| 8 | class Piclens |
---|
| 9 | { |
---|
| 10 | var $my_config, $root_site_piclens; |
---|
| 11 | |
---|
| 12 | function Piclens() |
---|
| 13 | { |
---|
| 14 | // HTTPS |
---|
| 15 | set_make_full_url(); |
---|
| 16 | $this->root_site_piclens = get_root_url(); |
---|
| 17 | // If needed NO_https can easily be set in your config_local thru LocalFiles Editor |
---|
| 18 | if (isset($conf['NO_https']) and $conf['NO_https'] and strncasecmp($this->root_site_piclens, 'https://', 8) == 0 ) |
---|
| 19 | $this->root_site_piclens = 'http://' . substr($this->root_site_piclens, 8); |
---|
| 20 | // HTTPS |
---|
| 21 | unset_make_full_url(); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | // Add Piclens CSS & Javascript in HEAD section |
---|
| 26 | function piclens_link() |
---|
| 27 | { |
---|
| 28 | global $template, $page, $user; |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | $jscript = '<script type="text/javascript"> function roll_over_piclens(img_name, img_src){document[img_name].src = img_src;}</script>'; |
---|
| 32 | $template->append('head_elements',$jscript); |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | // Vérification d'activation du plugin (page administration) |
---|
| 36 | if ($this->my_config['piclens_active']) |
---|
| 37 | { |
---|
| 38 | // Correction bug compteur "fou". Les pages d'affichage des images seules ne sont pas a prendre en compte. |
---|
| 39 | if (isset($page['section']) && !isset($page['image_id'])) |
---|
| 40 | { |
---|
| 41 | |
---|
| 42 | // Page Tags |
---|
| 43 | if (($page['section']) == 'tags' && $this->my_config['piclens_tags_active']) |
---|
| 44 | { |
---|
| 45 | $tags = ''; |
---|
| 46 | foreach ($page['tag_ids'] as $id => $tag) |
---|
| 47 | $tags .= '/'.$tag.'-'.$page['tags'][''.$id.'']['name']; |
---|
| 48 | |
---|
| 49 | $piclnkMaster='<link rel="alternate"' |
---|
| 50 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/tags' |
---|
| 51 | .$tags |
---|
| 52 | .'"' |
---|
| 53 | .' type="application/rss+xml" title="" id="recent_pics"' |
---|
| 54 | . ' >' . "\n"; |
---|
| 55 | } |
---|
| 56 | // Page images recentes |
---|
| 57 | elseif (($page['section']) == 'recent_pics' && $this->my_config['piclens_recentpics_active']) |
---|
| 58 | { |
---|
| 59 | $piclnkMaster='<link rel="alternate"' |
---|
| 60 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/recent_pics"' |
---|
| 61 | .' type="application/rss+xml" title="" id="recent_pics"' |
---|
| 62 | . ' >' . "\n"; |
---|
| 63 | } |
---|
| 64 | // Page categories recentes |
---|
| 65 | elseif (($page['section']) == 'recent_cats' && $this->my_config['piclens_recentcats_active']) |
---|
| 66 | { |
---|
| 67 | if ($this->my_config['piclens_recursive_mode'] != 'standard') |
---|
| 68 | { |
---|
| 69 | $query = 'SELECT c.id, c.permalink |
---|
| 70 | FROM '.CATEGORIES_TABLE.' c INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' |
---|
| 71 | ON id = cat_id and user_id = '.$user['id'].' |
---|
| 72 | WHERE date_last >= SUBDATE( |
---|
| 73 | CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY |
---|
| 74 | ) |
---|
| 75 | '.get_sql_condition_FandF |
---|
| 76 | ( |
---|
| 77 | array |
---|
| 78 | ( |
---|
| 79 | 'visible_categories' => 'id', |
---|
| 80 | ), |
---|
| 81 | 'AND' |
---|
| 82 | ).' |
---|
| 83 | ;'; |
---|
| 84 | $piclnkMaster=''; |
---|
| 85 | $result = pwg_query($query); |
---|
| 86 | while ($row = mysql_fetch_assoc($result)) |
---|
| 87 | { |
---|
| 88 | // Gestion des permalinks |
---|
| 89 | $categoryId = $row['id'] ; |
---|
| 90 | if (!empty($row['permalink'])) |
---|
| 91 | $categoryId = $row['permalink']; |
---|
| 92 | |
---|
| 93 | $piclnkMaster.='<link rel="alternate"' |
---|
| 94 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/category/' |
---|
| 95 | . $categoryId .'&norecurs"' |
---|
| 96 | .' type="application/rss+xml" title="" id="'.$row['id'].'"' |
---|
| 97 | . ' >' . "\n"; |
---|
| 98 | |
---|
| 99 | } |
---|
| 100 | } |
---|
| 101 | else |
---|
| 102 | { |
---|
| 103 | |
---|
| 104 | $piclnkMaster='<link rel="alternate"' |
---|
| 105 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/recent_cats"' |
---|
| 106 | .' type="application/rss+xml" title="" id="recent_cats"' |
---|
| 107 | . ' >' . "\n"; |
---|
| 108 | |
---|
| 109 | } |
---|
| 110 | } |
---|
| 111 | // Page plus vues |
---|
| 112 | elseif (($page['section']) == 'most_visited' && $this->my_config['piclens_mostvisited_active']) |
---|
| 113 | { |
---|
| 114 | $piclnkMaster='<link rel="alternate"' |
---|
| 115 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/most_visited"' |
---|
| 116 | .' type="application/rss+xml" title="" id="most_visited"' |
---|
| 117 | . ' >' . "\n"; |
---|
| 118 | } |
---|
| 119 | // mieux notees |
---|
| 120 | else if ($page['section'] == 'best_rated' && $this->my_config['piclens_bestrated_active']) |
---|
| 121 | { |
---|
| 122 | $piclnkMaster='<link rel="alternate"' |
---|
| 123 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/best_rated"' |
---|
| 124 | .' type="application/rss+xml" title="" id="best_rated"' |
---|
| 125 | . ' >' . "\n"; |
---|
| 126 | } |
---|
| 127 | // favories |
---|
| 128 | else if ($page['section'] == 'favorites' && $this->my_config['piclens_favorites_active']) |
---|
| 129 | { |
---|
| 130 | $piclnkMaster='<link rel="alternate"' |
---|
| 131 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/favorites"' |
---|
| 132 | .' type="application/rss+xml" title="" id="favorites"' |
---|
| 133 | . ' >' . "\n"; |
---|
| 134 | } |
---|
| 135 | |
---|
| 136 | // Seulement sur une page type 'categorie' |
---|
| 137 | // Correction bug compteur "fou". Les pages d'affichage des images seules ne sont pas a prendre en compte. |
---|
| 138 | elseif (($page['section']) == 'categories' && !isset($page['image_id'])) |
---|
| 139 | { |
---|
| 140 | |
---|
| 141 | // Page accueil et option gallerie activee |
---|
| 142 | if( (empty($page['category'])) && $this->my_config['piclens_gallerie_active'] ) |
---|
| 143 | { |
---|
| 144 | if ($this->my_config['piclens_recursive_mode'] != 'standard') |
---|
| 145 | { |
---|
| 146 | $query = 'SELECT id,name,permalink FROM ' . CATEGORIES_TABLE |
---|
| 147 | .' WHERE id_uppercat is NULL'; |
---|
| 148 | |
---|
| 149 | $piclnkMaster=''; |
---|
| 150 | $result = pwg_query($query); |
---|
| 151 | |
---|
| 152 | while ($row = mysql_fetch_assoc($result)) |
---|
| 153 | { |
---|
| 154 | if (!(in_array($row['id'], explode(',', $user['forbidden_categories'])))) |
---|
| 155 | { |
---|
| 156 | $piclnkMaster.='<link rel="alternate"' |
---|
| 157 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/category/' |
---|
| 158 | . $row['id'] .'"' |
---|
| 159 | .' type="application/rss+xml" title="" id="'.$row['id'].'"' |
---|
| 160 | . ' >' . "\n"; |
---|
| 161 | } |
---|
| 162 | } |
---|
| 163 | |
---|
| 164 | } |
---|
| 165 | else |
---|
| 166 | { |
---|
| 167 | $piclnkMaster='<link rel="alternate"' |
---|
| 168 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/categories"' |
---|
| 169 | .' type="application/rss+xml" title="" id="accueil"' |
---|
| 170 | . ' >' . "\n"; |
---|
| 171 | } |
---|
| 172 | } |
---|
| 173 | // Add only if we are in category page |
---|
| 174 | elseif (!empty($page['category']['id'])) |
---|
| 175 | { |
---|
| 176 | |
---|
| 177 | if ($this->my_config['piclens_recursive_mode'] != 'standard') |
---|
| 178 | { |
---|
| 179 | $categoryId = $page['category']['id'] ; |
---|
| 180 | if (!empty($page['category']['permalink'])) |
---|
| 181 | $categoryId = $page['category']['permalink']; |
---|
| 182 | |
---|
| 183 | $piclnkMaster='<link rel="alternate"' |
---|
| 184 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/category/' |
---|
| 185 | . $categoryId .'&norecurs"' |
---|
| 186 | .' type="application/rss+xml" title="" id="'.$page['category']['id'].'"' |
---|
| 187 | . ' >' . "\n"; |
---|
| 188 | |
---|
| 189 | $query = ' |
---|
| 190 | SELECT DISTINCT(id) |
---|
| 191 | FROM '.CATEGORIES_TABLE.' |
---|
| 192 | WHERE id_uppercat='.$page['category']['id'].';'; |
---|
| 193 | $result = pwg_query($query); |
---|
| 194 | |
---|
| 195 | while ($row = mysql_fetch_array($result)) |
---|
| 196 | { |
---|
| 197 | $piclnkMaster.='<link rel="alternate"' |
---|
| 198 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/category/' |
---|
| 199 | . $row['id'] .'"' |
---|
| 200 | .' type="application/rss+xml" title="" id="'.$row['id'].'"' |
---|
| 201 | . ' >' . "\n"; |
---|
| 202 | } |
---|
| 203 | /* |
---|
| 204 | $piclnkMaster.='<link rel="alternate"' |
---|
| 205 | . ' href="'.get_root_url().PICLENS_PATH.'piclens-rss.php?/category/' |
---|
| 206 | . $categoryId .'&norecurs"' |
---|
| 207 | .' type="application/rss+xml" title="" id="'.$page['category']['id'].'"' |
---|
| 208 | . ' >' . "\n"; |
---|
| 209 | */ |
---|
| 210 | } |
---|
| 211 | |
---|
| 212 | else |
---|
| 213 | { |
---|
| 214 | // Gestion des permalinks |
---|
| 215 | $categoryId = $page['category']['id'] ; |
---|
| 216 | if (!empty($page['category']['permalink'])) |
---|
| 217 | $categoryId = $page['category']['permalink']; |
---|
| 218 | |
---|
| 219 | $piclnkMaster='<link rel="alternate"' |
---|
| 220 | . ' href="'.$this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/category/' |
---|
| 221 | . $categoryId .'"' |
---|
| 222 | .' type="application/rss+xml" title="" id="'.$page['category']['id'].'"' |
---|
| 223 | . ' >' . "\n"; |
---|
| 224 | } |
---|
| 225 | } |
---|
| 226 | |
---|
| 227 | } |
---|
| 228 | |
---|
| 229 | if (isset($piclnkMaster)) |
---|
| 230 | { |
---|
| 231 | $piclnk=$piclnkMaster; |
---|
| 232 | // We need absolute path |
---|
| 233 | |
---|
| 234 | $template->append('head_elements',$piclnk.'<script type="text/javascript" src="http://lite.piclens.com/current/piclens.js"></script>'); |
---|
| 235 | } |
---|
| 236 | } |
---|
| 237 | } |
---|
| 238 | |
---|
| 239 | } |
---|
| 240 | |
---|
| 241 | |
---|
| 242 | // Add piclens Flash slideshow to toolbar |
---|
| 243 | // Thanks to P@t |
---|
| 244 | function add_piclens_icon() |
---|
| 245 | { |
---|
| 246 | global $template, $page; |
---|
| 247 | if ($this->my_config['piclens_lite_active'] && $this->my_config['piclens_active']) |
---|
| 248 | { |
---|
| 249 | // Seulement sur une page type 'categorie' |
---|
| 250 | if (isset($page['section'])) |
---|
| 251 | { |
---|
| 252 | // images recentes |
---|
| 253 | |
---|
| 254 | if ( (($page['section']) == 'recent_pics' && $this->my_config['piclens_recentpics_active']) |
---|
| 255 | || (($page['section']) == 'recent_cats' && $this->my_config['piclens_recentcats_active']) |
---|
| 256 | || (($page['section']) == 'most_visited' && $this->my_config['piclens_mostvisited_active']) |
---|
| 257 | || (($page['section']) == 'best_rated' && $this->my_config['piclens_bestrated_active']) |
---|
| 258 | || (($page['section']) == 'favorites' && $this->my_config['piclens_favorites_active']) |
---|
| 259 | || (($page['section']) == 'tags' && $this->my_config['piclens_tags_active']) |
---|
| 260 | || (($page['section']) == 'categories') |
---|
| 261 | ) |
---|
| 262 | // categories recentes |
---|
| 263 | // plus vues |
---|
| 264 | // mieux notees |
---|
| 265 | // favories |
---|
| 266 | { |
---|
| 267 | if($page['section'] == 'categories') |
---|
| 268 | { |
---|
| 269 | if (empty($page['category'])) // acceuil |
---|
| 270 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/categories'; |
---|
| 271 | else |
---|
| 272 | { |
---|
| 273 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/category/'; |
---|
| 274 | $rssfeed .= empty($page['category']['permalink']) ? $page['category']['id'] : $page['category']['permalink']; |
---|
| 275 | } |
---|
| 276 | if (isset($conf['NO_https']) and $conf['NO_https'] and strncasecmp($rssfeed, 'https://', 8) == 0 ) |
---|
| 277 | $rssfeed = 'http://' . substr($rssfeed, 8); |
---|
| 278 | |
---|
| 279 | } |
---|
| 280 | $tpl_code = '<li><a href="javascript:PicLensLite.start('.(isset($rssfeed) ? ' {feedUrl:\''.$rssfeed.'\'}' : '').');" title="'.l10n('piclens_button').'" onmouseover="roll_over_piclens(\'but1\', \''.$this->root_site_piclens.PICLENS_IMG_PATH.'cooliris-icon-point.png\')" onmouseout="roll_over_piclens(\'but1\', \''.$this->root_site_piclens.PICLENS_IMG_PATH.'cooliris-icon.png\')">'; |
---|
| 281 | $tpl_code.='<img src="'.$this->root_site_piclens.PICLENS_IMG_PATH.'cooliris-icon.png" NAME="but1" class="button" alt="'.l10n('piclens_button').'" width="24" height="24"></a></li>'; |
---|
| 282 | if(($page['section'] == 'categories') && empty($page['category']) && !$this->my_config['piclens_gallerie_active']) // Accueil et option piclens gallerie desactivee |
---|
[3907] | 283 | $tpl_code='<li><img src="'.$this->root_site_piclens.PICLENS_IMG_PATH.'cooliris-icon-black.png" NAME="but1" class="button" alt="'.l10n('piclens_button').'" width="24" height="24"></a></li>'; |
---|
[3637] | 284 | } |
---|
| 285 | if (isset($tpl_code)) |
---|
| 286 | $template->concat('PLUGIN_INDEX_ACTIONS', $tpl_code."\n"); |
---|
| 287 | } |
---|
| 288 | |
---|
| 289 | } |
---|
| 290 | } |
---|
| 291 | |
---|
| 292 | |
---|
| 293 | // Add piclens pics to start slideshow |
---|
| 294 | // Another thanks to P@t |
---|
| 295 | function set_make_full_url_piclens() |
---|
| 296 | { |
---|
| 297 | global $page; |
---|
| 298 | |
---|
| 299 | set_make_full_url(); |
---|
| 300 | // HTTPS PATCH : If needed NO_https can easily be set in your config_local thru LocalFiles Editor |
---|
| 301 | if (isset($conf['NO_https']) and $conf['NO_https'] and strncasecmp($page['root_path'], 'https://', 8) == 0 ) |
---|
| 302 | $page['root_path'] = 'http://' . substr($page['root_path'], 8); |
---|
| 303 | |
---|
| 304 | } |
---|
| 305 | |
---|
| 306 | /* Loading of the configuration on database */ |
---|
| 307 | function load_config() |
---|
| 308 | { |
---|
| 309 | |
---|
| 310 | $query = ' |
---|
| 311 | SELECT value |
---|
| 312 | FROM '.CONFIG_TABLE.' |
---|
| 313 | WHERE param = \''.PICLENS_CFG_DB.'\' |
---|
| 314 | ;'; |
---|
| 315 | |
---|
| 316 | $result = pwg_query($query); |
---|
| 317 | |
---|
| 318 | if($result) |
---|
| 319 | { |
---|
| 320 | $row = mysql_fetch_row($result); |
---|
| 321 | if(is_string($row[0])) |
---|
| 322 | { |
---|
[3649] | 323 | // $this->my_config = unserialize($row[0]); |
---|
| 324 | $this->my_config = unserialize(($row[0])); |
---|
[3637] | 325 | } |
---|
| 326 | } |
---|
| 327 | $this->load_default_config(); |
---|
| 328 | // Desactivation de piclenswall si PWG Stuff est installe |
---|
| 329 | $this->my_config['piclens_wall'] = (get_db_plugins('active','PWG_Stuffs') ? false : $this->my_config['piclens_wall']); |
---|
| 330 | |
---|
| 331 | // Si tri = defaut PIWIGO ==> l'ordre est egalement defaut PIWIGO |
---|
| 332 | if ($this->my_config['piclens_order'] == 1) $this->my_config['piclens_sort'] = 1; |
---|
| 333 | if ($this->my_config['piclens_order_cat'] == 1) $this->my_config['piclens_sort_cat'] = 1; |
---|
| 334 | |
---|
| 335 | } |
---|
| 336 | |
---|
| 337 | /* Loading of the configuration file - If not exist -> load default values */ |
---|
| 338 | function load_config_file() |
---|
| 339 | { |
---|
| 340 | // changement du nom du fichier de conf. |
---|
| 341 | if (!file_exists(PICLENS_CFG_FILE)) |
---|
| 342 | { |
---|
| 343 | if (file_exists(PICLENS_CFG_FILE_OLD)) |
---|
| 344 | @rename(PICLENS_CFG_FILE_OLD,PICLENS_CFG_FILE); |
---|
| 345 | } |
---|
| 346 | |
---|
| 347 | $x = @file_get_contents( PICLENS_CFG_FILE ); |
---|
| 348 | if ($x!==false) |
---|
| 349 | { |
---|
| 350 | $c = unserialize($x); |
---|
| 351 | $this->my_config = $c; |
---|
| 352 | } |
---|
| 353 | // Init default value for the config file |
---|
| 354 | $this->load_default_config(); |
---|
| 355 | |
---|
| 356 | // Desactivation de piclenswall si PWG Stuff est installe |
---|
| 357 | $this->my_config['piclens_wall'] = (get_db_plugins('active','PWG_Stuffs') ? false : $this->my_config['piclens_wall']); |
---|
| 358 | |
---|
| 359 | // Si tri = defaut PIWIGO ==> l'ordre est egalement defaut PIWIGO |
---|
| 360 | if ($this->my_config['piclens_order'] == 1) $this->my_config['piclens_sort'] = 1; |
---|
| 361 | if ($this->my_config['piclens_order_cat'] == 1) $this->my_config['piclens_sort_cat'] = 1; |
---|
| 362 | } |
---|
| 363 | |
---|
| 364 | /* Saving of the configuration on DB*/ |
---|
| 365 | function save_config() |
---|
| 366 | { |
---|
| 367 | $query = ' |
---|
| 368 | REPLACE INTO '.CONFIG_TABLE.' |
---|
| 369 | VALUES( |
---|
| 370 | \''.PICLENS_CFG_DB.'\', |
---|
[3649] | 371 | \''.(serialize($this->my_config)).'\', |
---|
[3637] | 372 | \'Configuration de Piclens\') |
---|
| 373 | ;'; |
---|
| 374 | |
---|
| 375 | $result = pwg_query($query); |
---|
| 376 | |
---|
| 377 | if($result) |
---|
| 378 | return true; |
---|
| 379 | else |
---|
| 380 | return false; |
---|
| 381 | |
---|
| 382 | } |
---|
| 383 | |
---|
| 384 | /* Saving of the configuration file with data */ |
---|
| 385 | function save_config_file() |
---|
| 386 | { |
---|
| 387 | $file = fopen( PICLENS_CFG_FILE, 'w' ); |
---|
| 388 | fwrite($file, serialize($this->my_config) ); |
---|
| 389 | fclose( $file ); |
---|
| 390 | } |
---|
| 391 | |
---|
| 392 | |
---|
| 393 | private function load_default_config() |
---|
| 394 | { |
---|
| 395 | include PICLENS_INC_PATH.'default_values.inc.php'; |
---|
| 396 | foreach ($piclens_default_values as $key => $value) |
---|
| 397 | { |
---|
| 398 | if (!isset($this->my_config[$key])) $this->my_config[$key] = $value; |
---|
| 399 | } |
---|
| 400 | } |
---|
| 401 | |
---|
| 402 | function piclens_admin_menu($menu) |
---|
| 403 | { |
---|
| 404 | array_push($menu, |
---|
| 405 | array( |
---|
| 406 | 'NAME' => 'Cooliris-Piclens', |
---|
| 407 | 'URL' => get_admin_plugin_menu_link(PICLENS_ADMIN_PATH.'piclens_admin.php') |
---|
| 408 | ) |
---|
| 409 | ); |
---|
| 410 | return $menu; |
---|
| 411 | } |
---|
| 412 | |
---|
| 413 | function piclenswall() |
---|
| 414 | { |
---|
| 415 | global $page; |
---|
| 416 | // piclens active+ activation du mur |
---|
| 417 | // if ($this->my_config['piclens_active'] && $this->my_config['piclens_wall']) |
---|
| 418 | if ($this->my_config['piclens_wall']) |
---|
| 419 | if (isset($page['body_id']) and $page['section'] == 'categories') |
---|
| 420 | include_once(PICLENS_PATH.'piclenswall.php'); |
---|
| 421 | } |
---|
| 422 | |
---|
| 423 | function piclens_thumbnails() |
---|
| 424 | { |
---|
| 425 | global $template, $page; |
---|
| 426 | |
---|
| 427 | // piclens active |
---|
| 428 | if ( isset($page['section']) |
---|
| 429 | and $this->my_config['piclens_active']) |
---|
| 430 | { |
---|
| 431 | |
---|
| 432 | // Pages speciales et configuration activee |
---|
| 433 | if ($this->my_config['piclens_wall_spec']) |
---|
| 434 | { |
---|
| 435 | // Page images recentes |
---|
| 436 | if (($page['section']) == 'recent_pics' && $this->my_config['piclens_wall_spec_recentpics']) |
---|
| 437 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/recent_pics'; |
---|
| 438 | |
---|
| 439 | // Page categories recentes |
---|
| 440 | elseif (($page['section']) == 'recent_cats' && $this->my_config['piclens_wall_spec_recentcats']) |
---|
| 441 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/recent_cats'; |
---|
| 442 | |
---|
| 443 | // Page plus vues |
---|
| 444 | elseif (($page['section']) == 'most_visited' && $this->my_config['piclens_wall_spec_mostvisited']) |
---|
| 445 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/most_visited'; |
---|
| 446 | |
---|
| 447 | // mieux notees |
---|
| 448 | else if ($page['section'] == 'best_rated' && $this->my_config['piclens_wall_spec_bestrated']) |
---|
| 449 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/best_rated'; |
---|
| 450 | |
---|
| 451 | // favories |
---|
| 452 | else if ($page['section'] == 'favorites' && $this->my_config['piclens_wall_spec_favorites']) |
---|
| 453 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/favorites'; |
---|
| 454 | else if ($page['section'] == 'tags' && $this->my_config['piclens_wall_spec_tags']) |
---|
| 455 | { |
---|
| 456 | $tags = ''; |
---|
| 457 | foreach ($page['tag_ids'] as $id => $tag) |
---|
| 458 | $tags .= '/'.$tag.'-'.$page['tags'][''.$id.'']['name']; |
---|
| 459 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/tags'.$tags; |
---|
| 460 | } |
---|
| 461 | } |
---|
| 462 | // Remplacement de la navigation |
---|
| 463 | if ($this->my_config['piclens_wall_nav']) |
---|
| 464 | { |
---|
| 465 | // Page categories |
---|
| 466 | if ($page['section'] == 'categories' |
---|
| 467 | and !empty($page['category']) |
---|
| 468 | and !empty($page['items'])) |
---|
| 469 | { |
---|
| 470 | // verification de presence de la categorie dans la liste parametree |
---|
| 471 | if (in_array($page['category']['id'], $this->my_config['piclens_wall_cat_nav_replace'])) |
---|
| 472 | { |
---|
| 473 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/category/'; |
---|
| 474 | $rssfeed .= empty($page['category']['permalink']) ? $page['category']['id'] : $page['category']['permalink']; |
---|
| 475 | } |
---|
| 476 | } |
---|
| 477 | } |
---|
| 478 | } |
---|
| 479 | |
---|
| 480 | if (isset($rssfeed)) |
---|
| 481 | { |
---|
| 482 | if (isset($conf['NO_https']) and $conf['NO_https'] and strncasecmp($rssfeed, 'https://', 8) == 0 ) |
---|
| 483 | $rssfeed = 'http://' . substr($rssfeed, 8); |
---|
| 484 | |
---|
| 485 | $color = $this->my_config['piclens_wall_color']; |
---|
| 486 | $height = $this->my_config['piclens_wall_height']; |
---|
| 487 | $showfullscreen = ($this->my_config['piclens_wall_showfullscreen'] ? "true" : "false"); |
---|
| 488 | $showembed = ($this->my_config['piclens_wall_showembed'] ? "true" : "false"); |
---|
| 489 | $showsearch = ($this->my_config['piclens_wall_showsearch'] ? "true" : "false"); |
---|
| 490 | $template->assign('THUMBNAILS', |
---|
| 491 | '<object id="o" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" |
---|
| 492 | width="100%" height="'.$this->my_config['piclens_wall_height'].'" > |
---|
| 493 | <param name="movie" value="' |
---|
| 494 | // Test si utilisation du fichier flash local. |
---|
| 495 | .($this->my_config['piclens_wall_swflocal'] ? $this->root_site_piclens.PICLENS_PATH.'swf/cooliris.swf' : 'http://apps.cooliris.com/embed/cooliris.swf') |
---|
| 496 | .'?feed='.$rssfeed.'&style='.$color.'&showEmbed='.$showembed.'&showFullScreen='.$showfullscreen.'&showSearch='.$showsearch.'" /> |
---|
| 497 | <param name="allowFullScreen" value="'.$showfullscreen.'" /> |
---|
| 498 | <param name="showEmbed" value="'.$showembed.'" /> |
---|
| 499 | <param name="showSearch" value="'.$showsearch.'" /> |
---|
| 500 | <param name="allowScriptAccess" value="always" />' |
---|
| 501 | .($this->my_config['piclens_wall_transparent'] |
---|
| 502 | ? '<param name="wmode" value="transparent" /> |
---|
| 503 | <embed WMODE="transparent"' |
---|
| 504 | : '<embed ') |
---|
| 505 | .'type="application/x-shockwave-flash" src="' |
---|
| 506 | // Test si utilisation du fichier flash local. |
---|
| 507 | .($this->my_config['piclens_wall_swflocal'] ? $this->root_site_piclens.PICLENS_PATH.'swf/cooliris.swf' : 'http://apps.cooliris.com/embed/cooliris.swf') |
---|
| 508 | .'?feed='.$rssfeed.'&style='.$color.'&showEmbed='.$showembed.'&showFullScreen='.$showfullscreen.'&showSearch='.$showsearch.'" width="100%" height="'.$height.'" showEmbed="'.$showembed.'" showSearch="'.$showsearch.'" allowFullScreen="'.$showfullscreen.'" allowScriptAccess="always" /> |
---|
| 509 | </object>'); |
---|
| 510 | |
---|
| 511 | // Suppression de la barre de navigation |
---|
| 512 | $template->clear_assign('NAV_BAR'); |
---|
| 513 | // Suppression de la barre de navigation categories (cas de l'affichage des categories recentes) |
---|
| 514 | if (($page['section']) == 'recent_cats') |
---|
| 515 | $template->clear_assign('CATEGORIES'); |
---|
| 516 | } |
---|
| 517 | |
---|
| 518 | } |
---|
| 519 | |
---|
| 520 | |
---|
| 521 | |
---|
| 522 | } |
---|
| 523 | |
---|
| 524 | ?> |
---|