source: extensions/piclens/admin/rssfeed.php @ 3536

Last change on this file since 3536 was 3536, checked in by tiico, 15 years ago

Add extended description integration for category name
Correct chinese language
Correct embeded wall title (not show)
Add blank name parameter for image name in the wall
Add/Correct rank order in the rss feed
Add row number parameter for the embeded wall

File size: 7.1 KB
Line 
1<?php
2/*
3 * Plugin Name: CoolIris-Piclens
4 * Version: 0.3.4
5 * Description: Cooliris/Piclens activation
6 * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=234
7 * Author: Tiico
8 * Author URI:
9 * */
10/********* Fichier rssfeed.php  *********/
11
12
13if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
14
15include_once(PICLENS_ADMIN_PATH . 'functions.inc.php');
16
17global $template, $page;
18 
19$me = get_plugin_data($plugin_id);
20
21//$order_list = array('Defaut Piwigo', 'Date de Creation', 'Date d\'ajout', 'Note Moyenne', 'Plus vues', 'Nom du fichier', 'Id', 'Al&eacute;atoire', 'Cat&eacute;gories');
22$order_list = array(l10n('piclens_label_orderPiwigo'), l10n('piclens_label_orderCreDate'), l10n('piclens_label_orderAddDate'), l10n('piclens_label_orderAverage'), l10n('piclens_label_orderBest'), l10n('piclens_label_orderName'), l10n('piclens_label_orderID'), l10n('piclens_label_orderRand'), l10n('piclens_label_orderCat'), l10n('piclens_label_orderRank'));
23//$sort_list = array('Defaut Piwigo', 'Croissant', 'Decroissant');
24$sort_list = array(l10n('piclens_label_sortPiwigo'), l10n('piclens_label_sortUp'), l10n('piclens_label_sortDown'));
25
26//$thumb_list = array('Miniature', 'Normal');
27$thumb_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'));
28//$normal_list = array('Miniature', 'Normal', 'High');
29$normal_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'), l10n('piclens_label_TypeHigh'));
30//$nameformat_list = array('Nom vignette : taille', 'Nom vignette', 'Nom de l\'image');
31$nameformat_list = array(l10n('piclens_label_Name1'), l10n('piclens_label_Name2'), l10n('piclens_label_Name3'), l10n('piclens_label_Name4'));
32//$descformat_list = array('Rien', 'Nom de l\'image', 'Description de l\'image');
33$descformat_list = array(l10n('piclens_label_Desc1'), l10n('piclens_label_Desc2'), l10n('piclens_label_Desc3'));
34 
35 
36$template->set_filenames( array('plugin_admin_content' => PICLENS_ROOT.'/admin/rssfeed.tpl') );
37
38if (isset($_POST['submit'])) { 
39  $me->my_config['piclens_thumb'] = $_POST['piclens_thumb'];
40  $me->my_config['piclens_normal'] = $_POST['piclens_normal'];
41  $me->my_config['piclens_order'] = $_POST['piclens_order'];
42  $me->my_config['piclens_order_cat'] = $_POST['piclens_order_cat'];
43  $me->my_config['piclens_sort'] = $_POST['piclens_sort'];
44  $me->my_config['piclens_sort_cat'] = $_POST['piclens_sort_cat'];
45 
46  $included_file_types = isset($_POST['file_types']) ? 
47                          array_map("mysql_escape_string", $_POST['file_types']) :
48                          array(); 
49  $me->my_config['included_file_types'] = $included_file_types;
50  $me->my_config['piclens_name_image'] = $_POST['piclens_name_image'];
51  $me->my_config['piclens_name_desc'] = $_POST['piclens_name_desc'];
52  $me->my_config['piclens_video'] = isset($_POST['piclens_video']);
53  $me->my_config['piclens_cat_view'] = isset($_POST['piclens_cat_view']);
54
55 
56  if ($me->my_config['piclens_order'] == 1)     // defaut PIWIGO
57        $me->my_config['piclens_sort'] = 1;             // defaut PIWIGO
58  if ($me->my_config['piclens_order_cat'] == 1) // defaut PIWIGO
59        $me->my_config['piclens_sort_cat'] = 1;         // defaut PIWIGO
60
61  $me->save_config();
62  array_push($page['infos'], l10n('piclens_admin_saveOK'));
63       
64}
65// Affichage des coix miniature possibles pour Piclens
66$i=1;
67foreach ( $thumb_list as $order ) //on parcours le tableau
68{
69        $template->append('PlThumb',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_thumb'] == $i ? 'selected' : '')));
70        $i++;   
71}
72//$template->assign('PICLENS_THUMB', $me->my_config['piclens_thumb']);
73
74// Affichage des choix normal possibles pour Piclens
75$i=1;
76foreach ( $normal_list as $order ) //on parcours le tableau
77{
78        $template->append('PlNormal',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_normal'] == $i ? 'selected' : '')));
79        $i++;   
80}
81//$template->assign('PICLENS_NORMAL', $me->my_config['piclens_normal']);
82
83
84// Affichage des tri possibles pour Piclens - HOME (Accueil)
85$i=1;
86foreach ( $order_list as $order ) //on parcours le tableau
87{
88        $template->append('PlOrder',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_order'] == $i ? 'selected' : '')));
89        $i++;   
90}
91//$template->assign('PICLENS_ORDER', $me->my_config['piclens_order']);
92
93// Affichage des tri possibles pour Piclens - CATEGORIES
94$i=1;
95foreach ( $order_list as $order ) //on parcours le tableau
96{
97        $template->append('PlOrderC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_order_cat'] == $i ? 'selected' : '')));
98        $i++;   
99}
100//$template->assign('PICLENS_ORDER_CAT', $me->my_config['piclens_order_cat']);
101
102// Affichage de l'ordre possibles pour Piclens
103$i=1;
104foreach ( $sort_list as $order ) //on parcours le tableau
105{
106        $template->append('PlSort',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort'] == $i ? 'selected' : '')));
107        $i++;   
108}
109//$template->assign('PICLENS_SORT', $me->my_config['piclens_sort']);
110
111// Affichage de l'ordre possibles pour Piclens - CATEGORIES
112$i=1;
113foreach ( $sort_list as $order ) //on parcours le tableau
114{
115        $template->append('PlSortC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort_cat'] == $i ? 'selected' : '')));
116        $i++;   
117}
118//$template->assign('PICLENS_SORT_CAT', $me->my_config['piclens_sort_cat']);
119
120/*ù
121// Selection type de fichier autorise
122$query = '
123  SELECT DISTINCT(tn_ext)
124  FROM '.IMAGES_TABLE.';';
125
126$result = pwg_query($query);
127if (!empty($result)) {
128
129  while ($row = mysql_fetch_assoc($result)) {
130  if (empty($row['tn_ext']))
131        $row['tn_ext']='!NULL!';
132  $template->append(
133      'file_types',
134      array('SELECTED' => (!empty($me->my_config['included_file_types']) && in_array($row['tn_ext'], $me->my_config['included_file_types'] )) ? 'selected' : '',
135            'VALUE' => $row['tn_ext'],
136            'OPTION' => $row['tn_ext']
137           )
138    );
139  }
140}
141*/
142
143// Selection des groupes
144$exts = get_all_exts();
145if (!empty($exts))
146{
147  $template->assign('file_types',  get_html_exts_selection($exts, 'file_types', $me->my_config['included_file_types']));
148}
149
150
151// Affichage des types d'affichage de nom image dans piclens
152$i=1;
153foreach ( $nameformat_list as $order ) //on parcours le tableau
154{
155        $template->append('PlName',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_image'] == $i ? 'selected' : '')));
156        $i++;   
157}
158//$template->assign('PICLENS_NAME_IMAGE', $me->my_config['piclens_name_image']);
159
160// Affichage des types d'affichage de description image dans piclens
161$i=1;
162foreach ( $descformat_list as $order ) //on parcours le tableau
163{
164        $template->append('PlDesc',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_desc'] == $i ? 'selected' : '')));
165        $i++;   
166}
167//$template->assign('PICLENS_NAME_DESC', $me->my_config['piclens_name_desc']);
168
169$template->assign('PICLENS_VIDEO', $me->my_config['piclens_video'] ? 'checked="checked"' : '' );
170$template->assign('PICLENS_CAT_VIEW', $me->my_config['piclens_cat_view'] ? 'checked="checked"' : '' );
171
172$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
173
174?>
Note: See TracBrowser for help on using the repository browser.