source: extensions/floPure/Pure_autumn/themeconf.inc.php @ 13450

Last change on this file since 13450 was 10108, checked in by flop25, 14 years ago

Regex changed : use [\s]* instead of [\r\t\n]*

File size: 1.7 KB
Line 
1<?php
2/*
3Theme Name: Pure_autumn
4Version: auto
5Description: Colors of autumn, random sort of colors for thumbnails, "S" blocks... a must have !
6Theme URI: http://fr.piwigo.org/ext/extension_view.php?eid=443
7Author: flop25
8Author URI: http://www.planete-flop.fr
9*/
10
11$themeconf = array(
12  'name'         => 'Pure_autumn',
13  'parent'        => 'Pure_default',
14  'icon_dir'      => 'themes/Pure_default/icon',
15  'mime_icon_dir' => 'themes/Pure_default/icon/mimetypes/',
16  'local_head' => 'local_head.tpl',
17);
18/** mainpage_categories.tpl **/
19add_event_handler('loc_end_index_category_thumbnails', 'Pure_autumn_cat');
20function Pure_autumn_cat($tpl_thumbnails_var)
21{
22    global $template;
23    $template->set_prefilter('index_category_thumbnails', 'Pure_autumn_prefilter_cat');
24                return $tpl_thumbnails_var;
25}
26function Pure_autumn_prefilter_cat($content, &$smarty)
27{
28  $search = '#<li>[\s]*<div class="thumbnailCategory">#';
29 
30  $replacement = '<li class="{cycle values="cat_1,cat_2,cat_3,cat_4"}" >
31        <div class="thumbnailCategory">';
32
33  return preg_replace($search, $replacement, $content);
34}
35
36/** thumbnails.tpl **/
37add_event_handler('loc_end_index_thumbnails', 'Pure_autumn_thumbnails');
38function Pure_autumn_thumbnails($tpl_thumbnails_var)
39{
40    global $template;
41    $template->set_prefilter('index_thumbnails', 'Pure_autumn_prefilter_thumbnails');
42    $template->set_prefilter('stuffs', 'Pure_autumn_prefilter_thumbnails');
43                return $tpl_thumbnails_var;
44}
45
46function Pure_autumn_prefilter_thumbnails($content, &$smarty)
47{
48  $search = '#<li>[\s]*<span class="wrap1">#';
49 
50  $replacement = '<li class="thumb_{"1"|mt_rand:5}"  >
51        <span class="wrap1">';
52
53  return preg_replace($search, $replacement, $content);
54}
55?>
Note: See TracBrowser for help on using the repository browser.