source: trunk/admin/configuration.php @ 134

Last change on this file since 134 was 130, checked in by z0rglub, 21 years ago

If we delete a picture which is logically linked to a category, the
informations about this category are not updated (number of pictures and
date of last picture) -> use of update_category( 'all' )

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