1 | <?php |
---|
2 | /* |
---|
3 | * Plugin Name: CoolIris-Piclens |
---|
4 | * File : piclens.class.php |
---|
5 | */ |
---|
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 |
---|
283 | $tpl_code='<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>'; |
---|
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 | { |
---|
323 | $this->my_config = unserialize($row[0]); |
---|
324 | } |
---|
325 | } |
---|
326 | $this->load_default_config(); |
---|
327 | // Desactivation de piclenswall si PWG Stuff est installe |
---|
328 | $this->my_config['piclens_wall'] = (get_db_plugins('active','PWG_Stuffs') ? false : $this->my_config['piclens_wall']); |
---|
329 | |
---|
330 | // Si tri = defaut PIWIGO ==> l'ordre est egalement defaut PIWIGO |
---|
331 | if ($this->my_config['piclens_order'] == 1) $this->my_config['piclens_sort'] = 1; |
---|
332 | if ($this->my_config['piclens_order_cat'] == 1) $this->my_config['piclens_sort_cat'] = 1; |
---|
333 | |
---|
334 | } |
---|
335 | |
---|
336 | /* Loading of the configuration file - If not exist -> load default values */ |
---|
337 | function load_config_file() |
---|
338 | { |
---|
339 | // changement du nom du fichier de conf. |
---|
340 | if (!file_exists(PICLENS_CFG_FILE)) |
---|
341 | { |
---|
342 | if (file_exists(PICLENS_CFG_FILE_OLD)) |
---|
343 | @rename(PICLENS_CFG_FILE_OLD,PICLENS_CFG_FILE); |
---|
344 | } |
---|
345 | |
---|
346 | $x = @file_get_contents( PICLENS_CFG_FILE ); |
---|
347 | if ($x!==false) |
---|
348 | { |
---|
349 | $c = unserialize($x); |
---|
350 | $this->my_config = $c; |
---|
351 | } |
---|
352 | // Init default value for the config file |
---|
353 | $this->load_default_config(); |
---|
354 | |
---|
355 | // Desactivation de piclenswall si PWG Stuff est installe |
---|
356 | $this->my_config['piclens_wall'] = (get_db_plugins('active','PWG_Stuffs') ? false : $this->my_config['piclens_wall']); |
---|
357 | |
---|
358 | // Si tri = defaut PIWIGO ==> l'ordre est egalement defaut PIWIGO |
---|
359 | if ($this->my_config['piclens_order'] == 1) $this->my_config['piclens_sort'] = 1; |
---|
360 | if ($this->my_config['piclens_order_cat'] == 1) $this->my_config['piclens_sort_cat'] = 1; |
---|
361 | } |
---|
362 | |
---|
363 | /* Saving of the configuration on DB*/ |
---|
364 | function save_config() |
---|
365 | { |
---|
366 | $query = ' |
---|
367 | REPLACE INTO '.CONFIG_TABLE.' |
---|
368 | VALUES( |
---|
369 | \''.PICLENS_CFG_DB.'\', |
---|
370 | \''.serialize($this->my_config).'\', |
---|
371 | \'Configuration de Piclens\') |
---|
372 | ;'; |
---|
373 | |
---|
374 | $result = pwg_query($query); |
---|
375 | |
---|
376 | if($result) |
---|
377 | return true; |
---|
378 | else |
---|
379 | return false; |
---|
380 | |
---|
381 | } |
---|
382 | |
---|
383 | /* Saving of the configuration file with data */ |
---|
384 | function save_config_file() |
---|
385 | { |
---|
386 | $file = fopen( PICLENS_CFG_FILE, 'w' ); |
---|
387 | fwrite($file, serialize($this->my_config) ); |
---|
388 | fclose( $file ); |
---|
389 | } |
---|
390 | |
---|
391 | |
---|
392 | private function load_default_config() |
---|
393 | { |
---|
394 | include PICLENS_INC_PATH.'default_values.inc.php'; |
---|
395 | foreach ($piclens_default_values as $key => $value) |
---|
396 | { |
---|
397 | if (!isset($this->my_config[$key])) $this->my_config[$key] = $value; |
---|
398 | } |
---|
399 | } |
---|
400 | |
---|
401 | function piclens_admin_menu($menu) |
---|
402 | { |
---|
403 | array_push($menu, |
---|
404 | array( |
---|
405 | 'NAME' => 'Cooliris-Piclens', |
---|
406 | 'URL' => get_admin_plugin_menu_link(PICLENS_ADMIN_PATH.'piclens_admin.php') |
---|
407 | ) |
---|
408 | ); |
---|
409 | return $menu; |
---|
410 | } |
---|
411 | |
---|
412 | function piclenswall() |
---|
413 | { |
---|
414 | global $page; |
---|
415 | // piclens active+ activation du mur |
---|
416 | // if ($this->my_config['piclens_active'] && $this->my_config['piclens_wall']) |
---|
417 | if ($this->my_config['piclens_wall']) |
---|
418 | if (isset($page['body_id']) and $page['section'] == 'categories') |
---|
419 | include_once(PICLENS_PATH.'piclenswall.php'); |
---|
420 | } |
---|
421 | |
---|
422 | function piclens_thumbnails() |
---|
423 | { |
---|
424 | global $template, $page; |
---|
425 | |
---|
426 | // piclens active |
---|
427 | if ( isset($page['section']) |
---|
428 | and $this->my_config['piclens_active']) |
---|
429 | { |
---|
430 | |
---|
431 | // Pages speciales et configuration activee |
---|
432 | if ($this->my_config['piclens_wall_spec']) |
---|
433 | { |
---|
434 | // Page images recentes |
---|
435 | if (($page['section']) == 'recent_pics' && $this->my_config['piclens_wall_spec_recentpics']) |
---|
436 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/recent_pics'; |
---|
437 | |
---|
438 | // Page categories recentes |
---|
439 | elseif (($page['section']) == 'recent_cats' && $this->my_config['piclens_wall_spec_recentcats']) |
---|
440 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/recent_cats'; |
---|
441 | |
---|
442 | // Page plus vues |
---|
443 | elseif (($page['section']) == 'most_visited' && $this->my_config['piclens_wall_spec_mostvisited']) |
---|
444 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/most_visited'; |
---|
445 | |
---|
446 | // mieux notees |
---|
447 | else if ($page['section'] == 'best_rated' && $this->my_config['piclens_wall_spec_bestrated']) |
---|
448 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/best_rated'; |
---|
449 | |
---|
450 | // favories |
---|
451 | else if ($page['section'] == 'favorites' && $this->my_config['piclens_wall_spec_favorites']) |
---|
452 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/favorites'; |
---|
453 | else if ($page['section'] == 'tags' && $this->my_config['piclens_wall_spec_tags']) |
---|
454 | { |
---|
455 | $tags = ''; |
---|
456 | foreach ($page['tag_ids'] as $id => $tag) |
---|
457 | $tags .= '/'.$tag.'-'.$page['tags'][''.$id.'']['name']; |
---|
458 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/tags'.$tags; |
---|
459 | } |
---|
460 | } |
---|
461 | // Remplacement de la navigation |
---|
462 | if ($this->my_config['piclens_wall_nav']) |
---|
463 | { |
---|
464 | // Page categories |
---|
465 | if ($page['section'] == 'categories' |
---|
466 | and !empty($page['category']) |
---|
467 | and !empty($page['items'])) |
---|
468 | { |
---|
469 | // verification de presence de la categorie dans la liste parametree |
---|
470 | if (in_array($page['category']['id'], $this->my_config['piclens_wall_cat_nav_replace'])) |
---|
471 | { |
---|
472 | $rssfeed = $this->root_site_piclens.PICLENS_PATH.'piclens-rss.php?/category/'; |
---|
473 | $rssfeed .= empty($page['category']['permalink']) ? $page['category']['id'] : $page['category']['permalink']; |
---|
474 | } |
---|
475 | } |
---|
476 | } |
---|
477 | } |
---|
478 | |
---|
479 | if (isset($rssfeed)) |
---|
480 | { |
---|
481 | if (isset($conf['NO_https']) and $conf['NO_https'] and strncasecmp($rssfeed, 'https://', 8) == 0 ) |
---|
482 | $rssfeed = 'http://' . substr($rssfeed, 8); |
---|
483 | |
---|
484 | $color = $this->my_config['piclens_wall_color']; |
---|
485 | $height = $this->my_config['piclens_wall_height']; |
---|
486 | $showfullscreen = ($this->my_config['piclens_wall_showfullscreen'] ? "true" : "false"); |
---|
487 | $showembed = ($this->my_config['piclens_wall_showembed'] ? "true" : "false"); |
---|
488 | $showsearch = ($this->my_config['piclens_wall_showsearch'] ? "true" : "false"); |
---|
489 | $template->assign('THUMBNAILS', |
---|
490 | '<object id="o" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" |
---|
491 | width="100%" height="'.$this->my_config['piclens_wall_height'].'" > |
---|
492 | <param name="movie" value="' |
---|
493 | // Test si utilisation du fichier flash local. |
---|
494 | .($this->my_config['piclens_wall_swflocal'] ? $this->root_site_piclens.PICLENS_PATH.'swf/cooliris.swf' : 'http://apps.cooliris.com/embed/cooliris.swf') |
---|
495 | .'?feed='.$rssfeed.'&style='.$color.'&showEmbed='.$showembed.'&showFullScreen='.$showfullscreen.'&showSearch='.$showsearch.'" /> |
---|
496 | <param name="allowFullScreen" value="'.$showfullscreen.'" /> |
---|
497 | <param name="showEmbed" value="'.$showembed.'" /> |
---|
498 | <param name="showSearch" value="'.$showsearch.'" /> |
---|
499 | <param name="allowScriptAccess" value="always" />' |
---|
500 | .($this->my_config['piclens_wall_transparent'] |
---|
501 | ? '<param name="wmode" value="transparent" /> |
---|
502 | <embed WMODE="transparent"' |
---|
503 | : '<embed ') |
---|
504 | .'type="application/x-shockwave-flash" src="' |
---|
505 | // Test si utilisation du fichier flash local. |
---|
506 | .($this->my_config['piclens_wall_swflocal'] ? $this->root_site_piclens.PICLENS_PATH.'swf/cooliris.swf' : 'http://apps.cooliris.com/embed/cooliris.swf') |
---|
507 | .'?feed='.$rssfeed.'&style='.$color.'&showEmbed='.$showembed.'&showFullScreen='.$showfullscreen.'&showSearch='.$showsearch.'" width="100%" height="'.$height.'" showEmbed="'.$showembed.'" showSearch="'.$showsearch.'" allowFullScreen="'.$showfullscreen.'" allowScriptAccess="always" /> |
---|
508 | </object>'); |
---|
509 | |
---|
510 | // Suppression de la barre de navigation |
---|
511 | $template->clear_assign('NAV_BAR'); |
---|
512 | // Suppression de la barre de navigation categories (cas de l'affichage des categories recentes) |
---|
513 | if (($page['section']) == 'recent_cats') |
---|
514 | $template->clear_assign('CATEGORIES'); |
---|
515 | } |
---|
516 | |
---|
517 | } |
---|
518 | |
---|
519 | |
---|
520 | |
---|
521 | } |
---|
522 | |
---|
523 | ?> |
---|