1 | <? |
---|
2 | /*************************************************************************** |
---|
3 | * configuration.php * |
---|
4 | * ------------------- * |
---|
5 | * application : PhpWebGallery 1.3 <http://phpwebgallery.net> * |
---|
6 | * author : Pierrick LE GALL <pierrick@z0rglub.com> * |
---|
7 | * * |
---|
8 | * $Id: configuration.php 304 2004-01-19 22:33:26Z z0rglub $ |
---|
9 | * * |
---|
10 | ***************************************************************************/ |
---|
11 | |
---|
12 | /*************************************************************************** |
---|
13 | * * |
---|
14 | * This program is free software; you can redistribute it and/or modify * |
---|
15 | * it under the terms of the GNU General Public License as published by * |
---|
16 | * the Free Software Foundation; * |
---|
17 | * * |
---|
18 | ***************************************************************************/ |
---|
19 | |
---|
20 | include_once( './include/isadmin.inc.php' ); |
---|
21 | |
---|
22 | $Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A", |
---|
23 | "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A", |
---|
24 | "Æ" => "A", "Ç" => "C", "È" => "E", "É" => "E", |
---|
25 | "Ê" => "E", "Ë" => "E", "Ì" => "I", "Í" => "I", |
---|
26 | "Î" => "I", "Ï" => "I", "Ð" => "D", "Ñ" => "N", |
---|
27 | "Ò" => "O", "Ó" => "O", "Ô" => "O", "Õ" => "O", |
---|
28 | "Ö" => "O", "Ø" => "O", "Ù" => "U", "Ú" => "U", |
---|
29 | "Û" => "U", "Ü" => "U", "Ý" => "Y", "ß" => "s", |
---|
30 | "à" => "a", "á" => "a", "â" => "a", "ã" => "a", |
---|
31 | "ä" => "a", "å" => "a", "æ" => "a", "ç" => "c", |
---|
32 | "è" => "e", "é" => "e", "ê" => "e", "ë" => "e", |
---|
33 | "ì" => "i", "í" => "i", "î" => "i", "ï" => "i", |
---|
34 | "ð" => "o", "ñ" => "n", "ò" => "o", "ó" => "o", |
---|
35 | "ô" => "o", "õ" => "o", "ö" => "o", "ø" => "o", |
---|
36 | "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u", |
---|
37 | "ý" => "y", "ÿ" => "y"); |
---|
38 | //------------------------------ verification and registration of modifications |
---|
39 | $conf_infos = |
---|
40 | array( 'prefix_thumbnail','webmaster','mail_webmaster','access', |
---|
41 | 'session_id_size','session_time','session_keyword','max_user_listbox', |
---|
42 | 'show_comments','nb_comment_page','upload_available', |
---|
43 | 'upload_maxfilesize', 'upload_maxwidth','upload_maxheight', |
---|
44 | 'upload_maxwidth_thumbnail','upload_maxheight_thumbnail','log', |
---|
45 | 'comments_validation','comments_forall','authorize_cookies', |
---|
46 | 'mail_notification' ); |
---|
47 | $default_user_infos = |
---|
48 | array( 'nb_image_line','nb_line_page','language','maxwidth', |
---|
49 | 'maxheight','expand','show_nb_comments','short_period','long_period', |
---|
50 | 'template' ); |
---|
51 | $error = array(); |
---|
52 | if ( isset( $_POST['submit'] ) ) |
---|
53 | { |
---|
54 | $int_pattern = '/^\d+$/'; |
---|
55 | // empty session table if asked |
---|
56 | if ( $_POST['empty_session_table'] == 1 ) |
---|
57 | { |
---|
58 | $query = 'DELETE FROM '.PREFIX_TABLE.'sessions'; |
---|
59 | $query.= ' WHERE expiration < '.time().';'; |
---|
60 | mysql_query( $query ); |
---|
61 | } |
---|
62 | // deletion of site as asked |
---|
63 | $site_deleted = false; |
---|
64 | $query = 'SELECT id'; |
---|
65 | $query.= ' FROM '.PREFIX_TABLE.'sites'; |
---|
66 | $query.= " WHERE galleries_url <> './galleries/';"; |
---|
67 | $result = mysql_query( $query ); |
---|
68 | while ( $row = mysql_fetch_array( $result ) ) |
---|
69 | { |
---|
70 | $site = 'delete_site_'.$row['id']; |
---|
71 | if ( $_POST[$site] == 1 ) |
---|
72 | { |
---|
73 | delete_site( $row['id'] ); |
---|
74 | $site_deleted = true; |
---|
75 | } |
---|
76 | } |
---|
77 | // if any picture of this site were linked to another categories, we have |
---|
78 | // to update the informations of those categories. To make it simple, we |
---|
79 | // just update all the categories |
---|
80 | if ( $site_deleted ) |
---|
81 | { |
---|
82 | update_category( 'all' ); |
---|
83 | synchronize_all_users(); |
---|
84 | } |
---|
85 | // thumbnail prefix must not contain accentuated characters |
---|
86 | $old_prefix = $_POST['prefix_thumbnail']; |
---|
87 | $prefix = strtr( $_POST['prefix_thumbnail'], $Caracs ); |
---|
88 | if ( $old_prefix != $prefix ) |
---|
89 | { |
---|
90 | array_push( $error, $lang['conf_err_prefixe'] ); |
---|
91 | } |
---|
92 | // mail must be formatted as follows : name@server.com |
---|
93 | $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/'; |
---|
94 | if ( !preg_match( $pattern, $_POST['mail_webmaster'] ) ) |
---|
95 | { |
---|
96 | array_push( $error, $lang['conf_err_mail'] ); |
---|
97 | } |
---|
98 | // periods must be integer values, they represents number of days |
---|
99 | if ( !preg_match( $int_pattern, $_POST['short_period'] ) |
---|
100 | or !preg_match( $int_pattern, $_POST['long_period'] ) ) |
---|
101 | { |
---|
102 | array_push( $error, $lang['err_periods'] ); |
---|
103 | } |
---|
104 | else |
---|
105 | { |
---|
106 | // long period must be longer than short period |
---|
107 | if ( $_POST['long_period'] <= $_POST['short_period'] |
---|
108 | or $_POST['short_period'] <= 0 ) |
---|
109 | { |
---|
110 | array_push( $error, $lang['err_periods_2'] ); |
---|
111 | } |
---|
112 | } |
---|
113 | // session_id size must be an integer between 4 and 50 |
---|
114 | if ( !preg_match( $int_pattern, $_POST['session_id_size'] ) |
---|
115 | or $_POST['session_id_size'] < 4 |
---|
116 | or $_POST['session_id_size'] > 50 ) |
---|
117 | { |
---|
118 | array_push( $error, $lang['conf_err_sid_size'] ); |
---|
119 | } |
---|
120 | // session_time must be an integer between 5 and 60, in minutes |
---|
121 | if ( !preg_match( $int_pattern, $_POST['session_time'] ) |
---|
122 | or $_POST['session_time'] < 5 |
---|
123 | or $_POST['session_time'] > 60 ) |
---|
124 | { |
---|
125 | array_push( $error, $lang['conf_err_sid_time'] ); |
---|
126 | } |
---|
127 | // max_user_listbox must be an integer between 0 and 255 included |
---|
128 | if ( !preg_match( $int_pattern, $_POST['max_user_listbox'] ) |
---|
129 | or $_POST['max_user_listbox'] < 0 |
---|
130 | or $_POST['max_user_listbox'] > 255 ) |
---|
131 | { |
---|
132 | array_push( $error, $lang['conf_err_max_user_listbox'] ); |
---|
133 | } |
---|
134 | // the number of comments per page must be an integer between 5 and 50 |
---|
135 | // included |
---|
136 | if ( !preg_match( $int_pattern, $_POST['nb_comment_page'] ) |
---|
137 | or $_POST['nb_comment_page'] < 5 |
---|
138 | or $_POST['nb_comment_page'] > 50 ) |
---|
139 | { |
---|
140 | array_push( $error, $lang['conf_err_comment_number'] ); |
---|
141 | } |
---|
142 | // the maximum upload filesize must be an integer between 10 and 1000 |
---|
143 | if ( !preg_match( $int_pattern, $_POST['upload_maxfilesize'] ) |
---|
144 | or $_POST['upload_maxfilesize'] < 10 |
---|
145 | or $_POST['upload_maxfilesize'] > 1000 ) |
---|
146 | { |
---|
147 | array_push( $error, $lang['conf_err_upload_maxfilesize'] ); |
---|
148 | } |
---|
149 | // the maximum width of uploaded pictures must be an integer superior to |
---|
150 | // 10 |
---|
151 | if ( !preg_match( $int_pattern, $_POST['upload_maxwidth'] ) |
---|
152 | or $_POST['upload_maxwidth'] < 10 ) |
---|
153 | { |
---|
154 | array_push( $error, $lang['conf_err_upload_maxwidth'] ); |
---|
155 | } |
---|
156 | // the maximum height of uploaded pictures must be an integer superior to |
---|
157 | // 10 |
---|
158 | if ( !preg_match( $int_pattern, $_POST['upload_maxheight'] ) |
---|
159 | or $_POST['upload_maxheight'] < 10 ) |
---|
160 | { |
---|
161 | array_push( $error, $lang['conf_err_upload_maxheight'] ); |
---|
162 | } |
---|
163 | // the maximum width of uploaded thumbnails must be an integer superior to |
---|
164 | // 10 |
---|
165 | if ( !preg_match( $int_pattern, $_POST['upload_maxwidth_thumbnail'] ) |
---|
166 | or $_POST['upload_maxwidth_thumbnail'] < 10 ) |
---|
167 | { |
---|
168 | array_push( $error, $lang['conf_err_upload_maxwidth_thumbnail'] ); |
---|
169 | } |
---|
170 | // the maximum width of uploaded thumbnails must be an integer superior to |
---|
171 | // 10 |
---|
172 | if ( !preg_match( $int_pattern, $_POST['upload_maxheight_thumbnail'] ) |
---|
173 | or $_POST['upload_maxheight_thumbnail'] < 10 ) |
---|
174 | { |
---|
175 | array_push( $error, $lang['conf_err_upload_maxheight_thumbnail'] ); |
---|
176 | } |
---|
177 | |
---|
178 | if ( $_POST['maxwidth'] != '' |
---|
179 | and ( !preg_match( $int_pattern, $_POST['maxwidth'] ) |
---|
180 | or $_POST['maxwidth'] < 50 ) ) |
---|
181 | { |
---|
182 | array_push( $error, $lang['err_maxwidth'] ); |
---|
183 | } |
---|
184 | if ( $_POST['maxheight'] |
---|
185 | and ( !preg_match( $int_pattern, $_POST['maxheight'] ) |
---|
186 | or $_POST['maxheight'] < 50 ) ) |
---|
187 | { |
---|
188 | array_push( $error, $lang['err_maxheight'] ); |
---|
189 | } |
---|
190 | // updating configuraiton if no error found |
---|
191 | if ( count( $error ) == 0 ) |
---|
192 | { |
---|
193 | mysql_query( 'DELETE FROM '.PREFIX_TABLE.'config;' ); |
---|
194 | $query = 'INSERT INTO '.PREFIX_TABLE.'config'; |
---|
195 | $query.= ' ('; |
---|
196 | foreach ( $conf_infos as $i => $conf_info ) { |
---|
197 | if ( $i > 0 ) $query.= ','; |
---|
198 | $query.= $conf_info; |
---|
199 | } |
---|
200 | $query.= ')'; |
---|
201 | $query.= ' VALUES'; |
---|
202 | $query.= ' ('; |
---|
203 | foreach ( $conf_infos as $i => $conf_info ) { |
---|
204 | if ( $i > 0 ) $query.= ','; |
---|
205 | if ( $_POST[$conf_info] == '' ) $query.= 'NULL'; |
---|
206 | else $query.= "'".$_POST[$conf_info]."'"; |
---|
207 | } |
---|
208 | $query.= ')'; |
---|
209 | $query.= ';'; |
---|
210 | mysql_query( $query ); |
---|
211 | |
---|
212 | $query = 'UPDATE '.PREFIX_TABLE.'users'; |
---|
213 | $query.= ' SET'; |
---|
214 | foreach ( $default_user_infos as $i => $default_user_info ) { |
---|
215 | if ( $i > 0 ) $query.= ','; |
---|
216 | else $query.= ' '; |
---|
217 | $query.= $default_user_info; |
---|
218 | $query.= ' = '; |
---|
219 | if ( $_POST[$default_user_info] == '' ) |
---|
220 | { |
---|
221 | $query.= 'NULL'; |
---|
222 | } |
---|
223 | else |
---|
224 | { |
---|
225 | $query.= "'".$_POST[$default_user_info]."'"; |
---|
226 | } |
---|
227 | } |
---|
228 | $query.= " WHERE username = 'guest'"; |
---|
229 | $query.= ';'; |
---|
230 | mysql_query( $query ); |
---|
231 | } |
---|
232 | //--------------------------------------------------------- data initialization |
---|
233 | foreach ( $conf_infos as $conf_info ) { |
---|
234 | $$conf_info = $_POST[$conf_info]; |
---|
235 | } |
---|
236 | foreach ( $default_user_infos as $default_user_info ) { |
---|
237 | $$default_user_info = $_POST[$default_user_info]; |
---|
238 | } |
---|
239 | } |
---|
240 | else |
---|
241 | { |
---|
242 | //--------------------------------------------------------- data initialization |
---|
243 | $query = 'SELECT '.implode( ',', $conf_infos ); |
---|
244 | $query .= ' FROM '.PREFIX_TABLE.'config;'; |
---|
245 | $row = mysql_fetch_array( mysql_query( $query ) ); |
---|
246 | foreach ( $conf_infos as $info ) { |
---|
247 | if ( isset( $row[$info] ) ) $$info = $row[$info]; |
---|
248 | else $$info = ''; |
---|
249 | } |
---|
250 | |
---|
251 | $query = 'SELECT '.implode( ',', $default_user_infos ); |
---|
252 | $query.= ' FROM '.PREFIX_TABLE.'users'; |
---|
253 | $query.= " WHERE username = 'guest'"; |
---|
254 | $query.= ';'; |
---|
255 | $row = mysql_fetch_array( mysql_query( $query ) ); |
---|
256 | foreach ( $default_user_infos as $info ) { |
---|
257 | if ( isset( $row[$info] ) ) $$info = $row[$info]; |
---|
258 | else $$info = ''; |
---|
259 | } |
---|
260 | } |
---|
261 | //----------------------------------------------------- template initialization |
---|
262 | $sub = $vtp->Open( |
---|
263 | '../template/'.$user['template'].'/admin/configuration.vtp' ); |
---|
264 | |
---|
265 | $tpl = array( 'conf_confirmation','remote_site','delete', |
---|
266 | 'conf_remote_site_delete_info','submit','errors_title' ); |
---|
267 | templatize_array( $tpl, 'lang', $sub ); |
---|
268 | //-------------------------------------------------------------- errors display |
---|
269 | if ( sizeof( $error ) != 0 ) |
---|
270 | { |
---|
271 | $vtp->addSession( $sub, 'errors' ); |
---|
272 | for ( $i = 0; $i < sizeof( $error ); $i++ ) |
---|
273 | { |
---|
274 | $vtp->addSession( $sub, 'li' ); |
---|
275 | $vtp->setVar( $sub, 'li.li', $error[$i] ); |
---|
276 | $vtp->closeSession( $sub, 'li' ); |
---|
277 | } |
---|
278 | $vtp->closeSession( $sub, 'errors' ); |
---|
279 | } |
---|
280 | //-------------------------------------------------------- confirmation display |
---|
281 | if ( count( $error ) == 0 and isset( $_POST['submit'] ) ) |
---|
282 | { |
---|
283 | $vtp->addSession( $sub, 'confirmation' ); |
---|
284 | $vtp->closeSession( $sub, 'confirmation' ); |
---|
285 | } |
---|
286 | //----------------------------------------------------------------- form action |
---|
287 | $form_action = add_session_id( './admin.php?page=configuration' ); |
---|
288 | $vtp->setVar( $sub, 'form_action', $form_action ); |
---|
289 | //------------------------------------------------------- general configuration |
---|
290 | $vtp->addSession( $sub, 'line' ); |
---|
291 | $vtp->addSession( $sub, 'title_line' ); |
---|
292 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_general_title'] ); |
---|
293 | $vtp->closeSession( $sub, 'title_line' ); |
---|
294 | $vtp->closeSession( $sub, 'line' ); |
---|
295 | |
---|
296 | $vtp->addSession( $sub, 'line' ); |
---|
297 | $vtp->addSession( $sub, 'space_line' ); |
---|
298 | $vtp->closeSession( $sub, 'space_line' ); |
---|
299 | $vtp->closeSession( $sub, 'line' ); |
---|
300 | // webmaster name |
---|
301 | $vtp->addSession( $sub, 'line' ); |
---|
302 | $vtp->addSession( $sub, 'param_line' ); |
---|
303 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_webmaster'] ); |
---|
304 | $vtp->addSession( $sub, 'hidden' ); |
---|
305 | $vtp->setVar( $sub, 'hidden.text', $webmaster ); |
---|
306 | $vtp->setVar( $sub, 'hidden.name', 'webmaster' ); |
---|
307 | $vtp->setVar( $sub, 'hidden.value', $webmaster ); |
---|
308 | $vtp->closeSession( $sub, 'hidden' ); |
---|
309 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_webmaster_info'] ); |
---|
310 | $vtp->closeSession( $sub, 'param_line' ); |
---|
311 | $vtp->closeSession( $sub, 'line' ); |
---|
312 | // webmaster mail address |
---|
313 | $vtp->addSession( $sub, 'line' ); |
---|
314 | $vtp->addSession( $sub, 'param_line' ); |
---|
315 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_mail'] ); |
---|
316 | $vtp->addSession( $sub, 'text' ); |
---|
317 | $vtp->setVar( $sub, 'text.name', 'mail_webmaster' ); |
---|
318 | $vtp->setVar( $sub, 'text.value', $mail_webmaster ); |
---|
319 | $vtp->closeSession( $sub, 'text' ); |
---|
320 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_mail_info'] ); |
---|
321 | $vtp->closeSession( $sub, 'param_line' ); |
---|
322 | $vtp->closeSession( $sub, 'line' ); |
---|
323 | // prefix for thumbnails |
---|
324 | $vtp->addSession( $sub, 'line' ); |
---|
325 | $vtp->addSession( $sub, 'param_line' ); |
---|
326 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_prefix'] ); |
---|
327 | $vtp->addSession( $sub, 'text' ); |
---|
328 | $vtp->setVar( $sub, 'text.name', 'prefix_thumbnail' ); |
---|
329 | $vtp->setVar( $sub, 'text.value', $prefix_thumbnail ); |
---|
330 | $vtp->closeSession( $sub, 'text' ); |
---|
331 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_prefix_info'] ); |
---|
332 | $vtp->closeSession( $sub, 'param_line' ); |
---|
333 | $vtp->closeSession( $sub, 'line' ); |
---|
334 | // access type |
---|
335 | $vtp->addSession( $sub, 'line' ); |
---|
336 | $vtp->addSession( $sub, 'param_line' ); |
---|
337 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_access'] ); |
---|
338 | $vtp->addSession( $sub, 'group' ); |
---|
339 | $vtp->addSession( $sub, 'radio' ); |
---|
340 | $vtp->setVar( $sub, 'radio.name', 'access' ); |
---|
341 | $vtp->setVar( $sub, 'radio.value', 'free' ); |
---|
342 | $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_1'] ); |
---|
343 | $checked = ''; |
---|
344 | if ( $access == 'free' ) |
---|
345 | { |
---|
346 | $checked = ' checked="checked"'; |
---|
347 | } |
---|
348 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
349 | $vtp->closeSession( $sub, 'radio' ); |
---|
350 | $vtp->addSession( $sub, 'radio' ); |
---|
351 | $vtp->setVar( $sub, 'radio.name', 'access' ); |
---|
352 | $vtp->setVar( $sub, 'radio.value', 'restricted' ); |
---|
353 | $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_2'] ); |
---|
354 | $checked = ''; |
---|
355 | if ( $access == 'restricted' ) |
---|
356 | { |
---|
357 | $checked = ' checked="checked"'; |
---|
358 | } |
---|
359 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
360 | $vtp->closeSession( $sub, 'radio' ); |
---|
361 | $vtp->closeSession( $sub, 'group' ); |
---|
362 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_access_info'] ); |
---|
363 | $vtp->closeSession( $sub, 'param_line' ); |
---|
364 | $vtp->closeSession( $sub, 'line' ); |
---|
365 | // maximum user number to display in the listbox of identification page |
---|
366 | $vtp->addSession( $sub, 'line' ); |
---|
367 | $vtp->addSession( $sub, 'param_line' ); |
---|
368 | $vtp->setVar( $sub, 'param_line.name', |
---|
369 | $lang['conf_general_max_user_listbox'] ); |
---|
370 | $vtp->addSession( $sub, 'text' ); |
---|
371 | $vtp->setVar( $sub, 'text.name', 'max_user_listbox' ); |
---|
372 | $vtp->setVar( $sub, 'text.value', $max_user_listbox ); |
---|
373 | $vtp->closeSession( $sub, 'text' ); |
---|
374 | $vtp->setVar( $sub, 'param_line.def', |
---|
375 | $lang['conf_general_max_user_listbox_info'] ); |
---|
376 | $vtp->closeSession( $sub, 'param_line' ); |
---|
377 | $vtp->closeSession( $sub, 'line' ); |
---|
378 | // activate log |
---|
379 | $vtp->addSession( $sub, 'line' ); |
---|
380 | $vtp->addSession( $sub, 'param_line' ); |
---|
381 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_log'] ); |
---|
382 | $vtp->addSession( $sub, 'group' ); |
---|
383 | $vtp->addSession( $sub, 'radio' ); |
---|
384 | $vtp->setVar( $sub, 'radio.name', 'log' ); |
---|
385 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
386 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
387 | $checked = ''; |
---|
388 | if ( $log == 'true' ) |
---|
389 | { |
---|
390 | $checked = ' checked="checked"'; |
---|
391 | } |
---|
392 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
393 | $vtp->closeSession( $sub, 'radio' ); |
---|
394 | $vtp->addSession( $sub, 'radio' ); |
---|
395 | $vtp->setVar( $sub, 'radio.name', 'log' ); |
---|
396 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
397 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
398 | $checked = ''; |
---|
399 | if ( $log == 'false' ) |
---|
400 | { |
---|
401 | $checked = ' checked="checked"'; |
---|
402 | } |
---|
403 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
404 | $vtp->closeSession( $sub, 'radio' ); |
---|
405 | $vtp->closeSession( $sub, 'group' ); |
---|
406 | $vtp->setVar( $sub, 'param_line.def', |
---|
407 | $lang['conf_general_log_info'] ); |
---|
408 | $vtp->closeSession( $sub, 'param_line' ); |
---|
409 | $vtp->closeSession( $sub, 'line' ); |
---|
410 | // mail notification for admins |
---|
411 | $vtp->addSession( $sub, 'line' ); |
---|
412 | $vtp->addSession( $sub, 'param_line' ); |
---|
413 | $vtp->setVar( $sub, 'param_line.name', |
---|
414 | $lang['conf_general_mail_notification'] ); |
---|
415 | $vtp->addSession( $sub, 'group' ); |
---|
416 | $vtp->addSession( $sub, 'radio' ); |
---|
417 | $vtp->setVar( $sub, 'radio.name', 'mail_notification' ); |
---|
418 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
419 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
420 | $checked = ''; |
---|
421 | if ( $mail_notification == 'true' ) |
---|
422 | { |
---|
423 | $checked = ' checked="checked"'; |
---|
424 | } |
---|
425 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
426 | $vtp->closeSession( $sub, 'radio' ); |
---|
427 | $vtp->addSession( $sub, 'radio' ); |
---|
428 | $vtp->setVar( $sub, 'radio.name', 'mail_notification' ); |
---|
429 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
430 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
431 | $checked = ''; |
---|
432 | if ( $mail_notification == 'false' ) |
---|
433 | { |
---|
434 | $checked = ' checked="checked"'; |
---|
435 | } |
---|
436 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
437 | $vtp->closeSession( $sub, 'radio' ); |
---|
438 | $vtp->closeSession( $sub, 'group' ); |
---|
439 | $vtp->setVar( $sub, 'param_line.def', |
---|
440 | $lang['conf_general_mail_notification_info'] ); |
---|
441 | $vtp->closeSession( $sub, 'param_line' ); |
---|
442 | $vtp->closeSession( $sub, 'line' ); |
---|
443 | |
---|
444 | $vtp->addSession( $sub, 'line' ); |
---|
445 | $vtp->addSession( $sub, 'space_line' ); |
---|
446 | $vtp->closeSession( $sub, 'space_line' ); |
---|
447 | $vtp->closeSession( $sub, 'line' ); |
---|
448 | //------------------------------------------------------ comments configuration |
---|
449 | $vtp->addSession( $sub, 'line' ); |
---|
450 | $vtp->addSession( $sub, 'title_line' ); |
---|
451 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_comments_title'] ); |
---|
452 | $vtp->closeSession( $sub, 'title_line' ); |
---|
453 | $vtp->closeSession( $sub, 'line' ); |
---|
454 | |
---|
455 | $vtp->addSession( $sub, 'line' ); |
---|
456 | $vtp->addSession( $sub, 'space_line' ); |
---|
457 | $vtp->closeSession( $sub, 'space_line' ); |
---|
458 | $vtp->closeSession( $sub, 'line' ); |
---|
459 | // show comments ? |
---|
460 | $vtp->addSession( $sub, 'line' ); |
---|
461 | $vtp->addSession( $sub, 'param_line' ); |
---|
462 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_show_comments'] ); |
---|
463 | $vtp->addSession( $sub, 'group' ); |
---|
464 | $vtp->addSession( $sub, 'radio' ); |
---|
465 | $vtp->setVar( $sub, 'radio.name', 'show_comments' ); |
---|
466 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
467 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
468 | $checked = ''; |
---|
469 | if ( $show_comments == 'true' ) |
---|
470 | { |
---|
471 | $checked = ' checked="checked"'; |
---|
472 | } |
---|
473 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
474 | $vtp->closeSession( $sub, 'radio' ); |
---|
475 | $vtp->addSession( $sub, 'radio' ); |
---|
476 | $vtp->setVar( $sub, 'radio.name', 'show_comments' ); |
---|
477 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
478 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
479 | $checked = ''; |
---|
480 | if ( $show_comments == 'false' ) |
---|
481 | { |
---|
482 | $checked = ' checked="checked"'; |
---|
483 | } |
---|
484 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
485 | $vtp->closeSession( $sub, 'radio' ); |
---|
486 | $vtp->closeSession( $sub, 'group' ); |
---|
487 | $vtp->setVar( $sub, 'param_line.def', |
---|
488 | $lang['conf_comments_show_comments_info'] ); |
---|
489 | $vtp->closeSession( $sub, 'param_line' ); |
---|
490 | $vtp->closeSession( $sub, 'line' ); |
---|
491 | // coments for all ? true -> guests can post messages |
---|
492 | $vtp->addSession( $sub, 'line' ); |
---|
493 | $vtp->addSession( $sub, 'param_line' ); |
---|
494 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_forall'] ); |
---|
495 | $vtp->addSession( $sub, 'group' ); |
---|
496 | $vtp->addSession( $sub, 'radio' ); |
---|
497 | $vtp->setVar( $sub, 'radio.name', 'comments_forall' ); |
---|
498 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
499 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
500 | $checked = ''; |
---|
501 | if ( $comments_forall == 'true' ) |
---|
502 | { |
---|
503 | $checked = ' checked="checked"'; |
---|
504 | } |
---|
505 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
506 | $vtp->closeSession( $sub, 'radio' ); |
---|
507 | $vtp->addSession( $sub, 'radio' ); |
---|
508 | $vtp->setVar( $sub, 'radio.name', 'comments_forall' ); |
---|
509 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
510 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
511 | $checked = ''; |
---|
512 | if ( $comments_forall == 'false' ) |
---|
513 | { |
---|
514 | $checked = ' checked="checked"'; |
---|
515 | } |
---|
516 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
517 | $vtp->closeSession( $sub, 'radio' ); |
---|
518 | $vtp->closeSession( $sub, 'group' ); |
---|
519 | $vtp->setVar( $sub, 'param_line.def', |
---|
520 | $lang['conf_comments_forall_info'] ); |
---|
521 | $vtp->closeSession( $sub, 'param_line' ); |
---|
522 | $vtp->closeSession( $sub, 'line' ); |
---|
523 | // number of comments per page |
---|
524 | $vtp->addSession( $sub, 'line' ); |
---|
525 | $vtp->addSession( $sub, 'param_line' ); |
---|
526 | $vtp->setVar( $sub, 'param_line.name', |
---|
527 | $lang['conf_comments_comments_number'] ); |
---|
528 | $vtp->addSession( $sub, 'text' ); |
---|
529 | $vtp->setVar( $sub, 'text.name', 'nb_comment_page' ); |
---|
530 | $vtp->setVar( $sub, 'text.value', $nb_comment_page ); |
---|
531 | $vtp->closeSession( $sub, 'text' ); |
---|
532 | $vtp->setVar( $sub, 'param_line.def', |
---|
533 | $lang['conf_comments_comments_number_info'] ); |
---|
534 | $vtp->closeSession( $sub, 'param_line' ); |
---|
535 | $vtp->closeSession( $sub, 'line' ); |
---|
536 | // coments validation |
---|
537 | $vtp->addSession( $sub, 'line' ); |
---|
538 | $vtp->addSession( $sub, 'param_line' ); |
---|
539 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_validation'] ); |
---|
540 | $vtp->addSession( $sub, 'group' ); |
---|
541 | $vtp->addSession( $sub, 'radio' ); |
---|
542 | $vtp->setVar( $sub, 'radio.name', 'comments_validation' ); |
---|
543 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
544 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
545 | $checked = ''; |
---|
546 | if ( $comments_validation == 'true' ) |
---|
547 | { |
---|
548 | $checked = ' checked="checked"'; |
---|
549 | } |
---|
550 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
551 | $vtp->closeSession( $sub, 'radio' ); |
---|
552 | $vtp->addSession( $sub, 'radio' ); |
---|
553 | $vtp->setVar( $sub, 'radio.name', 'comments_validation' ); |
---|
554 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
555 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
556 | $checked = ''; |
---|
557 | if ( $comments_validation == 'false' ) |
---|
558 | { |
---|
559 | $checked = ' checked="checked"'; |
---|
560 | } |
---|
561 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
562 | $vtp->closeSession( $sub, 'radio' ); |
---|
563 | $vtp->closeSession( $sub, 'group' ); |
---|
564 | $vtp->setVar( $sub, 'param_line.def', |
---|
565 | $lang['conf_comments_validation_info'] ); |
---|
566 | $vtp->closeSession( $sub, 'param_line' ); |
---|
567 | $vtp->closeSession( $sub, 'line' ); |
---|
568 | |
---|
569 | $vtp->addSession( $sub, 'line' ); |
---|
570 | $vtp->addSession( $sub, 'space_line' ); |
---|
571 | $vtp->closeSession( $sub, 'space_line' ); |
---|
572 | $vtp->closeSession( $sub, 'line' ); |
---|
573 | //-------------------------------------------------- default user configuration |
---|
574 | $vtp->addSession( $sub, 'line' ); |
---|
575 | $vtp->addSession( $sub, 'title_line' ); |
---|
576 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_default_title'] ); |
---|
577 | $vtp->closeSession( $sub, 'title_line' ); |
---|
578 | $vtp->closeSession( $sub, 'line' ); |
---|
579 | |
---|
580 | $vtp->addSession( $sub, 'line' ); |
---|
581 | $vtp->addSession( $sub, 'space_line' ); |
---|
582 | $vtp->closeSession( $sub, 'space_line' ); |
---|
583 | $vtp->closeSession( $sub, 'line' ); |
---|
584 | // default language |
---|
585 | $vtp->addSession( $sub, 'line' ); |
---|
586 | $vtp->addSession( $sub, 'param_line' ); |
---|
587 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_language'] ); |
---|
588 | $vtp->addSession( $sub, 'select' ); |
---|
589 | $vtp->setVar( $sub, 'select.name', 'language' ); |
---|
590 | $option = get_languages( '../language/' ); |
---|
591 | for ( $i = 0; $i < sizeof( $option ); $i++ ) |
---|
592 | { |
---|
593 | $vtp->addSession( $sub, 'option' ); |
---|
594 | $vtp->setVar( $sub, 'option.option', $option[$i] ); |
---|
595 | if ( $option[$i] == $language ) |
---|
596 | { |
---|
597 | $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); |
---|
598 | } |
---|
599 | $vtp->closeSession( $sub, 'option' ); |
---|
600 | } |
---|
601 | $vtp->closeSession( $sub, 'select' ); |
---|
602 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_language_info'] ); |
---|
603 | $vtp->closeSession( $sub, 'param_line' ); |
---|
604 | $vtp->closeSession( $sub, 'line' ); |
---|
605 | // number of image per row |
---|
606 | $vtp->addSession( $sub, 'line' ); |
---|
607 | $vtp->addSession( $sub, 'param_line' ); |
---|
608 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_image_per_row'] ); |
---|
609 | $vtp->addSession( $sub, 'select' ); |
---|
610 | $vtp->setVar( $sub, 'select.name', 'nb_image_line' ); |
---|
611 | for ( $i = 0; $i < sizeof( $conf['nb_image_row'] ); $i++ ) |
---|
612 | { |
---|
613 | $vtp->addSession( $sub, 'option' ); |
---|
614 | $vtp->setVar( $sub, 'option.option', $conf['nb_image_row'][$i] ); |
---|
615 | if ( $conf['nb_image_row'][$i] == $nb_image_line ) |
---|
616 | { |
---|
617 | $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); |
---|
618 | } |
---|
619 | $vtp->closeSession( $sub, 'option' ); |
---|
620 | } |
---|
621 | $vtp->closeSession( $sub, 'select' ); |
---|
622 | $vtp->setVar( $sub, 'param_line.def', |
---|
623 | $lang['conf_default_nb_image_per_row_info'] ); |
---|
624 | $vtp->closeSession( $sub, 'param_line' ); |
---|
625 | $vtp->closeSession( $sub, 'line' ); |
---|
626 | // number of row per page |
---|
627 | $vtp->addSession( $sub, 'line' ); |
---|
628 | $vtp->addSession( $sub, 'param_line' ); |
---|
629 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_row_per_page'] ); |
---|
630 | $vtp->addSession( $sub, 'select' ); |
---|
631 | $vtp->setVar( $sub, 'select.name', 'nb_line_page' ); |
---|
632 | for ( $i = 0; $i < sizeof( $conf['nb_row_page'] ); $i++ ) |
---|
633 | { |
---|
634 | $vtp->addSession( $sub, 'option' ); |
---|
635 | $vtp->setVar( $sub, 'option.option', $conf['nb_row_page'][$i] ); |
---|
636 | if ( $conf['nb_row_page'][$i] == $nb_line_page ) |
---|
637 | { |
---|
638 | $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); |
---|
639 | } |
---|
640 | $vtp->closeSession( $sub, 'option' ); |
---|
641 | } |
---|
642 | $vtp->closeSession( $sub, 'select' ); |
---|
643 | $vtp->setVar( $sub, 'param_line.def', |
---|
644 | $lang['conf_default_nb_row_per_page_info'] ); |
---|
645 | $vtp->closeSession( $sub, 'param_line' ); |
---|
646 | $vtp->closeSession( $sub, 'line' ); |
---|
647 | // template |
---|
648 | $vtp->addSession( $sub, 'line' ); |
---|
649 | $vtp->addSession( $sub, 'param_line' ); |
---|
650 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_theme'] ); |
---|
651 | $vtp->addSession( $sub, 'select' ); |
---|
652 | $vtp->setVar( $sub, 'select.name', 'template' ); |
---|
653 | $option = get_dirs( '../template' ); |
---|
654 | for ( $i = 0; $i < sizeof( $option ); $i++ ) |
---|
655 | { |
---|
656 | $vtp->addSession( $sub, 'option' ); |
---|
657 | $vtp->setVar( $sub, 'option.option', $option[$i] ); |
---|
658 | if ( $option[$i] == $template ) |
---|
659 | { |
---|
660 | $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); |
---|
661 | } |
---|
662 | $vtp->closeSession( $sub, 'option' ); |
---|
663 | } |
---|
664 | $vtp->closeSession( $sub, 'select' ); |
---|
665 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_theme_info'] ); |
---|
666 | $vtp->closeSession( $sub, 'param_line' ); |
---|
667 | $vtp->closeSession( $sub, 'line' ); |
---|
668 | // short period time |
---|
669 | $vtp->addSession( $sub, 'line' ); |
---|
670 | $vtp->addSession( $sub, 'param_line' ); |
---|
671 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_short_period'] ); |
---|
672 | $vtp->addSession( $sub, 'text' ); |
---|
673 | $vtp->setVar( $sub, 'text.name', 'short_period' ); |
---|
674 | $vtp->setVar( $sub, 'text.value', $short_period ); |
---|
675 | $vtp->closeSession( $sub, 'text' ); |
---|
676 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_short_period_info']); |
---|
677 | $vtp->closeSession( $sub, 'param_line' ); |
---|
678 | $vtp->closeSession( $sub, 'line' ); |
---|
679 | // long period time |
---|
680 | $vtp->addSession( $sub, 'line' ); |
---|
681 | $vtp->addSession( $sub, 'param_line' ); |
---|
682 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_long_period'] ); |
---|
683 | $vtp->addSession( $sub, 'text' ); |
---|
684 | $vtp->setVar( $sub, 'text.name', 'long_period' ); |
---|
685 | $vtp->setVar( $sub, 'text.value', $long_period ); |
---|
686 | $vtp->closeSession( $sub, 'text' ); |
---|
687 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_long_period_info'] ); |
---|
688 | $vtp->closeSession( $sub, 'param_line' ); |
---|
689 | $vtp->closeSession( $sub, 'line' ); |
---|
690 | // max displayed width |
---|
691 | $vtp->addSession( $sub, 'line' ); |
---|
692 | $vtp->addSession( $sub, 'param_line' ); |
---|
693 | $vtp->setVar( $sub, 'param_line.name', $lang['maxwidth'] ); |
---|
694 | $vtp->addSession( $sub, 'text' ); |
---|
695 | $vtp->setVar( $sub, 'text.name', 'maxwidth' ); |
---|
696 | $vtp->setVar( $sub, 'text.value', $maxwidth ); |
---|
697 | $vtp->closeSession( $sub, 'text' ); |
---|
698 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxwidth_info'] ); |
---|
699 | $vtp->closeSession( $sub, 'param_line' ); |
---|
700 | $vtp->closeSession( $sub, 'line' ); |
---|
701 | // max displayed height |
---|
702 | $vtp->addSession( $sub, 'line' ); |
---|
703 | $vtp->addSession( $sub, 'param_line' ); |
---|
704 | $vtp->setVar( $sub, 'param_line.name', $lang['maxheight'] ); |
---|
705 | $vtp->addSession( $sub, 'text' ); |
---|
706 | $vtp->setVar( $sub, 'text.name', 'maxheight' ); |
---|
707 | $vtp->setVar( $sub, 'text.value', $maxheight ); |
---|
708 | $vtp->closeSession( $sub, 'text' ); |
---|
709 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxheight_info'] ); |
---|
710 | $vtp->closeSession( $sub, 'param_line' ); |
---|
711 | $vtp->closeSession( $sub, 'line' ); |
---|
712 | // expand all categories ? |
---|
713 | $vtp->addSession( $sub, 'line' ); |
---|
714 | $vtp->addSession( $sub, 'param_line' ); |
---|
715 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_expand'] ); |
---|
716 | $vtp->addSession( $sub, 'group' ); |
---|
717 | $vtp->addSession( $sub, 'radio' ); |
---|
718 | $vtp->setVar( $sub, 'radio.name', 'expand' ); |
---|
719 | |
---|
720 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
721 | $checked = ''; |
---|
722 | if ( $expand == 'true' ) |
---|
723 | { |
---|
724 | $checked = ' checked="checked"'; |
---|
725 | } |
---|
726 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
727 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
728 | $vtp->closeSession( $sub, 'radio' ); |
---|
729 | $vtp->addSession( $sub, 'radio' ); |
---|
730 | $vtp->setVar( $sub, 'radio.name', 'expand' ); |
---|
731 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
732 | $checked = ''; |
---|
733 | if ( $expand == 'false' ) |
---|
734 | { |
---|
735 | $checked = ' checked="checked"'; |
---|
736 | } |
---|
737 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
738 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
739 | $vtp->closeSession( $sub, 'radio' ); |
---|
740 | $vtp->closeSession( $sub, 'group' ); |
---|
741 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_expand_info'] ); |
---|
742 | $vtp->closeSession( $sub, 'param_line' ); |
---|
743 | $vtp->closeSession( $sub, 'line' ); |
---|
744 | // show number of comments on thumbnails page |
---|
745 | $vtp->addSession( $sub, 'line' ); |
---|
746 | $vtp->addSession( $sub, 'param_line' ); |
---|
747 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_show_nb_comments'] ); |
---|
748 | $vtp->addSession( $sub, 'group' ); |
---|
749 | $vtp->addSession( $sub, 'radio' ); |
---|
750 | $vtp->setVar( $sub, 'radio.name', 'show_nb_comments' ); |
---|
751 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
752 | $checked = ''; |
---|
753 | if ( $show_nb_comments == 'true' ) |
---|
754 | { |
---|
755 | $checked = ' checked="checked"'; |
---|
756 | } |
---|
757 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
758 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
759 | $vtp->closeSession( $sub, 'radio' ); |
---|
760 | $vtp->addSession( $sub, 'radio' ); |
---|
761 | $vtp->setVar( $sub, 'radio.name', 'show_nb_comments' ); |
---|
762 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
763 | $checked = ''; |
---|
764 | if ( $show_nb_comments == 'false' ) |
---|
765 | { |
---|
766 | $checked = ' checked="checked"'; |
---|
767 | } |
---|
768 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
769 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
770 | $vtp->closeSession( $sub, 'radio' ); |
---|
771 | $vtp->closeSession( $sub, 'group' ); |
---|
772 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_show_nb_comments_info'] ); |
---|
773 | $vtp->closeSession( $sub, 'param_line' ); |
---|
774 | $vtp->closeSession( $sub, 'line' ); |
---|
775 | |
---|
776 | $vtp->addSession( $sub, 'line' ); |
---|
777 | $vtp->addSession( $sub, 'space_line' ); |
---|
778 | $vtp->closeSession( $sub, 'space_line' ); |
---|
779 | $vtp->closeSession( $sub, 'line' ); |
---|
780 | //-------------------------------------------------------- upload configuration |
---|
781 | $vtp->addSession( $sub, 'line' ); |
---|
782 | $vtp->addSession( $sub, 'title_line' ); |
---|
783 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_upload_title'] ); |
---|
784 | $vtp->closeSession( $sub, 'title_line' ); |
---|
785 | $vtp->closeSession( $sub, 'line' ); |
---|
786 | |
---|
787 | $vtp->addSession( $sub, 'line' ); |
---|
788 | $vtp->addSession( $sub, 'space_line' ); |
---|
789 | $vtp->closeSession( $sub, 'space_line' ); |
---|
790 | $vtp->closeSession( $sub, 'line' ); |
---|
791 | // is upload available ? |
---|
792 | $vtp->addSession( $sub, 'line' ); |
---|
793 | $vtp->addSession( $sub, 'param_line' ); |
---|
794 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_available'] ); |
---|
795 | $vtp->addSession( $sub, 'group' ); |
---|
796 | $vtp->addSession( $sub, 'radio' ); |
---|
797 | $vtp->setVar( $sub, 'radio.name', 'upload_available' ); |
---|
798 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
799 | $checked = ''; |
---|
800 | if ( $upload_available == 'true' ) |
---|
801 | { |
---|
802 | $checked = ' checked="checked"'; |
---|
803 | } |
---|
804 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
805 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
806 | $vtp->closeSession( $sub, 'radio' ); |
---|
807 | $vtp->addSession( $sub, 'radio' ); |
---|
808 | $vtp->setVar( $sub, 'radio.name', 'upload_available' ); |
---|
809 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
810 | $checked = ''; |
---|
811 | if ( $upload_available == 'false' ) |
---|
812 | { |
---|
813 | $checked = ' checked="checked"'; |
---|
814 | } |
---|
815 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
816 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
817 | $vtp->closeSession( $sub, 'radio' ); |
---|
818 | $vtp->closeSession( $sub, 'group' ); |
---|
819 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_available_info'] ); |
---|
820 | $vtp->closeSession( $sub, 'param_line' ); |
---|
821 | $vtp->closeSession( $sub, 'line' ); |
---|
822 | // max filesize uploadable |
---|
823 | $vtp->addSession( $sub, 'line' ); |
---|
824 | $vtp->addSession( $sub, 'param_line' ); |
---|
825 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxfilesize'] ); |
---|
826 | $vtp->addSession( $sub, 'text' ); |
---|
827 | $vtp->setVar( $sub, 'text.name', 'upload_maxfilesize' ); |
---|
828 | $vtp->setVar( $sub, 'text.value', $upload_maxfilesize ); |
---|
829 | $vtp->closeSession( $sub, 'text' ); |
---|
830 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxfilesize_info'] ); |
---|
831 | $vtp->closeSession( $sub, 'param_line' ); |
---|
832 | $vtp->closeSession( $sub, 'line' ); |
---|
833 | // maxwidth uploadable |
---|
834 | $vtp->addSession( $sub, 'line' ); |
---|
835 | $vtp->addSession( $sub, 'param_line' ); |
---|
836 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxwidth'] ); |
---|
837 | $vtp->addSession( $sub, 'text' ); |
---|
838 | $vtp->setVar( $sub, 'text.name', 'upload_maxwidth' ); |
---|
839 | $vtp->setVar( $sub, 'text.value', $upload_maxwidth ); |
---|
840 | $vtp->closeSession( $sub, 'text' ); |
---|
841 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxwidth_info'] ); |
---|
842 | $vtp->closeSession( $sub, 'param_line' ); |
---|
843 | $vtp->closeSession( $sub, 'line' ); |
---|
844 | // maxheight uploadable |
---|
845 | $vtp->addSession( $sub, 'line' ); |
---|
846 | $vtp->addSession( $sub, 'param_line' ); |
---|
847 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxheight'] ); |
---|
848 | $vtp->addSession( $sub, 'text' ); |
---|
849 | $vtp->setVar( $sub, 'text.name', 'upload_maxheight' ); |
---|
850 | $vtp->setVar( $sub, 'text.value', $upload_maxheight ); |
---|
851 | $vtp->closeSession( $sub, 'text' ); |
---|
852 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_info'] ); |
---|
853 | $vtp->closeSession( $sub, 'param_line' ); |
---|
854 | $vtp->closeSession( $sub, 'line' ); |
---|
855 | // maxwidth for thumbnail |
---|
856 | $vtp->addSession( $sub, 'line' ); |
---|
857 | $vtp->addSession( $sub, 'param_line' ); |
---|
858 | $vtp->setVar( $sub, 'param_line.name',$lang['conf_upload_maxwidth_thumbnail']); |
---|
859 | $vtp->addSession( $sub, 'text' ); |
---|
860 | $vtp->setVar( $sub, 'text.name', 'upload_maxwidth_thumbnail' ); |
---|
861 | $vtp->setVar( $sub, 'text.value', $upload_maxwidth_thumbnail ); |
---|
862 | $vtp->closeSession( $sub, 'text' ); |
---|
863 | $vtp->setVar($sub,'param_line.def',$lang['conf_upload_maxwidth_thumbnail_info']); |
---|
864 | $vtp->closeSession( $sub, 'param_line' ); |
---|
865 | $vtp->closeSession( $sub, 'line' ); |
---|
866 | // maxheight for thumbnail |
---|
867 | $vtp->addSession( $sub, 'line' ); |
---|
868 | $vtp->addSession( $sub, 'param_line' ); |
---|
869 | $vtp->setVar( $sub,'param_line.name',$lang['conf_upload_maxheight_thumbnail']); |
---|
870 | $vtp->addSession( $sub, 'text' ); |
---|
871 | $vtp->setVar( $sub, 'text.name', 'upload_maxheight_thumbnail' ); |
---|
872 | $vtp->setVar( $sub, 'text.value', $upload_maxheight_thumbnail ); |
---|
873 | $vtp->closeSession( $sub, 'text' ); |
---|
874 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_thumbnail_info']); |
---|
875 | $vtp->closeSession( $sub, 'param_line' ); |
---|
876 | $vtp->closeSession( $sub, 'line' ); |
---|
877 | |
---|
878 | $vtp->addSession( $sub, 'line' ); |
---|
879 | $vtp->addSession( $sub, 'space_line' ); |
---|
880 | $vtp->closeSession( $sub, 'space_line' ); |
---|
881 | $vtp->closeSession( $sub, 'line' ); |
---|
882 | //------------------------------------------------------ sessions configuration |
---|
883 | $vtp->addSession( $sub, 'line' ); |
---|
884 | $vtp->addSession( $sub, 'title_line' ); |
---|
885 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_session_title'] ); |
---|
886 | $vtp->closeSession( $sub, 'title_line' ); |
---|
887 | $vtp->closeSession( $sub, 'line' ); |
---|
888 | |
---|
889 | $vtp->addSession( $sub, 'line' ); |
---|
890 | $vtp->addSession( $sub, 'space_line' ); |
---|
891 | $vtp->closeSession( $sub, 'space_line' ); |
---|
892 | $vtp->closeSession( $sub, 'line' ); |
---|
893 | // authorize cookies ? |
---|
894 | $vtp->addSession( $sub, 'line' ); |
---|
895 | $vtp->addSession( $sub, 'param_line' ); |
---|
896 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_cookie'] ); |
---|
897 | $vtp->addSession( $sub, 'group' ); |
---|
898 | $vtp->addSession( $sub, 'radio' ); |
---|
899 | $vtp->setVar( $sub, 'radio.name', 'authorize_cookies' ); |
---|
900 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
901 | $checked = ''; |
---|
902 | if ( $authorize_cookies == 'true' ) |
---|
903 | { |
---|
904 | $checked = ' checked="checked"'; |
---|
905 | } |
---|
906 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
907 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
908 | $vtp->closeSession( $sub, 'radio' ); |
---|
909 | $vtp->addSession( $sub, 'radio' ); |
---|
910 | $vtp->setVar( $sub, 'radio.name', 'authorize_cookies' ); |
---|
911 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
912 | $checked = ''; |
---|
913 | if ( $authorize_cookies == 'false' ) |
---|
914 | { |
---|
915 | $checked = ' checked="checked"'; |
---|
916 | } |
---|
917 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
918 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
919 | $vtp->closeSession( $sub, 'radio' ); |
---|
920 | $vtp->closeSession( $sub, 'group' ); |
---|
921 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_cookie_info'] ); |
---|
922 | $vtp->closeSession( $sub, 'param_line' ); |
---|
923 | $vtp->closeSession( $sub, 'line' ); |
---|
924 | // session size |
---|
925 | $vtp->addSession( $sub, 'line' ); |
---|
926 | $vtp->addSession( $sub, 'param_line' ); |
---|
927 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_size'] ); |
---|
928 | $vtp->addSession( $sub, 'text' ); |
---|
929 | $vtp->setVar( $sub, 'text.name', 'session_id_size' ); |
---|
930 | $vtp->setVar( $sub, 'text.value', $session_id_size ); |
---|
931 | $vtp->closeSession( $sub, 'text' ); |
---|
932 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_size_info']); |
---|
933 | $vtp->closeSession( $sub, 'param_line' ); |
---|
934 | $vtp->closeSession( $sub, 'line' ); |
---|
935 | // session length |
---|
936 | $vtp->addSession( $sub, 'line' ); |
---|
937 | $vtp->addSession( $sub, 'param_line' ); |
---|
938 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_time'] ); |
---|
939 | $vtp->addSession( $sub, 'text' ); |
---|
940 | $vtp->setVar( $sub, 'text.name', 'session_time' ); |
---|
941 | $vtp->setVar( $sub, 'text.value', $session_time ); |
---|
942 | $vtp->closeSession( $sub, 'text' ); |
---|
943 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_time_info']); |
---|
944 | $vtp->closeSession( $sub, 'param_line' ); |
---|
945 | $vtp->closeSession( $sub, 'line' ); |
---|
946 | // session keyword |
---|
947 | $vtp->addSession( $sub, 'line' ); |
---|
948 | $vtp->addSession( $sub, 'param_line' ); |
---|
949 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_key'] ); |
---|
950 | $vtp->addSession( $sub, 'text' ); |
---|
951 | $vtp->setVar( $sub, 'text.name', 'session_keyword' ); |
---|
952 | $vtp->setVar( $sub, 'text.value', $session_keyword ); |
---|
953 | $vtp->closeSession( $sub, 'text' ); |
---|
954 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_key_info']); |
---|
955 | $vtp->closeSession( $sub, 'param_line' ); |
---|
956 | $vtp->closeSession( $sub, 'line' ); |
---|
957 | // session deletion |
---|
958 | $vtp->addSession( $sub, 'line' ); |
---|
959 | $vtp->addSession( $sub, 'param_line' ); |
---|
960 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_delete'] ); |
---|
961 | $vtp->addSession( $sub, 'check' ); |
---|
962 | $vtp->addSession( $sub, 'box' ); |
---|
963 | $vtp->setVar( $sub, 'box.name', 'empty_session_table' ); |
---|
964 | $vtp->setVar( $sub, 'box.value', '1' ); |
---|
965 | $vtp->setVar( $sub, 'box.checked', ' checked="checked"' ); |
---|
966 | $vtp->closeSession( $sub, 'box' ); |
---|
967 | $vtp->closeSession( $sub, 'check' ); |
---|
968 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_delete_info'] ); |
---|
969 | $vtp->closeSession( $sub, 'param_line' ); |
---|
970 | $vtp->closeSession( $sub, 'line' ); |
---|
971 | |
---|
972 | $vtp->addSession( $sub, 'line' ); |
---|
973 | $vtp->addSession( $sub, 'space_line' ); |
---|
974 | $vtp->closeSession( $sub, 'space_line' ); |
---|
975 | $vtp->closeSession( $sub, 'line' ); |
---|
976 | //------------------------------------------------ remote sites administration |
---|
977 | $query = 'select id,galleries_url'; |
---|
978 | $query.= ' from '.PREFIX_TABLE.'sites'; |
---|
979 | $query.= " where galleries_url <> './galleries/';"; |
---|
980 | $result = mysql_query( $query ); |
---|
981 | if ( mysql_num_rows( $result ) > 0 ) |
---|
982 | { |
---|
983 | $vtp->addSession( $sub, 'remote_sites' ); |
---|
984 | $i = 0; |
---|
985 | while ( $row = mysql_fetch_array( $result ) ) |
---|
986 | { |
---|
987 | $vtp->addSession( $sub, 'site' ); |
---|
988 | $vtp->setVar( $sub, 'site.url', $row['galleries_url'] ); |
---|
989 | $vtp->setVar( $sub, 'site.id', $row['id'] ); |
---|
990 | if ( $i == 0 ) |
---|
991 | { |
---|
992 | $vtp->addSession( $sub, 'rowspan' ); |
---|
993 | $vtp->setVar( $sub, 'rowspan.nb_sites', mysql_num_rows( $result ) ); |
---|
994 | $vtp->closeSession( $sub, 'rowspan' ); |
---|
995 | } |
---|
996 | $vtp->closeSession( $sub, 'site' ); |
---|
997 | $i++; |
---|
998 | } |
---|
999 | $vtp->closeSession( $sub, 'remote_sites' ); |
---|
1000 | } |
---|
1001 | //----------------------------------------------------------- sending html code |
---|
1002 | $vtp->Parse( $handle , 'sub', $sub ); |
---|
1003 | ?> |
---|