source: trunk/admin/configuration.php @ 364

Last change on this file since 364 was 364, checked in by gweltas, 20 years ago

Split of langage files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 38.6 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// |                           configuration.php                           |
4// +-----------------------------------------------------------------------+
5// | application   : PhpWebGallery <http://phpwebgallery.net>              |
6// | branch        : BSF (Best So Far)                                     |
7// +-----------------------------------------------------------------------+
8// | file          : $RCSfile$
9// | last update   : $Date: 2004-02-19 00:31:09 +0000 (Thu, 19 Feb 2004) $
10// | last modifier : $Author: gweltas $
11// | revision      : $Revision: 364 $
12// +-----------------------------------------------------------------------+
13// | This program is free software; you can redistribute it and/or modify  |
14// | it under the terms of the GNU General Public License as published by  |
15// | the Free Software Foundation                                          |
16// |                                                                       |
17// | This program is distributed in the hope that it will be useful, but   |
18// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
19// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
20// | General Public License for more details.                              |
21// |                                                                       |
22// | You should have received a copy of the GNU General Public License     |
23// | along with this program; if not, write to the Free Software           |
24// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
25// | USA.                                                                  |
26// +-----------------------------------------------------------------------+
27
28include_once( './admin/include/isadmin.inc.php' );
29       
30$Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A", 
31                "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A", 
32                "Æ" => "A", "Ç" => "C", "È" => "E", "É" => "E", 
33                "Ê" => "E", "Ë" => "E", "Ì" => "I", "Í" => "I", 
34                "Î" => "I", "Ï" => "I", "Ð" => "D", "Ñ" => "N", 
35                "Ò" => "O", "Ó" => "O", "Ô" => "O", "Õ" => "O", 
36                "Ö" => "O", "Ø" => "O", "Ù" => "U", "Ú" => "U", 
37                "Û" => "U", "Ü" => "U", "Ý" => "Y", "ß" => "s", 
38                "à" => "a", "á" => "a", "â" => "a", "ã" => "a", 
39                "ä" => "a", "å" => "a", "æ" => "a", "ç" => "c", 
40                "è" => "e", "é" => "e", "ê" => "e", "ë" => "e", 
41                "ì" => "i", "í" => "i", "î" => "i", "ï" => "i", 
42                "ð" => "o", "ñ" => "n", "ò" => "o", "ó" => "o", 
43                "ô" => "o", "õ" => "o", "ö" => "o", "ø" => "o", 
44                "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u", 
45                "ý" => "y", "ÿ" => "y");
46//------------------------------ verification and registration of modifications
47$conf_infos =
48array( 'prefix_thumbnail','webmaster','mail_webmaster','access',
49       'session_id_size','session_time','session_keyword','max_user_listbox',
50       'show_comments','nb_comment_page','upload_available',
51       'upload_maxfilesize', 'upload_maxwidth','upload_maxheight',
52       'upload_maxwidth_thumbnail','upload_maxheight_thumbnail','log',
53       'comments_validation','comments_forall','authorize_cookies',
54       'mail_notification' );
55$default_user_infos =
56array( 'nb_image_line','nb_line_page','language','maxwidth',
57       'maxheight','expand','show_nb_comments','short_period','long_period',
58       'template' );
59$error = array();
60if ( isset( $_POST['submit'] ) )
61{
62  $int_pattern = '/^\d+$/';
63  // empty session table if asked
64  if ( $_POST['empty_session_table'] == 1 )
65  {
66    $query = 'DELETE FROM '.PREFIX_TABLE.'sessions';
67    $query.= ' WHERE expiration < '.time().';';
68    mysql_query( $query );
69  }
70  // deletion of site as asked
71  $site_deleted = false;
72  $query = 'SELECT id';
73  $query.= ' FROM '.PREFIX_TABLE.'sites';
74  $query.= " WHERE galleries_url <> './galleries/';";
75  $result = mysql_query( $query );
76  while ( $row = mysql_fetch_array( $result ) )
77  {
78    $site = 'delete_site_'.$row['id'];
79    if ( $_POST[$site] == 1 )
80    {
81      delete_site( $row['id'] );
82      $site_deleted = true;
83    }
84  }
85  // if any picture of this site were linked to another categories, we have
86  // to update the informations of those categories. To make it simple, we
87  // just update all the categories
88  if ( $site_deleted )
89  {
90    update_category( 'all' );
91    synchronize_all_users();
92  }
93  // thumbnail prefix must not contain accentuated characters
94  $old_prefix = $_POST['prefix_thumbnail'];
95  $prefix = strtr( $_POST['prefix_thumbnail'], $Caracs );
96  if ( $old_prefix != $prefix )
97  {
98    array_push( $error, $lang['conf_err_prefixe'] );
99  }
100  // mail must be formatted as follows : name@server.com
101  $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/';
102  if ( !preg_match( $pattern, $_POST['mail_webmaster'] ) )
103  {
104    array_push( $error, $lang['conf_err_mail'] );
105  }
106  // periods must be integer values, they represents number of days
107  if ( !preg_match( $int_pattern, $_POST['short_period'] )
108       or !preg_match( $int_pattern, $_POST['long_period'] ) )
109  {
110    array_push( $error, $lang['err_periods'] );
111  }
112  else
113  {
114    // long period must be longer than short period
115    if ( $_POST['long_period'] <= $_POST['short_period']
116         or $_POST['short_period'] <= 0 )
117    {
118      array_push( $error, $lang['err_periods_2'] );
119    }
120  }
121  // session_id size must be an integer between 4 and 50
122  if ( !preg_match( $int_pattern, $_POST['session_id_size'] )
123       or $_POST['session_id_size'] < 4
124       or $_POST['session_id_size'] > 50 )
125  {
126    array_push( $error, $lang['conf_err_sid_size'] );
127  }
128  // session_time must be an integer between 5 and 60, in minutes
129  if ( !preg_match( $int_pattern, $_POST['session_time'] )
130       or $_POST['session_time'] < 5
131       or $_POST['session_time'] > 60 )
132  {
133    array_push( $error, $lang['conf_err_sid_time'] );
134  }
135  // max_user_listbox must be an integer between 0 and 255 included
136  if ( !preg_match( $int_pattern, $_POST['max_user_listbox'] )
137       or $_POST['max_user_listbox'] < 0
138       or $_POST['max_user_listbox'] > 255 )
139  {
140    array_push( $error, $lang['conf_err_max_user_listbox'] );
141  }
142  // the number of comments per page must be an integer between 5 and 50
143  // included
144  if ( !preg_match( $int_pattern, $_POST['nb_comment_page'] )
145       or $_POST['nb_comment_page'] < 5
146       or $_POST['nb_comment_page'] > 50 )
147  {
148    array_push( $error, $lang['conf_err_comment_number'] );
149  }
150  // the maximum upload filesize must be an integer between 10 and 1000
151  if ( !preg_match( $int_pattern, $_POST['upload_maxfilesize'] )
152       or $_POST['upload_maxfilesize'] < 10
153       or $_POST['upload_maxfilesize'] > 1000 )
154  {
155    array_push( $error, $lang['conf_err_upload_maxfilesize'] );
156  }
157  // the maximum width of uploaded pictures must be an integer superior to
158  // 10
159  if ( !preg_match( $int_pattern, $_POST['upload_maxwidth'] )
160       or $_POST['upload_maxwidth'] < 10 )
161  {
162    array_push( $error, $lang['conf_err_upload_maxwidth'] );
163  }
164  // the maximum height  of uploaded pictures must be an integer superior to
165  // 10
166  if ( !preg_match( $int_pattern, $_POST['upload_maxheight'] )
167       or $_POST['upload_maxheight'] < 10 )
168  {
169    array_push( $error, $lang['conf_err_upload_maxheight'] );
170  }
171  // the maximum width of uploaded thumbnails must be an integer superior to
172  // 10
173  if ( !preg_match( $int_pattern, $_POST['upload_maxwidth_thumbnail'] )
174       or $_POST['upload_maxwidth_thumbnail'] < 10 )
175  {
176    array_push( $error, $lang['conf_err_upload_maxwidth_thumbnail'] );
177  }
178  // the maximum width of uploaded thumbnails must be an integer superior to
179  // 10
180  if ( !preg_match( $int_pattern, $_POST['upload_maxheight_thumbnail'] )
181       or $_POST['upload_maxheight_thumbnail'] < 10 )
182  {
183    array_push( $error, $lang['conf_err_upload_maxheight_thumbnail'] );
184  }
185
186  if ( $_POST['maxwidth'] != ''
187       and ( !preg_match( $int_pattern, $_POST['maxwidth'] )
188             or $_POST['maxwidth'] < 50 ) )
189  {
190    array_push( $error, $lang['err_maxwidth'] );
191  }
192  if ( $_POST['maxheight']
193       and ( !preg_match( $int_pattern, $_POST['maxheight'] )
194             or $_POST['maxheight'] < 50 ) )
195  {
196    array_push( $error, $lang['err_maxheight'] );
197  }
198  // updating configuraiton if no error found
199  if ( count( $error ) == 0 )
200  {
201    mysql_query( 'DELETE FROM '.PREFIX_TABLE.'config;' );
202    $query = 'INSERT INTO '.PREFIX_TABLE.'config';
203    $query.= ' (';
204    foreach ( $conf_infos as $i => $conf_info ) {
205      if ( $i > 0 ) $query.= ',';
206      $query.= $conf_info;
207    }
208    $query.= ')';
209    $query.= ' VALUES';
210    $query.= ' (';
211    foreach ( $conf_infos as $i => $conf_info ) {
212      if ( $i > 0 ) $query.= ',';
213      if ( $_POST[$conf_info] == '' ) $query.= 'NULL';
214      else                            $query.= "'".$_POST[$conf_info]."'";
215    }
216    $query.= ')';
217    $query.= ';';
218    mysql_query( $query );
219
220    $query = 'UPDATE '.USERS_TABLE;
221    $query.= ' SET';
222    foreach ( $default_user_infos as $i => $default_user_info ) {
223      if ( $i > 0 ) $query.= ',';
224      else          $query.= ' ';
225      $query.= $default_user_info;
226      $query.= ' = ';
227      if ( $_POST[$default_user_info] == '' )
228      {
229        $query.= 'NULL';
230      }
231      else
232      {
233        $query.= "'".$_POST[$default_user_info]."'";
234      }
235    }
236    $query.= " WHERE username = 'guest'";
237    $query.= ';';
238    mysql_query( $query );
239  }
240//--------------------------------------------------------- data initialization
241  foreach ( $conf_infos as $conf_info ) {
242    $$conf_info = $_POST[$conf_info];
243  }
244  foreach ( $default_user_infos as $default_user_info ) {
245    $$default_user_info = $_POST[$default_user_info];
246  }
247}
248else
249{
250//--------------------------------------------------------- data initialization
251  $query  = 'SELECT '.implode( ',', $conf_infos );
252  $query .= ' FROM '.PREFIX_TABLE.'config;';
253  $row = mysql_fetch_array( mysql_query( $query ) );
254  foreach ( $conf_infos as $info ) {
255    if ( isset( $row[$info] ) ) $$info = $row[$info];
256    else                        $$info = '';
257  }
258
259  $query  = 'SELECT '.implode( ',', $default_user_infos );
260  $query.= ' FROM '.USERS_TABLE;
261  $query.= " WHERE username = 'guest'";
262  $query.= ';';
263  $row = mysql_fetch_array( mysql_query( $query ) );
264  foreach ( $default_user_infos as $info ) {
265    if ( isset( $row[$info] ) ) $$info = $row[$info];
266    else                        $$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' );
275templatize_array( $tpl, 'lang', $sub );
276//-------------------------------------------------------------- errors display
277if ( 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
289if ( 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 = '';
352if ( $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 = '';
363if ( $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 = '';
396if ( $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 = '';
407if ( $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 = '';
429if ( $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 = '';
440if ( $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 = '';
477if ( $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 = '';
488if ( $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 = '';
509if ( $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 = '';
520if ( $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 = '';
554if ( $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 = '';
565if ( $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/' );
599for ( $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' );
619for ( $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' );
640for ( $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
663for ( $i = 0; $i < sizeof( $option ); $i++ )
664{
665  $vtp->addSession( $sub, 'option' );
666  $vtp->setVar( $sub, 'option.option', $option[$i] );
667  if ( $option[$i] == $template )
668  {
669    $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
670  }
671  $vtp->closeSession( $sub, 'option' );
672}
673$vtp->closeSession( $sub, 'select' );
674$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_theme_info'] );
675$vtp->closeSession( $sub, 'param_line' );
676$vtp->closeSession( $sub, 'line' );
677// short period time
678$vtp->addSession( $sub, 'line' );
679$vtp->addSession( $sub, 'param_line' );
680$vtp->setVar( $sub, 'param_line.name', $lang['customize_short_period'] );
681$vtp->addSession( $sub, 'text' );
682$vtp->setVar( $sub, 'text.name', 'short_period' );
683$vtp->setVar( $sub, 'text.value', $short_period );
684$vtp->closeSession( $sub, 'text' );
685$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_short_period_info']);
686$vtp->closeSession( $sub, 'param_line' );
687$vtp->closeSession( $sub, 'line' );
688// long period time
689$vtp->addSession( $sub, 'line' );
690$vtp->addSession( $sub, 'param_line' );
691$vtp->setVar( $sub, 'param_line.name', $lang['customize_long_period'] );
692$vtp->addSession( $sub, 'text' );
693$vtp->setVar( $sub, 'text.name', 'long_period' );
694$vtp->setVar( $sub, 'text.value', $long_period );
695$vtp->closeSession( $sub, 'text' );
696$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_long_period_info'] );
697$vtp->closeSession( $sub, 'param_line' );
698$vtp->closeSession( $sub, 'line' );
699// max displayed width
700$vtp->addSession( $sub, 'line' );
701$vtp->addSession( $sub, 'param_line' );
702$vtp->setVar( $sub, 'param_line.name', $lang['maxwidth'] );
703$vtp->addSession( $sub, 'text' );
704$vtp->setVar( $sub, 'text.name', 'maxwidth' );
705$vtp->setVar( $sub, 'text.value', $maxwidth );
706$vtp->closeSession( $sub, 'text' );
707$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxwidth_info'] );
708$vtp->closeSession( $sub, 'param_line' );
709$vtp->closeSession( $sub, 'line' );
710// max displayed height
711$vtp->addSession( $sub, 'line' );
712$vtp->addSession( $sub, 'param_line' );
713$vtp->setVar( $sub, 'param_line.name', $lang['maxheight'] );
714$vtp->addSession( $sub, 'text' );
715$vtp->setVar( $sub, 'text.name', 'maxheight' );
716$vtp->setVar( $sub, 'text.value', $maxheight );
717$vtp->closeSession( $sub, 'text' );
718$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxheight_info'] );
719$vtp->closeSession( $sub, 'param_line' );
720$vtp->closeSession( $sub, 'line' );
721// expand all categories ?
722$vtp->addSession( $sub, 'line' );
723$vtp->addSession( $sub, 'param_line' );
724$vtp->setVar( $sub, 'param_line.name', $lang['customize_expand'] );
725$vtp->addSession( $sub, 'group' );
726$vtp->addSession( $sub, 'radio' );
727$vtp->setVar( $sub, 'radio.name', 'expand' );
728
729$vtp->setVar( $sub, 'radio.value', 'true' );
730$checked = '';
731if ( $expand == 'true' )
732{
733  $checked = ' checked="checked"';
734}
735$vtp->setVar( $sub, 'radio.checked', $checked );
736$vtp->setVar( $sub, 'radio.option', $lang['yes'] );
737$vtp->closeSession( $sub, 'radio' );
738$vtp->addSession( $sub, 'radio' );
739$vtp->setVar( $sub, 'radio.name', 'expand' );
740$vtp->setVar( $sub, 'radio.value', 'false' );
741$checked = '';
742if ( $expand == 'false' )
743{
744  $checked = ' checked="checked"';
745}
746$vtp->setVar( $sub, 'radio.checked', $checked );
747$vtp->setVar( $sub, 'radio.option', $lang['no'] );
748$vtp->closeSession( $sub, 'radio' );
749$vtp->closeSession( $sub, 'group' );
750$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_expand_info'] );
751$vtp->closeSession( $sub, 'param_line' );
752$vtp->closeSession( $sub, 'line' );
753// show number of comments on thumbnails page
754$vtp->addSession( $sub, 'line' );
755$vtp->addSession( $sub, 'param_line' );
756$vtp->setVar( $sub, 'param_line.name', $lang['customize_show_nb_comments'] );
757$vtp->addSession( $sub, 'group' );
758$vtp->addSession( $sub, 'radio' );
759$vtp->setVar( $sub, 'radio.name', 'show_nb_comments' );
760$vtp->setVar( $sub, 'radio.value', 'true' );
761$checked = '';
762if ( $show_nb_comments == 'true' )
763{
764  $checked = ' checked="checked"';
765}
766$vtp->setVar( $sub, 'radio.checked', $checked );
767$vtp->setVar( $sub, 'radio.option', $lang['yes'] );
768$vtp->closeSession( $sub, 'radio' );
769$vtp->addSession( $sub, 'radio' );
770$vtp->setVar( $sub, 'radio.name', 'show_nb_comments' );
771$vtp->setVar( $sub, 'radio.value', 'false' );
772$checked = '';
773if ( $show_nb_comments == 'false' )
774{
775  $checked = ' checked="checked"';
776}
777$vtp->setVar( $sub, 'radio.checked', $checked );
778$vtp->setVar( $sub, 'radio.option', $lang['no'] );
779$vtp->closeSession( $sub, 'radio' );
780$vtp->closeSession( $sub, 'group' );
781$vtp->setVar( $sub, 'param_line.def', $lang['conf_default_show_nb_comments_info'] );
782$vtp->closeSession( $sub, 'param_line' );
783$vtp->closeSession( $sub, 'line' );
784
785$vtp->addSession( $sub, 'line' );
786$vtp->addSession( $sub, 'space_line' );
787$vtp->closeSession( $sub, 'space_line' );
788$vtp->closeSession( $sub, 'line' );
789//-------------------------------------------------------- upload configuration
790$vtp->addSession( $sub, 'line' );
791$vtp->addSession( $sub, 'title_line' );
792$vtp->setVar( $sub, 'title_line.title', $lang['conf_upload_title'] );
793$vtp->closeSession( $sub, 'title_line' );
794$vtp->closeSession( $sub, 'line' );
795
796$vtp->addSession( $sub, 'line' );
797$vtp->addSession( $sub, 'space_line' );
798$vtp->closeSession( $sub, 'space_line' );
799$vtp->closeSession( $sub, 'line' );
800// is upload available ?
801$vtp->addSession( $sub, 'line' );
802$vtp->addSession( $sub, 'param_line' );
803$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_available'] );
804$vtp->addSession( $sub, 'group' );
805$vtp->addSession( $sub, 'radio' );
806$vtp->setVar( $sub, 'radio.name', 'upload_available' );
807$vtp->setVar( $sub, 'radio.value', 'true' );
808$checked = '';
809if ( $upload_available == 'true' )
810{
811  $checked = ' checked="checked"';
812}
813$vtp->setVar( $sub, 'radio.checked', $checked );
814$vtp->setVar( $sub, 'radio.option', $lang['yes'] );
815$vtp->closeSession( $sub, 'radio' );
816$vtp->addSession( $sub, 'radio' );
817$vtp->setVar( $sub, 'radio.name', 'upload_available' );
818$vtp->setVar( $sub, 'radio.value', 'false' );
819$checked = '';
820if ( $upload_available == 'false' )
821{
822  $checked = ' checked="checked"';
823}
824$vtp->setVar( $sub, 'radio.checked', $checked );
825$vtp->setVar( $sub, 'radio.option', $lang['no'] );
826$vtp->closeSession( $sub, 'radio' );
827$vtp->closeSession( $sub, 'group' );
828$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_available_info'] );
829$vtp->closeSession( $sub, 'param_line' );
830$vtp->closeSession( $sub, 'line' );
831// max filesize uploadable
832$vtp->addSession( $sub, 'line' );
833$vtp->addSession( $sub, 'param_line' );
834$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxfilesize'] );
835$vtp->addSession( $sub, 'text' );
836$vtp->setVar( $sub, 'text.name', 'upload_maxfilesize' );
837$vtp->setVar( $sub, 'text.value', $upload_maxfilesize );
838$vtp->closeSession( $sub, 'text' );
839$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxfilesize_info'] );
840$vtp->closeSession( $sub, 'param_line' );
841$vtp->closeSession( $sub, 'line' );
842// maxwidth uploadable
843$vtp->addSession( $sub, 'line' );
844$vtp->addSession( $sub, 'param_line' );
845$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxwidth'] );
846$vtp->addSession( $sub, 'text' );
847$vtp->setVar( $sub, 'text.name', 'upload_maxwidth' );
848$vtp->setVar( $sub, 'text.value', $upload_maxwidth );
849$vtp->closeSession( $sub, 'text' );
850$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxwidth_info'] );
851$vtp->closeSession( $sub, 'param_line' );
852$vtp->closeSession( $sub, 'line' );
853// maxheight uploadable
854$vtp->addSession( $sub, 'line' );
855$vtp->addSession( $sub, 'param_line' );
856$vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxheight'] );
857$vtp->addSession( $sub, 'text' );
858$vtp->setVar( $sub, 'text.name', 'upload_maxheight' );
859$vtp->setVar( $sub, 'text.value', $upload_maxheight );
860$vtp->closeSession( $sub, 'text' );
861$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_info'] );
862$vtp->closeSession( $sub, 'param_line' );
863$vtp->closeSession( $sub, 'line' );
864// maxwidth for thumbnail
865$vtp->addSession( $sub, 'line' );
866$vtp->addSession( $sub, 'param_line' );
867$vtp->setVar( $sub, 'param_line.name',$lang['conf_upload_maxwidth_thumbnail']);
868$vtp->addSession( $sub, 'text' );
869$vtp->setVar( $sub, 'text.name', 'upload_maxwidth_thumbnail' );
870$vtp->setVar( $sub, 'text.value', $upload_maxwidth_thumbnail );
871$vtp->closeSession( $sub, 'text' );
872$vtp->setVar($sub,'param_line.def',$lang['conf_upload_maxwidth_thumbnail_info']);
873$vtp->closeSession( $sub, 'param_line' );
874$vtp->closeSession( $sub, 'line' );
875// maxheight for thumbnail
876$vtp->addSession( $sub, 'line' );
877$vtp->addSession( $sub, 'param_line' );
878$vtp->setVar( $sub,'param_line.name',$lang['conf_upload_maxheight_thumbnail']);
879$vtp->addSession( $sub, 'text' );
880$vtp->setVar( $sub, 'text.name', 'upload_maxheight_thumbnail' );
881$vtp->setVar( $sub, 'text.value', $upload_maxheight_thumbnail );
882$vtp->closeSession( $sub, 'text' );
883$vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_thumbnail_info']);
884$vtp->closeSession( $sub, 'param_line' );
885$vtp->closeSession( $sub, 'line' );
886
887$vtp->addSession( $sub, 'line' );
888$vtp->addSession( $sub, 'space_line' );
889$vtp->closeSession( $sub, 'space_line' );
890$vtp->closeSession( $sub, 'line' );
891//------------------------------------------------------ sessions configuration
892$vtp->addSession( $sub, 'line' );
893$vtp->addSession( $sub, 'title_line' );
894$vtp->setVar( $sub, 'title_line.title', $lang['conf_session_title'] );
895$vtp->closeSession( $sub, 'title_line' );
896$vtp->closeSession( $sub, 'line' );
897
898$vtp->addSession( $sub, 'line' );
899$vtp->addSession( $sub, 'space_line' );
900$vtp->closeSession( $sub, 'space_line' );
901$vtp->closeSession( $sub, 'line' );
902// authorize cookies ?
903$vtp->addSession( $sub, 'line' );
904$vtp->addSession( $sub, 'param_line' );
905$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_cookie'] );
906$vtp->addSession( $sub, 'group' );
907$vtp->addSession( $sub, 'radio' );
908$vtp->setVar( $sub, 'radio.name', 'authorize_cookies' );
909$vtp->setVar( $sub, 'radio.value', 'true' );
910$checked = '';
911if ( $authorize_cookies == 'true' )
912{
913  $checked = ' checked="checked"';
914}
915$vtp->setVar( $sub, 'radio.checked', $checked );
916$vtp->setVar( $sub, 'radio.option', $lang['yes'] );
917$vtp->closeSession( $sub, 'radio' );
918$vtp->addSession( $sub, 'radio' );
919$vtp->setVar( $sub, 'radio.name', 'authorize_cookies' );
920$vtp->setVar( $sub, 'radio.value', 'false' );
921$checked = '';
922if ( $authorize_cookies == 'false' )
923{
924  $checked = ' checked="checked"';
925}
926$vtp->setVar( $sub, 'radio.checked', $checked );
927$vtp->setVar( $sub, 'radio.option', $lang['no'] );
928$vtp->closeSession( $sub, 'radio' );
929$vtp->closeSession( $sub, 'group' );
930$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_cookie_info'] );
931$vtp->closeSession( $sub, 'param_line' );
932$vtp->closeSession( $sub, 'line' );
933// session size
934$vtp->addSession( $sub, 'line' );
935$vtp->addSession( $sub, 'param_line' );
936$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_size'] );
937$vtp->addSession( $sub, 'text' );
938$vtp->setVar( $sub, 'text.name', 'session_id_size' );
939$vtp->setVar( $sub, 'text.value', $session_id_size );
940$vtp->closeSession( $sub, 'text' );
941$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_size_info']);
942$vtp->closeSession( $sub, 'param_line' );
943$vtp->closeSession( $sub, 'line' );
944// session length
945$vtp->addSession( $sub, 'line' );
946$vtp->addSession( $sub, 'param_line' );
947$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_time'] );
948$vtp->addSession( $sub, 'text' );
949$vtp->setVar( $sub, 'text.name', 'session_time' );
950$vtp->setVar( $sub, 'text.value', $session_time );
951$vtp->closeSession( $sub, 'text' );
952$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_time_info']);
953$vtp->closeSession( $sub, 'param_line' );
954$vtp->closeSession( $sub, 'line' );
955// session keyword
956$vtp->addSession( $sub, 'line' );
957$vtp->addSession( $sub, 'param_line' );
958$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_key'] );
959$vtp->addSession( $sub, 'text' );
960$vtp->setVar( $sub, 'text.name', 'session_keyword' );
961$vtp->setVar( $sub, 'text.value', $session_keyword );
962$vtp->closeSession( $sub, 'text' );
963$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_key_info']);
964$vtp->closeSession( $sub, 'param_line' );
965$vtp->closeSession( $sub, 'line' );
966// session deletion
967$vtp->addSession( $sub, 'line' );
968$vtp->addSession( $sub, 'param_line' );
969$vtp->setVar( $sub, 'param_line.name', $lang['conf_session_delete'] );
970$vtp->addSession( $sub, 'check' );
971$vtp->addSession( $sub, 'box' );
972$vtp->setVar( $sub, 'box.name', 'empty_session_table' );
973$vtp->setVar( $sub, 'box.value', '1' );
974$vtp->setVar( $sub, 'box.checked', ' checked="checked"' );
975$vtp->closeSession( $sub, 'box' );
976$vtp->closeSession( $sub, 'check' );
977$vtp->setVar( $sub, 'param_line.def', $lang['conf_session_delete_info'] );
978$vtp->closeSession( $sub, 'param_line' );
979$vtp->closeSession( $sub, 'line' );
980
981$vtp->addSession( $sub, 'line' );
982$vtp->addSession( $sub, 'space_line' );
983$vtp->closeSession( $sub, 'space_line' );
984$vtp->closeSession( $sub, 'line' );
985//------------------------------------------------ remote sites administration
986$query = 'select id,galleries_url';
987$query.= ' from '.PREFIX_TABLE.'sites';
988$query.= " where galleries_url <> './galleries/';";
989$result = mysql_query( $query );
990if ( mysql_num_rows( $result ) > 0 )
991{
992  $vtp->addSession( $sub, 'remote_sites' );
993  $i = 0;
994  while ( $row = mysql_fetch_array( $result ) )
995  {
996    $vtp->addSession( $sub, 'site' );
997    $vtp->setVar( $sub, 'site.url', $row['galleries_url'] );
998    $vtp->setVar( $sub, 'site.id', $row['id'] );
999    if ( $i == 0 )
1000    {
1001      $vtp->addSession( $sub, 'rowspan' );
1002      $vtp->setVar( $sub, 'rowspan.nb_sites', mysql_num_rows( $result ) );
1003      $vtp->closeSession( $sub, 'rowspan' );
1004    }
1005    $vtp->closeSession( $sub, 'site' );
1006    $i++;
1007  }
1008  $vtp->closeSession( $sub, 'remote_sites' );
1009}
1010//----------------------------------------------------------- sending html code
1011$vtp->Parse( $handle , 'sub', $sub );
1012?>
Note: See TracBrowser for help on using the repository browser.