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

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

Add index.php file into directory
Add CHANGELOG and clean header files
Add 'last comments' option for name and descriptions (%ID option)
Add maintain.inc.php for migration to 0.4.x (name and description translation)
Complete Chinese translation (thanks winson)

  • Correct the latests commit (3636 & 3637 were not complete)
File size: 5.7 KB
Line 
1<?php
2/*
3 * Plugin Name: CoolIris-Piclens
4 * File :  rssfeed.php 
5 */
6
7
8if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
9
10include_once(PICLENS_ADMIN_PATH . 'functions.inc.php');
11
12global $template, $page;
13 
14$me = get_plugin_data($plugin_id);
15
16$order_list = array(l10n('piclens_label_orderPiwigo'), l10n('piclens_label_orderCreDate'), l10n('piclens_label_orderAddDate'), l10n('piclens_label_orderRank'), l10n('piclens_label_orderBest'), l10n('piclens_label_orderName'), l10n('piclens_label_orderID'), l10n('piclens_label_orderRand'), l10n('piclens_label_orderCat'));
17$sort_list = array(l10n('piclens_label_sortPiwigo'), l10n('piclens_label_sortUp'), l10n('piclens_label_sortDown'));
18
19$thumb_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'));
20$normal_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'), l10n('piclens_label_TypeHigh'));
21
22//$nameformat_list = array(l10n('piclens_label_Name1'), l10n('piclens_label_Name2'), l10n('piclens_label_Name3'));
23//$descformat_list = array(l10n('piclens_label_Desc1'), l10n('piclens_label_Desc2'), l10n('piclens_label_Desc3'));
24 
25 
26$template->set_filenames( array('plugin_admin_content' => PICLENS_ROOT.'/admin/rssfeed.tpl') );
27
28if (isset($_POST['submit'])) { 
29  $me->my_config['piclens_thumb'] = $_POST['piclens_thumb'];
30  $me->my_config['piclens_normal'] = $_POST['piclens_normal'];
31  $me->my_config['piclens_order'] = $_POST['piclens_order'];
32  $me->my_config['piclens_order_cat'] = $_POST['piclens_order_cat'];
33  $me->my_config['piclens_sort'] = $_POST['piclens_sort'];
34  $me->my_config['piclens_sort_cat'] = $_POST['piclens_sort_cat'];
35 
36  $included_file_types = isset($_POST['file_types']) ? 
37                          array_map("mysql_escape_string", $_POST['file_types']) :
38                          array(); 
39  $me->my_config['included_file_types'] = $included_file_types;
40//  $me->my_config['piclens_name_image'] = $_POST['piclens_name_image'];
41//  $me->my_config['piclens_name_desc'] = $_POST['piclens_name_desc'];
42  $me->my_config['piclens_video'] = isset($_POST['piclens_video']);
43  $me->my_config['piclens_cat_view'] = isset($_POST['piclens_cat_view']);
44
45 
46  if ($me->my_config['piclens_order'] == 1)     // defaut PIWIGO
47        $me->my_config['piclens_sort'] = 1;             // defaut PIWIGO
48  if ($me->my_config['piclens_order_cat'] == 1) // defaut PIWIGO
49        $me->my_config['piclens_sort_cat'] = 1;         // defaut PIWIGO
50
51  $me->my_config['piclens_rss_name'] = $_POST['piclens_rss_name'];
52  $me->my_config['piclens_rss_desc'] = $_POST['piclens_rss_desc'];
53  $me->my_config['piclens_exclude_double'] = isset($_POST['piclens_exclude_double']);
54  $me->my_config['piclens_maxcomment_nb'] = $_POST['piclens_maxcomment_nb'];
55   
56
57
58   
59  $me->save_config();
60  array_push($page['infos'], l10n('piclens_admin_saveOK'));
61       
62}
63// Affichage des coix miniature possibles pour Piclens
64$i=1;
65foreach ( $thumb_list as $order ) //on parcours le tableau
66{
67        $template->append('PlThumb',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_thumb'] == $i ? 'selected' : '')));
68        $i++;   
69}
70
71// Affichage des choix normal possibles pour Piclens
72$i=1;
73foreach ( $normal_list as $order ) //on parcours le tableau
74{
75        $template->append('PlNormal',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_normal'] == $i ? 'selected' : '')));
76        $i++;   
77}
78
79
80// Affichage des tri possibles pour Piclens - HOME (Accueil)
81$i=1;
82foreach ( $order_list as $order ) //on parcours le tableau
83{
84        $template->append('PlOrder',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_order'] == $i ? 'selected' : '')));
85        $i++;   
86}
87
88// Affichage des tri possibles pour Piclens - CATEGORIES
89$i=1;
90foreach ( $order_list as $order ) //on parcours le tableau
91{
92        $template->append('PlOrderC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_order_cat'] == $i ? 'selected' : '')));
93        $i++;   
94}
95
96// Affichage de l'ordre possibles pour Piclens
97$i=1;
98foreach ( $sort_list as $order ) //on parcours le tableau
99{
100        $template->append('PlSort',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort'] == $i ? 'selected' : '')));
101        $i++;   
102}
103//$template->assign('PICLENS_SORT', $me->my_config['piclens_sort']);
104
105// Affichage de l'ordre possibles pour Piclens - CATEGORIES
106$i=1;
107foreach ( $sort_list as $order ) //on parcours le tableau
108{
109        $template->append('PlSortC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort_cat'] == $i ? 'selected' : '')));
110        $i++;   
111}
112
113// Selection des groupes
114$exts = get_all_exts();
115if (!empty($exts))
116{
117  $template->assign('file_types',  get_html_exts_selection($exts, 'file_types', $me->my_config['included_file_types']));
118}
119
120/*
121// Affichage des types d'affichage de nom image dans piclens
122$i=1;
123foreach ( $nameformat_list as $order ) //on parcours le tableau
124{
125        $template->append('PlName',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_image'] == $i ? 'selected' : '')));
126        $i++;   
127}
128
129// Affichage des types d'affichage de description image dans piclens
130$i=1;
131foreach ( $descformat_list as $order ) //on parcours le tableau
132{
133        $template->append('PlDesc',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_desc'] == $i ? 'selected' : '')));
134        $i++;   
135}
136*/
137$template->assign(array(
138        'PICLENS_VIDEO'         =>  $me->my_config['piclens_video'] ? 'checked="checked"' : '',
139        'PICLENS_CAT_VIEW'      => $me->my_config['piclens_cat_view'] ? 'checked="checked"' : '',
140        'PICLENS_RSS_NAME'      => $me->my_config['piclens_rss_name'],
141        'PICLENS_RSS_DESC'      =>  $me->my_config['piclens_rss_desc'],
142        'PICLENS_EXCLUDE_DOUBLE'        =>  $me->my_config['piclens_exclude_double'] ? 'checked="checked"' : '',
143        'PICLENS_MAXCOMMENT_NB'         => $me->my_config['piclens_maxcomment_nb'],
144        ));
145
146
147$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
148
149?>
Note: See TracBrowser for help on using the repository browser.