1 | <?php |
---|
2 | /* |
---|
3 | Theme Name: Pure_autumn |
---|
4 | Version: auto |
---|
5 | Description: Colors of autumn, random sort of colors for thumbnails, "S" blocks... a must have ! |
---|
6 | Theme URI: http://fr.piwigo.org/ext/extension_view.php?eid=443 |
---|
7 | Author: flop25 |
---|
8 | Author 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 **/ |
---|
19 | add_event_handler('loc_end_index_category_thumbnails', 'Pure_autumn_cat'); |
---|
20 | function 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 | } |
---|
26 | function 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 **/ |
---|
37 | add_event_handler('loc_end_index_thumbnails', 'Pure_autumn_thumbnails'); |
---|
38 | function 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 | |
---|
46 | function 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 | ?> |
---|