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 283 2004-01-17 18:13:12Z 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'; |
---|
244 | foreach ( $conf_infos as $i => $conf_info ) { |
---|
245 | if ( $i > 0 ) $query.= ','; |
---|
246 | else $query.= ' '; |
---|
247 | $query.= $conf_info; |
---|
248 | } |
---|
249 | $query .= ' FROM '.PREFIX_TABLE.'config;'; |
---|
250 | $row = mysql_fetch_array( mysql_query( $query ) ); |
---|
251 | foreach ( $conf_infos as $conf_info ) { |
---|
252 | $$conf_info = $row[$conf_info]; |
---|
253 | } |
---|
254 | |
---|
255 | $query = 'SELECT'; |
---|
256 | foreach ( $default_user_infos as $i => $default_user_info ) { |
---|
257 | if ( $i > 0 ) $query.= ','; |
---|
258 | else $query.= ' '; |
---|
259 | $query.= $default_user_info; |
---|
260 | } |
---|
261 | $query.= ' FROM '.PREFIX_TABLE.'users'; |
---|
262 | $query.= " WHERE username = 'guest'"; |
---|
263 | $query.= ';'; |
---|
264 | $row = mysql_fetch_array( mysql_query( $query ) ); |
---|
265 | foreach ( $default_user_infos as $default_user_info ) { |
---|
266 | $$default_user_info = $row[$default_user_info]; |
---|
267 | } |
---|
268 | } |
---|
269 | //----------------------------------------------------- template initialization |
---|
270 | $sub = $vtp->Open( |
---|
271 | '../template/'.$user['template'].'/admin/configuration.vtp' ); |
---|
272 | |
---|
273 | $tpl = array( 'conf_confirmation','remote_site','delete', |
---|
274 | 'conf_remote_site_delete_info','submit','errors_title' ); |
---|
275 | templatize_array( $tpl, 'lang', $sub ); |
---|
276 | //-------------------------------------------------------------- errors display |
---|
277 | if ( sizeof( $error ) != 0 ) |
---|
278 | { |
---|
279 | $vtp->addSession( $sub, 'errors' ); |
---|
280 | for ( $i = 0; $i < sizeof( $error ); $i++ ) |
---|
281 | { |
---|
282 | $vtp->addSession( $sub, 'li' ); |
---|
283 | $vtp->setVar( $sub, 'li.li', $error[$i] ); |
---|
284 | $vtp->closeSession( $sub, 'li' ); |
---|
285 | } |
---|
286 | $vtp->closeSession( $sub, 'errors' ); |
---|
287 | } |
---|
288 | //-------------------------------------------------------- confirmation display |
---|
289 | if ( count( $error ) == 0 and isset( $_POST['submit'] ) ) |
---|
290 | { |
---|
291 | $vtp->addSession( $sub, 'confirmation' ); |
---|
292 | $vtp->closeSession( $sub, 'confirmation' ); |
---|
293 | } |
---|
294 | //----------------------------------------------------------------- form action |
---|
295 | $form_action = add_session_id( './admin.php?page=configuration' ); |
---|
296 | $vtp->setVar( $sub, 'form_action', $form_action ); |
---|
297 | //------------------------------------------------------- general configuration |
---|
298 | $vtp->addSession( $sub, 'line' ); |
---|
299 | $vtp->addSession( $sub, 'title_line' ); |
---|
300 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_general_title'] ); |
---|
301 | $vtp->closeSession( $sub, 'title_line' ); |
---|
302 | $vtp->closeSession( $sub, 'line' ); |
---|
303 | |
---|
304 | $vtp->addSession( $sub, 'line' ); |
---|
305 | $vtp->addSession( $sub, 'space_line' ); |
---|
306 | $vtp->closeSession( $sub, 'space_line' ); |
---|
307 | $vtp->closeSession( $sub, 'line' ); |
---|
308 | // webmaster name |
---|
309 | $vtp->addSession( $sub, 'line' ); |
---|
310 | $vtp->addSession( $sub, 'param_line' ); |
---|
311 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_webmaster'] ); |
---|
312 | $vtp->addSession( $sub, 'hidden' ); |
---|
313 | $vtp->setVar( $sub, 'hidden.text', $webmaster ); |
---|
314 | $vtp->setVar( $sub, 'hidden.name', 'webmaster' ); |
---|
315 | $vtp->setVar( $sub, 'hidden.value', $webmaster ); |
---|
316 | $vtp->closeSession( $sub, 'hidden' ); |
---|
317 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_webmaster_info'] ); |
---|
318 | $vtp->closeSession( $sub, 'param_line' ); |
---|
319 | $vtp->closeSession( $sub, 'line' ); |
---|
320 | // webmaster mail address |
---|
321 | $vtp->addSession( $sub, 'line' ); |
---|
322 | $vtp->addSession( $sub, 'param_line' ); |
---|
323 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_mail'] ); |
---|
324 | $vtp->addSession( $sub, 'text' ); |
---|
325 | $vtp->setVar( $sub, 'text.name', 'mail_webmaster' ); |
---|
326 | $vtp->setVar( $sub, 'text.value', $mail_webmaster ); |
---|
327 | $vtp->closeSession( $sub, 'text' ); |
---|
328 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_mail_info'] ); |
---|
329 | $vtp->closeSession( $sub, 'param_line' ); |
---|
330 | $vtp->closeSession( $sub, 'line' ); |
---|
331 | // prefix for thumbnails |
---|
332 | $vtp->addSession( $sub, 'line' ); |
---|
333 | $vtp->addSession( $sub, 'param_line' ); |
---|
334 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_prefix'] ); |
---|
335 | $vtp->addSession( $sub, 'text' ); |
---|
336 | $vtp->setVar( $sub, 'text.name', 'prefix_thumbnail' ); |
---|
337 | $vtp->setVar( $sub, 'text.value', $prefix_thumbnail ); |
---|
338 | $vtp->closeSession( $sub, 'text' ); |
---|
339 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_prefix_info'] ); |
---|
340 | $vtp->closeSession( $sub, 'param_line' ); |
---|
341 | $vtp->closeSession( $sub, 'line' ); |
---|
342 | // access type |
---|
343 | $vtp->addSession( $sub, 'line' ); |
---|
344 | $vtp->addSession( $sub, 'param_line' ); |
---|
345 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_access'] ); |
---|
346 | $vtp->addSession( $sub, 'group' ); |
---|
347 | $vtp->addSession( $sub, 'radio' ); |
---|
348 | $vtp->setVar( $sub, 'radio.name', 'access' ); |
---|
349 | $vtp->setVar( $sub, 'radio.value', 'free' ); |
---|
350 | $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_1'] ); |
---|
351 | $checked = ''; |
---|
352 | if ( $access == 'free' ) |
---|
353 | { |
---|
354 | $checked = ' checked="checked"'; |
---|
355 | } |
---|
356 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
357 | $vtp->closeSession( $sub, 'radio' ); |
---|
358 | $vtp->addSession( $sub, 'radio' ); |
---|
359 | $vtp->setVar( $sub, 'radio.name', 'access' ); |
---|
360 | $vtp->setVar( $sub, 'radio.value', 'restricted' ); |
---|
361 | $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_2'] ); |
---|
362 | $checked = ''; |
---|
363 | if ( $access == 'restricted' ) |
---|
364 | { |
---|
365 | $checked = ' checked="checked"'; |
---|
366 | } |
---|
367 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
368 | $vtp->closeSession( $sub, 'radio' ); |
---|
369 | $vtp->closeSession( $sub, 'group' ); |
---|
370 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_access_info'] ); |
---|
371 | $vtp->closeSession( $sub, 'param_line' ); |
---|
372 | $vtp->closeSession( $sub, 'line' ); |
---|
373 | // maximum user number to display in the listbox of identification page |
---|
374 | $vtp->addSession( $sub, 'line' ); |
---|
375 | $vtp->addSession( $sub, 'param_line' ); |
---|
376 | $vtp->setVar( $sub, 'param_line.name', |
---|
377 | $lang['conf_general_max_user_listbox'] ); |
---|
378 | $vtp->addSession( $sub, 'text' ); |
---|
379 | $vtp->setVar( $sub, 'text.name', 'max_user_listbox' ); |
---|
380 | $vtp->setVar( $sub, 'text.value', $max_user_listbox ); |
---|
381 | $vtp->closeSession( $sub, 'text' ); |
---|
382 | $vtp->setVar( $sub, 'param_line.def', |
---|
383 | $lang['conf_general_max_user_listbox_info'] ); |
---|
384 | $vtp->closeSession( $sub, 'param_line' ); |
---|
385 | $vtp->closeSession( $sub, 'line' ); |
---|
386 | // activate log |
---|
387 | $vtp->addSession( $sub, 'line' ); |
---|
388 | $vtp->addSession( $sub, 'param_line' ); |
---|
389 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_log'] ); |
---|
390 | $vtp->addSession( $sub, 'group' ); |
---|
391 | $vtp->addSession( $sub, 'radio' ); |
---|
392 | $vtp->setVar( $sub, 'radio.name', 'log' ); |
---|
393 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
394 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
395 | $checked = ''; |
---|
396 | if ( $log == 'true' ) |
---|
397 | { |
---|
398 | $checked = ' checked="checked"'; |
---|
399 | } |
---|
400 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
401 | $vtp->closeSession( $sub, 'radio' ); |
---|
402 | $vtp->addSession( $sub, 'radio' ); |
---|
403 | $vtp->setVar( $sub, 'radio.name', 'log' ); |
---|
404 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
405 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
406 | $checked = ''; |
---|
407 | if ( $log == 'false' ) |
---|
408 | { |
---|
409 | $checked = ' checked="checked"'; |
---|
410 | } |
---|
411 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
412 | $vtp->closeSession( $sub, 'radio' ); |
---|
413 | $vtp->closeSession( $sub, 'group' ); |
---|
414 | $vtp->setVar( $sub, 'param_line.def', |
---|
415 | $lang['conf_general_log_info'] ); |
---|
416 | $vtp->closeSession( $sub, 'param_line' ); |
---|
417 | $vtp->closeSession( $sub, 'line' ); |
---|
418 | // mail notification for admins |
---|
419 | $vtp->addSession( $sub, 'line' ); |
---|
420 | $vtp->addSession( $sub, 'param_line' ); |
---|
421 | $vtp->setVar( $sub, 'param_line.name', |
---|
422 | $lang['conf_general_mail_notification'] ); |
---|
423 | $vtp->addSession( $sub, 'group' ); |
---|
424 | $vtp->addSession( $sub, 'radio' ); |
---|
425 | $vtp->setVar( $sub, 'radio.name', 'mail_notification' ); |
---|
426 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
427 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
428 | $checked = ''; |
---|
429 | if ( $mail_notification == 'true' ) |
---|
430 | { |
---|
431 | $checked = ' checked="checked"'; |
---|
432 | } |
---|
433 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
434 | $vtp->closeSession( $sub, 'radio' ); |
---|
435 | $vtp->addSession( $sub, 'radio' ); |
---|
436 | $vtp->setVar( $sub, 'radio.name', 'mail_notification' ); |
---|
437 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
438 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
439 | $checked = ''; |
---|
440 | if ( $mail_notification == 'false' ) |
---|
441 | { |
---|
442 | $checked = ' checked="checked"'; |
---|
443 | } |
---|
444 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
445 | $vtp->closeSession( $sub, 'radio' ); |
---|
446 | $vtp->closeSession( $sub, 'group' ); |
---|
447 | $vtp->setVar( $sub, 'param_line.def', |
---|
448 | $lang['conf_general_mail_notification_info'] ); |
---|
449 | $vtp->closeSession( $sub, 'param_line' ); |
---|
450 | $vtp->closeSession( $sub, 'line' ); |
---|
451 | |
---|
452 | $vtp->addSession( $sub, 'line' ); |
---|
453 | $vtp->addSession( $sub, 'space_line' ); |
---|
454 | $vtp->closeSession( $sub, 'space_line' ); |
---|
455 | $vtp->closeSession( $sub, 'line' ); |
---|
456 | //------------------------------------------------------ comments configuration |
---|
457 | $vtp->addSession( $sub, 'line' ); |
---|
458 | $vtp->addSession( $sub, 'title_line' ); |
---|
459 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_comments_title'] ); |
---|
460 | $vtp->closeSession( $sub, 'title_line' ); |
---|
461 | $vtp->closeSession( $sub, 'line' ); |
---|
462 | |
---|
463 | $vtp->addSession( $sub, 'line' ); |
---|
464 | $vtp->addSession( $sub, 'space_line' ); |
---|
465 | $vtp->closeSession( $sub, 'space_line' ); |
---|
466 | $vtp->closeSession( $sub, 'line' ); |
---|
467 | // show comments ? |
---|
468 | $vtp->addSession( $sub, 'line' ); |
---|
469 | $vtp->addSession( $sub, 'param_line' ); |
---|
470 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_show_comments'] ); |
---|
471 | $vtp->addSession( $sub, 'group' ); |
---|
472 | $vtp->addSession( $sub, 'radio' ); |
---|
473 | $vtp->setVar( $sub, 'radio.name', 'show_comments' ); |
---|
474 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
475 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
476 | $checked = ''; |
---|
477 | if ( $show_comments == 'true' ) |
---|
478 | { |
---|
479 | $checked = ' checked="checked"'; |
---|
480 | } |
---|
481 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
482 | $vtp->closeSession( $sub, 'radio' ); |
---|
483 | $vtp->addSession( $sub, 'radio' ); |
---|
484 | $vtp->setVar( $sub, 'radio.name', 'show_comments' ); |
---|
485 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
486 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
487 | $checked = ''; |
---|
488 | if ( $show_comments == 'false' ) |
---|
489 | { |
---|
490 | $checked = ' checked="checked"'; |
---|
491 | } |
---|
492 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
493 | $vtp->closeSession( $sub, 'radio' ); |
---|
494 | $vtp->closeSession( $sub, 'group' ); |
---|
495 | $vtp->setVar( $sub, 'param_line.def', |
---|
496 | $lang['conf_comments_show_comments_info'] ); |
---|
497 | $vtp->closeSession( $sub, 'param_line' ); |
---|
498 | $vtp->closeSession( $sub, 'line' ); |
---|
499 | // coments for all ? true -> guests can post messages |
---|
500 | $vtp->addSession( $sub, 'line' ); |
---|
501 | $vtp->addSession( $sub, 'param_line' ); |
---|
502 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_forall'] ); |
---|
503 | $vtp->addSession( $sub, 'group' ); |
---|
504 | $vtp->addSession( $sub, 'radio' ); |
---|
505 | $vtp->setVar( $sub, 'radio.name', 'comments_forall' ); |
---|
506 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
507 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
508 | $checked = ''; |
---|
509 | if ( $comments_forall == 'true' ) |
---|
510 | { |
---|
511 | $checked = ' checked="checked"'; |
---|
512 | } |
---|
513 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
514 | $vtp->closeSession( $sub, 'radio' ); |
---|
515 | $vtp->addSession( $sub, 'radio' ); |
---|
516 | $vtp->setVar( $sub, 'radio.name', 'comments_forall' ); |
---|
517 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
518 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
519 | $checked = ''; |
---|
520 | if ( $comments_forall == 'false' ) |
---|
521 | { |
---|
522 | $checked = ' checked="checked"'; |
---|
523 | } |
---|
524 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
525 | $vtp->closeSession( $sub, 'radio' ); |
---|
526 | $vtp->closeSession( $sub, 'group' ); |
---|
527 | $vtp->setVar( $sub, 'param_line.def', |
---|
528 | $lang['conf_comments_forall_info'] ); |
---|
529 | $vtp->closeSession( $sub, 'param_line' ); |
---|
530 | $vtp->closeSession( $sub, 'line' ); |
---|
531 | // number of comments per page |
---|
532 | $vtp->addSession( $sub, 'line' ); |
---|
533 | $vtp->addSession( $sub, 'param_line' ); |
---|
534 | $vtp->setVar( $sub, 'param_line.name', |
---|
535 | $lang['conf_comments_comments_number'] ); |
---|
536 | $vtp->addSession( $sub, 'text' ); |
---|
537 | $vtp->setVar( $sub, 'text.name', 'nb_comment_page' ); |
---|
538 | $vtp->setVar( $sub, 'text.value', $nb_comment_page ); |
---|
539 | $vtp->closeSession( $sub, 'text' ); |
---|
540 | $vtp->setVar( $sub, 'param_line.def', |
---|
541 | $lang['conf_comments_comments_number_info'] ); |
---|
542 | $vtp->closeSession( $sub, 'param_line' ); |
---|
543 | $vtp->closeSession( $sub, 'line' ); |
---|
544 | // coments validation |
---|
545 | $vtp->addSession( $sub, 'line' ); |
---|
546 | $vtp->addSession( $sub, 'param_line' ); |
---|
547 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_validation'] ); |
---|
548 | $vtp->addSession( $sub, 'group' ); |
---|
549 | $vtp->addSession( $sub, 'radio' ); |
---|
550 | $vtp->setVar( $sub, 'radio.name', 'comments_validation' ); |
---|
551 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
552 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
553 | $checked = ''; |
---|
554 | if ( $comments_validation == 'true' ) |
---|
555 | { |
---|
556 | $checked = ' checked="checked"'; |
---|
557 | } |
---|
558 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
559 | $vtp->closeSession( $sub, 'radio' ); |
---|
560 | $vtp->addSession( $sub, 'radio' ); |
---|
561 | $vtp->setVar( $sub, 'radio.name', 'comments_validation' ); |
---|
562 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
563 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
564 | $checked = ''; |
---|
565 | if ( $comments_validation == 'false' ) |
---|
566 | { |
---|
567 | $checked = ' checked="checked"'; |
---|
568 | } |
---|
569 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
570 | $vtp->closeSession( $sub, 'radio' ); |
---|
571 | $vtp->closeSession( $sub, 'group' ); |
---|
572 | $vtp->setVar( $sub, 'param_line.def', |
---|
573 | $lang['conf_comments_validation_info'] ); |
---|
574 | $vtp->closeSession( $sub, 'param_line' ); |
---|
575 | $vtp->closeSession( $sub, 'line' ); |
---|
576 | |
---|
577 | $vtp->addSession( $sub, 'line' ); |
---|
578 | $vtp->addSession( $sub, 'space_line' ); |
---|
579 | $vtp->closeSession( $sub, 'space_line' ); |
---|
580 | $vtp->closeSession( $sub, 'line' ); |
---|
581 | //-------------------------------------------------- default user configuration |
---|
582 | $vtp->addSession( $sub, 'line' ); |
---|
583 | $vtp->addSession( $sub, 'title_line' ); |
---|
584 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_default_title'] ); |
---|
585 | $vtp->closeSession( $sub, 'title_line' ); |
---|
586 | $vtp->closeSession( $sub, 'line' ); |
---|
587 | |
---|
588 | $vtp->addSession( $sub, 'line' ); |
---|
589 | $vtp->addSession( $sub, 'space_line' ); |
---|
590 | $vtp->closeSession( $sub, 'space_line' ); |
---|
591 | $vtp->closeSession( $sub, 'line' ); |
---|
592 | // default language |
---|
593 | $vtp->addSession( $sub, 'line' ); |
---|
594 | $vtp->addSession( $sub, 'param_line' ); |
---|
595 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_language'] ); |
---|
596 | $vtp->addSession( $sub, 'select' ); |
---|
597 | $vtp->setVar( $sub, 'select.name', 'language' ); |
---|
598 | $option = get_languages( '../language/' ); |
---|
599 | for ( $i = 0; $i < sizeof( $option ); $i++ ) |
---|
600 | { |
---|
601 | $vtp->addSession( $sub, 'option' ); |
---|
602 | $vtp->setVar( $sub, 'option.option', $option[$i] ); |
---|
603 | if ( $option[$i] == $language ) |
---|
604 | { |
---|
605 | $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); |
---|
606 | } |
---|
607 | $vtp->closeSession( $sub, 'option' ); |
---|
608 | } |
---|
609 | $vtp->closeSession( $sub, 'select' ); |
---|
610 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_language_info'] ); |
---|
611 | $vtp->closeSession( $sub, 'param_line' ); |
---|
612 | $vtp->closeSession( $sub, 'line' ); |
---|
613 | // number of image per row |
---|
614 | $vtp->addSession( $sub, 'line' ); |
---|
615 | $vtp->addSession( $sub, 'param_line' ); |
---|
616 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_image_per_row'] ); |
---|
617 | $vtp->addSession( $sub, 'select' ); |
---|
618 | $vtp->setVar( $sub, 'select.name', 'nb_image_line' ); |
---|
619 | for ( $i = 0; $i < sizeof( $conf['nb_image_row'] ); $i++ ) |
---|
620 | { |
---|
621 | $vtp->addSession( $sub, 'option' ); |
---|
622 | $vtp->setVar( $sub, 'option.option', $conf['nb_image_row'][$i] ); |
---|
623 | if ( $conf['nb_image_row'][$i] == $nb_image_line ) |
---|
624 | { |
---|
625 | $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); |
---|
626 | } |
---|
627 | $vtp->closeSession( $sub, 'option' ); |
---|
628 | } |
---|
629 | $vtp->closeSession( $sub, 'select' ); |
---|
630 | $vtp->setVar( $sub, 'param_line.def', |
---|
631 | $lang['conf_default_nb_image_per_row_info'] ); |
---|
632 | $vtp->closeSession( $sub, 'param_line' ); |
---|
633 | $vtp->closeSession( $sub, 'line' ); |
---|
634 | // number of row per page |
---|
635 | $vtp->addSession( $sub, 'line' ); |
---|
636 | $vtp->addSession( $sub, 'param_line' ); |
---|
637 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_row_per_page'] ); |
---|
638 | $vtp->addSession( $sub, 'select' ); |
---|
639 | $vtp->setVar( $sub, 'select.name', 'nb_line_page' ); |
---|
640 | for ( $i = 0; $i < sizeof( $conf['nb_row_page'] ); $i++ ) |
---|
641 | { |
---|
642 | $vtp->addSession( $sub, 'option' ); |
---|
643 | $vtp->setVar( $sub, 'option.option', $conf['nb_row_page'][$i] ); |
---|
644 | if ( $conf['nb_row_page'][$i] == $nb_line_page ) |
---|
645 | { |
---|
646 | $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); |
---|
647 | } |
---|
648 | $vtp->closeSession( $sub, 'option' ); |
---|
649 | } |
---|
650 | $vtp->closeSession( $sub, 'select' ); |
---|
651 | $vtp->setVar( $sub, 'param_line.def', |
---|
652 | $lang['conf_default_nb_row_per_page_info'] ); |
---|
653 | $vtp->closeSession( $sub, 'param_line' ); |
---|
654 | $vtp->closeSession( $sub, 'line' ); |
---|
655 | // template |
---|
656 | $vtp->addSession( $sub, 'line' ); |
---|
657 | $vtp->addSession( $sub, 'param_line' ); |
---|
658 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_theme'] ); |
---|
659 | $vtp->addSession( $sub, 'select' ); |
---|
660 | $vtp->setVar( $sub, 'select.name', 'template' ); |
---|
661 | $option = get_dirs( '../template' ); |
---|
662 | for ( $i = 0; $i < sizeof( $option ); $i++ ) |
---|
663 | { |
---|
664 | $vtp->addSession( $sub, 'option' ); |
---|
665 | $vtp->setVar( $sub, 'option.option', $option[$i] ); |
---|
666 | if ( $option[$i] == $template ) |
---|
667 | { |
---|
668 | $vtp->setVar( $sub, 'option.selected', ' selected="selected"' ); |
---|
669 | } |
---|
670 | $vtp->closeSession( $sub, 'option' ); |
---|
671 | } |
---|
672 | $vtp->closeSession( $sub, 'select' ); |
---|
673 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_theme_info'] ); |
---|
674 | $vtp->closeSession( $sub, 'param_line' ); |
---|
675 | $vtp->closeSession( $sub, 'line' ); |
---|
676 | // short period time |
---|
677 | $vtp->addSession( $sub, 'line' ); |
---|
678 | $vtp->addSession( $sub, 'param_line' ); |
---|
679 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_short_period'] ); |
---|
680 | $vtp->addSession( $sub, 'text' ); |
---|
681 | $vtp->setVar( $sub, 'text.name', 'short_period' ); |
---|
682 | $vtp->setVar( $sub, 'text.value', $short_period ); |
---|
683 | $vtp->closeSession( $sub, 'text' ); |
---|
684 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_short_period_info']); |
---|
685 | $vtp->closeSession( $sub, 'param_line' ); |
---|
686 | $vtp->closeSession( $sub, 'line' ); |
---|
687 | // long period time |
---|
688 | $vtp->addSession( $sub, 'line' ); |
---|
689 | $vtp->addSession( $sub, 'param_line' ); |
---|
690 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_long_period'] ); |
---|
691 | $vtp->addSession( $sub, 'text' ); |
---|
692 | $vtp->setVar( $sub, 'text.name', 'long_period' ); |
---|
693 | $vtp->setVar( $sub, 'text.value', $long_period ); |
---|
694 | $vtp->closeSession( $sub, 'text' ); |
---|
695 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_long_period_info'] ); |
---|
696 | $vtp->closeSession( $sub, 'param_line' ); |
---|
697 | $vtp->closeSession( $sub, 'line' ); |
---|
698 | // max displayed width |
---|
699 | $vtp->addSession( $sub, 'line' ); |
---|
700 | $vtp->addSession( $sub, 'param_line' ); |
---|
701 | $vtp->setVar( $sub, 'param_line.name', $lang['maxwidth'] ); |
---|
702 | $vtp->addSession( $sub, 'text' ); |
---|
703 | $vtp->setVar( $sub, 'text.name', 'maxwidth' ); |
---|
704 | $vtp->setVar( $sub, 'text.value', $maxwidth ); |
---|
705 | $vtp->closeSession( $sub, 'text' ); |
---|
706 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxwidth_info'] ); |
---|
707 | $vtp->closeSession( $sub, 'param_line' ); |
---|
708 | $vtp->closeSession( $sub, 'line' ); |
---|
709 | // max displayed height |
---|
710 | $vtp->addSession( $sub, 'line' ); |
---|
711 | $vtp->addSession( $sub, 'param_line' ); |
---|
712 | $vtp->setVar( $sub, 'param_line.name', $lang['maxheight'] ); |
---|
713 | $vtp->addSession( $sub, 'text' ); |
---|
714 | $vtp->setVar( $sub, 'text.name', 'maxheight' ); |
---|
715 | $vtp->setVar( $sub, 'text.value', $maxheight ); |
---|
716 | $vtp->closeSession( $sub, 'text' ); |
---|
717 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxheight_info'] ); |
---|
718 | $vtp->closeSession( $sub, 'param_line' ); |
---|
719 | $vtp->closeSession( $sub, 'line' ); |
---|
720 | // expand all categories ? |
---|
721 | $vtp->addSession( $sub, 'line' ); |
---|
722 | $vtp->addSession( $sub, 'param_line' ); |
---|
723 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_expand'] ); |
---|
724 | $vtp->addSession( $sub, 'group' ); |
---|
725 | $vtp->addSession( $sub, 'radio' ); |
---|
726 | $vtp->setVar( $sub, 'radio.name', 'expand' ); |
---|
727 | |
---|
728 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
729 | $checked = ''; |
---|
730 | if ( $expand == 'true' ) |
---|
731 | { |
---|
732 | $checked = ' checked="checked"'; |
---|
733 | } |
---|
734 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
735 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
736 | $vtp->closeSession( $sub, 'radio' ); |
---|
737 | $vtp->addSession( $sub, 'radio' ); |
---|
738 | $vtp->setVar( $sub, 'radio.name', 'expand' ); |
---|
739 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
740 | $checked = ''; |
---|
741 | if ( $expand == 'false' ) |
---|
742 | { |
---|
743 | $checked = ' checked="checked"'; |
---|
744 | } |
---|
745 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
746 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
747 | $vtp->closeSession( $sub, 'radio' ); |
---|
748 | $vtp->closeSession( $sub, 'group' ); |
---|
749 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_expand_info'] ); |
---|
750 | $vtp->closeSession( $sub, 'param_line' ); |
---|
751 | $vtp->closeSession( $sub, 'line' ); |
---|
752 | // show number of comments on thumbnails page |
---|
753 | $vtp->addSession( $sub, 'line' ); |
---|
754 | $vtp->addSession( $sub, 'param_line' ); |
---|
755 | $vtp->setVar( $sub, 'param_line.name', $lang['customize_show_nb_comments'] ); |
---|
756 | $vtp->addSession( $sub, 'group' ); |
---|
757 | $vtp->addSession( $sub, 'radio' ); |
---|
758 | $vtp->setVar( $sub, 'radio.name', 'show_nb_comments' ); |
---|
759 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
760 | $checked = ''; |
---|
761 | if ( $show_nb_comments == 'true' ) |
---|
762 | { |
---|
763 | $checked = ' checked="checked"'; |
---|
764 | } |
---|
765 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
766 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
767 | $vtp->closeSession( $sub, 'radio' ); |
---|
768 | $vtp->addSession( $sub, 'radio' ); |
---|
769 | $vtp->setVar( $sub, 'radio.name', 'show_nb_comments' ); |
---|
770 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
771 | $checked = ''; |
---|
772 | if ( $show_nb_comments == 'false' ) |
---|
773 | { |
---|
774 | $checked = ' checked="checked"'; |
---|
775 | } |
---|
776 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
777 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
778 | $vtp->closeSession( $sub, 'radio' ); |
---|
779 | $vtp->closeSession( $sub, 'group' ); |
---|
780 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_show_nb_comments_info'] ); |
---|
781 | $vtp->closeSession( $sub, 'param_line' ); |
---|
782 | $vtp->closeSession( $sub, 'line' ); |
---|
783 | |
---|
784 | $vtp->addSession( $sub, 'line' ); |
---|
785 | $vtp->addSession( $sub, 'space_line' ); |
---|
786 | $vtp->closeSession( $sub, 'space_line' ); |
---|
787 | $vtp->closeSession( $sub, 'line' ); |
---|
788 | //-------------------------------------------------------- upload configuration |
---|
789 | $vtp->addSession( $sub, 'line' ); |
---|
790 | $vtp->addSession( $sub, 'title_line' ); |
---|
791 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_upload_title'] ); |
---|
792 | $vtp->closeSession( $sub, 'title_line' ); |
---|
793 | $vtp->closeSession( $sub, 'line' ); |
---|
794 | |
---|
795 | $vtp->addSession( $sub, 'line' ); |
---|
796 | $vtp->addSession( $sub, 'space_line' ); |
---|
797 | $vtp->closeSession( $sub, 'space_line' ); |
---|
798 | $vtp->closeSession( $sub, 'line' ); |
---|
799 | // is upload available ? |
---|
800 | $vtp->addSession( $sub, 'line' ); |
---|
801 | $vtp->addSession( $sub, 'param_line' ); |
---|
802 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_available'] ); |
---|
803 | $vtp->addSession( $sub, 'group' ); |
---|
804 | $vtp->addSession( $sub, 'radio' ); |
---|
805 | $vtp->setVar( $sub, 'radio.name', 'upload_available' ); |
---|
806 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
807 | $checked = ''; |
---|
808 | if ( $upload_available == 'true' ) |
---|
809 | { |
---|
810 | $checked = ' checked="checked"'; |
---|
811 | } |
---|
812 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
813 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
814 | $vtp->closeSession( $sub, 'radio' ); |
---|
815 | $vtp->addSession( $sub, 'radio' ); |
---|
816 | $vtp->setVar( $sub, 'radio.name', 'upload_available' ); |
---|
817 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
818 | $checked = ''; |
---|
819 | if ( $upload_available == 'false' ) |
---|
820 | { |
---|
821 | $checked = ' checked="checked"'; |
---|
822 | } |
---|
823 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
824 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
825 | $vtp->closeSession( $sub, 'radio' ); |
---|
826 | $vtp->closeSession( $sub, 'group' ); |
---|
827 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_available_info'] ); |
---|
828 | $vtp->closeSession( $sub, 'param_line' ); |
---|
829 | $vtp->closeSession( $sub, 'line' ); |
---|
830 | // max filesize uploadable |
---|
831 | $vtp->addSession( $sub, 'line' ); |
---|
832 | $vtp->addSession( $sub, 'param_line' ); |
---|
833 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxfilesize'] ); |
---|
834 | $vtp->addSession( $sub, 'text' ); |
---|
835 | $vtp->setVar( $sub, 'text.name', 'upload_maxfilesize' ); |
---|
836 | $vtp->setVar( $sub, 'text.value', $upload_maxfilesize ); |
---|
837 | $vtp->closeSession( $sub, 'text' ); |
---|
838 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxfilesize_info'] ); |
---|
839 | $vtp->closeSession( $sub, 'param_line' ); |
---|
840 | $vtp->closeSession( $sub, 'line' ); |
---|
841 | // maxwidth uploadable |
---|
842 | $vtp->addSession( $sub, 'line' ); |
---|
843 | $vtp->addSession( $sub, 'param_line' ); |
---|
844 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxwidth'] ); |
---|
845 | $vtp->addSession( $sub, 'text' ); |
---|
846 | $vtp->setVar( $sub, 'text.name', 'upload_maxwidth' ); |
---|
847 | $vtp->setVar( $sub, 'text.value', $upload_maxwidth ); |
---|
848 | $vtp->closeSession( $sub, 'text' ); |
---|
849 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxwidth_info'] ); |
---|
850 | $vtp->closeSession( $sub, 'param_line' ); |
---|
851 | $vtp->closeSession( $sub, 'line' ); |
---|
852 | // maxheight uploadable |
---|
853 | $vtp->addSession( $sub, 'line' ); |
---|
854 | $vtp->addSession( $sub, 'param_line' ); |
---|
855 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxheight'] ); |
---|
856 | $vtp->addSession( $sub, 'text' ); |
---|
857 | $vtp->setVar( $sub, 'text.name', 'upload_maxheight' ); |
---|
858 | $vtp->setVar( $sub, 'text.value', $upload_maxheight ); |
---|
859 | $vtp->closeSession( $sub, 'text' ); |
---|
860 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_info'] ); |
---|
861 | $vtp->closeSession( $sub, 'param_line' ); |
---|
862 | $vtp->closeSession( $sub, 'line' ); |
---|
863 | // maxwidth for thumbnail |
---|
864 | $vtp->addSession( $sub, 'line' ); |
---|
865 | $vtp->addSession( $sub, 'param_line' ); |
---|
866 | $vtp->setVar( $sub, 'param_line.name',$lang['conf_upload_maxwidth_thumbnail']); |
---|
867 | $vtp->addSession( $sub, 'text' ); |
---|
868 | $vtp->setVar( $sub, 'text.name', 'upload_maxwidth_thumbnail' ); |
---|
869 | $vtp->setVar( $sub, 'text.value', $upload_maxwidth_thumbnail ); |
---|
870 | $vtp->closeSession( $sub, 'text' ); |
---|
871 | $vtp->setVar($sub,'param_line.def',$lang['conf_upload_maxwidth_thumbnail_info']); |
---|
872 | $vtp->closeSession( $sub, 'param_line' ); |
---|
873 | $vtp->closeSession( $sub, 'line' ); |
---|
874 | // maxheight for thumbnail |
---|
875 | $vtp->addSession( $sub, 'line' ); |
---|
876 | $vtp->addSession( $sub, 'param_line' ); |
---|
877 | $vtp->setVar( $sub,'param_line.name',$lang['conf_upload_maxheight_thumbnail']); |
---|
878 | $vtp->addSession( $sub, 'text' ); |
---|
879 | $vtp->setVar( $sub, 'text.name', 'upload_maxheight_thumbnail' ); |
---|
880 | $vtp->setVar( $sub, 'text.value', $upload_maxheight_thumbnail ); |
---|
881 | $vtp->closeSession( $sub, 'text' ); |
---|
882 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_thumbnail_info']); |
---|
883 | $vtp->closeSession( $sub, 'param_line' ); |
---|
884 | $vtp->closeSession( $sub, 'line' ); |
---|
885 | |
---|
886 | $vtp->addSession( $sub, 'line' ); |
---|
887 | $vtp->addSession( $sub, 'space_line' ); |
---|
888 | $vtp->closeSession( $sub, 'space_line' ); |
---|
889 | $vtp->closeSession( $sub, 'line' ); |
---|
890 | //------------------------------------------------------ sessions configuration |
---|
891 | $vtp->addSession( $sub, 'line' ); |
---|
892 | $vtp->addSession( $sub, 'title_line' ); |
---|
893 | $vtp->setVar( $sub, 'title_line.title', $lang['conf_session_title'] ); |
---|
894 | $vtp->closeSession( $sub, 'title_line' ); |
---|
895 | $vtp->closeSession( $sub, 'line' ); |
---|
896 | |
---|
897 | $vtp->addSession( $sub, 'line' ); |
---|
898 | $vtp->addSession( $sub, 'space_line' ); |
---|
899 | $vtp->closeSession( $sub, 'space_line' ); |
---|
900 | $vtp->closeSession( $sub, 'line' ); |
---|
901 | // authorize cookies ? |
---|
902 | $vtp->addSession( $sub, 'line' ); |
---|
903 | $vtp->addSession( $sub, 'param_line' ); |
---|
904 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_cookie'] ); |
---|
905 | $vtp->addSession( $sub, 'group' ); |
---|
906 | $vtp->addSession( $sub, 'radio' ); |
---|
907 | $vtp->setVar( $sub, 'radio.name', 'authorize_cookies' ); |
---|
908 | $vtp->setVar( $sub, 'radio.value', 'true' ); |
---|
909 | $checked = ''; |
---|
910 | if ( $authorize_cookies == 'true' ) |
---|
911 | { |
---|
912 | $checked = ' checked="checked"'; |
---|
913 | } |
---|
914 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
915 | $vtp->setVar( $sub, 'radio.option', $lang['yes'] ); |
---|
916 | $vtp->closeSession( $sub, 'radio' ); |
---|
917 | $vtp->addSession( $sub, 'radio' ); |
---|
918 | $vtp->setVar( $sub, 'radio.name', 'authorize_cookies' ); |
---|
919 | $vtp->setVar( $sub, 'radio.value', 'false' ); |
---|
920 | $checked = ''; |
---|
921 | if ( $authorize_cookies == 'false' ) |
---|
922 | { |
---|
923 | $checked = ' checked="checked"'; |
---|
924 | } |
---|
925 | $vtp->setVar( $sub, 'radio.checked', $checked ); |
---|
926 | $vtp->setVar( $sub, 'radio.option', $lang['no'] ); |
---|
927 | $vtp->closeSession( $sub, 'radio' ); |
---|
928 | $vtp->closeSession( $sub, 'group' ); |
---|
929 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_cookie_info'] ); |
---|
930 | $vtp->closeSession( $sub, 'param_line' ); |
---|
931 | $vtp->closeSession( $sub, 'line' ); |
---|
932 | // session size |
---|
933 | $vtp->addSession( $sub, 'line' ); |
---|
934 | $vtp->addSession( $sub, 'param_line' ); |
---|
935 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_size'] ); |
---|
936 | $vtp->addSession( $sub, 'text' ); |
---|
937 | $vtp->setVar( $sub, 'text.name', 'session_id_size' ); |
---|
938 | $vtp->setVar( $sub, 'text.value', $session_id_size ); |
---|
939 | $vtp->closeSession( $sub, 'text' ); |
---|
940 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_size_info']); |
---|
941 | $vtp->closeSession( $sub, 'param_line' ); |
---|
942 | $vtp->closeSession( $sub, 'line' ); |
---|
943 | // session length |
---|
944 | $vtp->addSession( $sub, 'line' ); |
---|
945 | $vtp->addSession( $sub, 'param_line' ); |
---|
946 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_time'] ); |
---|
947 | $vtp->addSession( $sub, 'text' ); |
---|
948 | $vtp->setVar( $sub, 'text.name', 'session_time' ); |
---|
949 | $vtp->setVar( $sub, 'text.value', $session_time ); |
---|
950 | $vtp->closeSession( $sub, 'text' ); |
---|
951 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_time_info']); |
---|
952 | $vtp->closeSession( $sub, 'param_line' ); |
---|
953 | $vtp->closeSession( $sub, 'line' ); |
---|
954 | // session keyword |
---|
955 | $vtp->addSession( $sub, 'line' ); |
---|
956 | $vtp->addSession( $sub, 'param_line' ); |
---|
957 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_key'] ); |
---|
958 | $vtp->addSession( $sub, 'text' ); |
---|
959 | $vtp->setVar( $sub, 'text.name', 'session_keyword' ); |
---|
960 | $vtp->setVar( $sub, 'text.value', $session_keyword ); |
---|
961 | $vtp->closeSession( $sub, 'text' ); |
---|
962 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_key_info']); |
---|
963 | $vtp->closeSession( $sub, 'param_line' ); |
---|
964 | $vtp->closeSession( $sub, 'line' ); |
---|
965 | // session deletion |
---|
966 | $vtp->addSession( $sub, 'line' ); |
---|
967 | $vtp->addSession( $sub, 'param_line' ); |
---|
968 | $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_delete'] ); |
---|
969 | $vtp->addSession( $sub, 'check' ); |
---|
970 | $vtp->addSession( $sub, 'box' ); |
---|
971 | $vtp->setVar( $sub, 'box.name', 'empty_session_table' ); |
---|
972 | $vtp->setVar( $sub, 'box.value', '1' ); |
---|
973 | $vtp->setVar( $sub, 'box.checked', ' checked="checked"' ); |
---|
974 | $vtp->closeSession( $sub, 'box' ); |
---|
975 | $vtp->closeSession( $sub, 'check' ); |
---|
976 | $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_delete_info'] ); |
---|
977 | $vtp->closeSession( $sub, 'param_line' ); |
---|
978 | $vtp->closeSession( $sub, 'line' ); |
---|
979 | |
---|
980 | $vtp->addSession( $sub, 'line' ); |
---|
981 | $vtp->addSession( $sub, 'space_line' ); |
---|
982 | $vtp->closeSession( $sub, 'space_line' ); |
---|
983 | $vtp->closeSession( $sub, 'line' ); |
---|
984 | //------------------------------------------------ remote sites administration |
---|
985 | $query = 'select id,galleries_url'; |
---|
986 | $query.= ' from '.PREFIX_TABLE.'sites'; |
---|
987 | $query.= " where galleries_url <> './galleries/';"; |
---|
988 | $result = mysql_query( $query ); |
---|
989 | if ( mysql_num_rows( $result ) > 0 ) |
---|
990 | { |
---|
991 | $vtp->addSession( $sub, 'remote_sites' ); |
---|
992 | $i = 0; |
---|
993 | while ( $row = mysql_fetch_array( $result ) ) |
---|
994 | { |
---|
995 | $vtp->addSession( $sub, 'site' ); |
---|
996 | $vtp->setVar( $sub, 'site.url', $row['galleries_url'] ); |
---|
997 | $vtp->setVar( $sub, 'site.id', $row['id'] ); |
---|
998 | if ( $i == 0 ) |
---|
999 | { |
---|
1000 | $vtp->addSession( $sub, 'rowspan' ); |
---|
1001 | $vtp->setVar( $sub, 'rowspan.nb_sites', mysql_num_rows( $result ) ); |
---|
1002 | $vtp->closeSession( $sub, 'rowspan' ); |
---|
1003 | } |
---|
1004 | $vtp->closeSession( $sub, 'site' ); |
---|
1005 | $i++; |
---|
1006 | } |
---|
1007 | $vtp->closeSession( $sub, 'remote_sites' ); |
---|
1008 | } |
---|
1009 | //----------------------------------------------------------- sending html code |
---|
1010 | $vtp->Parse( $handle , 'sub', $sub ); |
---|
1011 | ?> |
---|