Ignore:
Timestamp:
Mar 20, 2004, 1:52:37 AM (20 years ago)
Author:
gweltas
Message:
  • Template migration
  • Admin Control Panel migration
  • Language migration
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r383 r393  
    2626// +-----------------------------------------------------------------------+
    2727
    28 include_once( './admin/include/isadmin.inc.php' );
     28if( !defined("PHPWG_ROOT_PATH") )
     29{
     30        die ("Hacking attempt!");
     31}
     32
     33include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' );
    2934       
    3035$Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A",
     
    4550                "ý" => "y", "ÿ" => "y");
    4651//------------------------------ verification and registration of modifications
    47 $conf_infos = array();
    48 $query = 'SELECT param';
    49 $query.= ' FROM '.CONFIG_TABLE;
    50 $query.= ';';
    51 $result = mysql_query( $query );
    52 while ( $row = mysql_fetch_array( $result ) )
    53 {
    54   array_push( $conf_infos, $row['param'] );
    55 }
    56 
    57 $default_user_infos =
    58 array( 'nb_image_line','nb_line_page','language','maxwidth',
    59        'maxheight','expand','show_nb_comments','short_period','long_period',
    60        'template' );
    6152$error = array();
    6253if ( isset( $_POST['submit'] ) )
    6354{
    6455  $int_pattern = '/^\d+$/';
    65   // empty session table if asked
    66   if ( $_POST['empty_session_table'] == 1 )
    67   {
    68     $query = 'DELETE FROM '.PREFIX_TABLE.'sessions';
    69     $query.= ' WHERE expiration < '.time().';';
    70     mysql_query( $query );
    71   }
    7256  // deletion of site as asked
    7357  $site_deleted = false;
    7458  $query = 'SELECT id';
    75   $query.= ' FROM '.PREFIX_TABLE.'sites';
     59  $query.= ' FROM '.SITES_TABLE;
    7660  $query.= " WHERE galleries_url <> './galleries/';";
    7761  $result = mysql_query( $query );
     
    135119    array_push( $error, $lang['conf_err_sid_time'] );
    136120  }
    137   // max_user_listbox must be an integer between 0 and 255 included
    138   if ( !preg_match( $int_pattern, $_POST['max_user_listbox'] )
    139        or $_POST['max_user_listbox'] < 0
    140        or $_POST['max_user_listbox'] > 255 )
    141   {
    142     array_push( $error, $lang['conf_err_max_user_listbox'] );
    143   }
    144121  // the number of comments per page must be an integer between 5 and 50
    145122  // included
     
    186163  }
    187164
    188   if ( $_POST['maxwidth'] != ''
     165/*  if ( $_POST['maxwidth'] != ''
    189166       and ( !preg_match( $int_pattern, $_POST['maxwidth'] )
    190167             or $_POST['maxwidth'] < 50 ) )
     
    197174  {
    198175    array_push( $error, $lang['err_maxheight'] );
    199   }
     176  }*/
    200177  // updating configuraiton if no error found
    201178  if ( count( $error ) == 0 )
    202179  {
    203     foreach ( $conf_infos as $conf_info ) {
    204       if ( isset( $_POST[$conf_info] ) )
     180    $result = mysql_query( "SELECT * FROM ".CONFIG_TABLE );
     181    while ( $row = mysql_fetch_array( $result ) )
     182        {
     183          $config_name = $row['param'];
     184          $conf[$config_name] = ( isset($_POST[$config_name]) ) ? $_POST[$config_name] : $row['value'];
     185      if ( isset( $_POST[$config_name] ) )
    205186      {
    206187        $query = 'UPDATE '.CONFIG_TABLE;
    207         $query.= ' SET value = ';
    208         if ( $_POST[$conf_info] == '' )
    209         {
    210           $query.= 'NULL';
    211         }
    212         else
    213         {
    214           $query.= "'".$_POST[$conf_info]."'";
    215         }
    216         $query.= " WHERE param = '".$conf_info."'";
    217         $query.= ';';
     188        $query.= " SET value = '". str_replace("\'", "''", $conf[$config_name]) ;
     189        $query.= "' WHERE param = '$config_name'";
    218190        mysql_query( $query );
    219191      }
    220192    }
    221 
    222     $query = 'UPDATE '.USERS_TABLE;
    223     $query.= ' SET';
    224     foreach ( $default_user_infos as $i => $default_user_info ) {
    225       if ( $i > 0 ) $query.= ',';
    226       else          $query.= ' ';
    227       $query.= $default_user_info;
    228       $query.= ' = ';
    229       if ( $_POST[$default_user_info] == '' )
    230       {
    231         $query.= 'NULL';
    232       }
    233       else
    234       {
    235         $query.= "'".$_POST[$default_user_info]."'";
    236       }
    237     }
    238     $query.= " WHERE username = 'guest'";
    239     $query.= ';';
    240     mysql_query( $query );
    241   }
    242 //--------------------------------------------------------- data initialization
    243   foreach ( $conf_infos as $conf_info ) {
    244     $$conf_info = $_POST[$conf_info];
    245   }
    246   foreach ( $default_user_infos as $default_user_info ) {
    247     $$default_user_info = $_POST[$default_user_info];
    248   }
    249 }
    250 else
    251 {
    252 //--------------------------------------------------------- data initialization
    253   $query = 'SELECT param,value';
    254   $query.= ' FROM '.CONFIG_TABLE;
    255   $query.= ';';
    256   $result = mysql_query( $query );
    257   while ( $row =mysql_fetch_array( $result ) )
    258   {
    259     if ( isset( $row['value'] ) )
    260     {
    261       $$row['param'] = $row['value'];
    262     }
    263     else
    264     {
    265       $$row['param'] = '';
    266     }
    267   }
    268 
    269   $query  = 'SELECT '.implode( ',', $default_user_infos );
    270   $query.= ' FROM '.USERS_TABLE;
    271   $query.= " WHERE username = 'guest'";
    272   $query.= ';';
    273   $row = mysql_fetch_array( mysql_query( $query ) );
    274   foreach ( $default_user_infos as $info ) {
    275     if ( isset( $row[$info] ) ) $$info = $row[$info];
    276     else                        $$info = '';
    277   }
    278 }
     193  }
     194}
     195
     196$access = ($conf['access']=='free')?'ACCESS_FREE':'ACCESS_RESTRICTED';
     197$log = ($conf['log']=='true')?'HISTORY_YES':'HISTORY_NO';
     198$mail_notif = ($conf['mail_notification']=='true')?'MAIL_NOTIFICATION_YES':'MAIL_NOTIFICATION_NO';
     199$show_comments = ($conf['show_comments']=='true')?'SHOW_COMMENTS_YES':'SHOW_COMMENTS_NO';
     200$comments_all = ($conf['comments_forall']=='true')?'COMMENTS_ALL_YES':'COMMENTS_ALL_NO';
     201$comments_validation = ($conf['comments_validation']=='true')?'VALIDATE_COMMENTS_YES':'VALIDATE_COMMENTS_NO';
     202$expand = ($conf['auto_expand']=='true')?'EXPAND_TREE_YES':'EXPAND_TREE_NO';
     203$nb_comments = ($conf['show_nb_comments']=='true')?'NB_COMMENTS_YES':'NB_COMMENTS_NO';
     204$upload = ($conf['upload_available']=='true')?'UPLOAD_YES':'UPLOAD_NO';
     205$cookie = ($conf['authorize_cookies']=='true')?'COOKIE_YES':'COOKIE_NO';
     206
    279207//----------------------------------------------------- template initialization
    280 $sub = $vtp->Open(
    281   './template/'.$user['template'].'/admin/configuration.vtp' );
     208$template->set_filenames( array('config'=>'admin/configuration.tpl') );
     209
     210$template->assign_vars(array(
     211  'ADMIN_NAME'=>$conf['webmaster'],
     212  'ADMIN_MAIL'=>$conf['mail_webmaster'],
     213  'THUMBNAIL_PREFIX'=>$conf['prefix_thumbnail'],
     214  'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'],
     215  'LANG_SELECT'=>language_select($conf['default_lang'], 'default_lang'),
     216  'NB_IMAGE_LINE'=>$conf['nb_image_line'],
     217  'NB_ROW_PAGE'=>$conf['nb_line_page'],
     218  'STYLE_SELECT'=>style_select($conf['default_style'], 'default_style'),
     219  'SHORT_PERIOD'=>$conf['short_period'],
     220  'LONG_PERIOD'=>$conf['long_period'],
     221  'UPLOAD_MAXSIZE'=>$conf['upload_maxfilesize'],
     222  'UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth'],
     223  'UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight'],
     224  'TN_UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth_thumbnail'],
     225  'TN_UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight_thumbnail'],
     226  'SESSION_LENGTH'=>$conf['session_time'],
     227  'SESSION_ID_SIZE'=>$conf['session_id_size'],
     228 
     229  $access=>'checked="checked"',
     230  $log=>'checked="checked"',
     231  $mail_notif=>'checked="checked"',
     232  $show_comments=>'checked="checked"',
     233  $comments_all=>'checked="checked"',
     234  $comments_validation=>'checked="checked"',
     235  $expand=>'checked="checked"',
     236  $nb_comments=>'checked="checked"',
     237  $upload=>'checked="checked"',
     238  $cookie=>'checked="checked"',
     239 
     240  'L_CONFIRM'=>$lang['conf_confirmation'],
     241  'L_CONF_GENERAL'=>$lang['conf_general_title'],
     242  'L_ADMIN_NAME'=>$lang['conf_general_webmaster'],
     243  'L_ADMIN_NAME_INFO'=>$lang['conf_general_webmaster_info'],
     244  'L_ADMIN_MAIL'=>$lang['conf_general_mail'],
     245  'L_ADMIN_MAIL_INFO'=>$lang['conf_general_mail_info'],
     246  'L_THUMBNAIL_PREFIX'=>$lang['conf_general_prefix'],
     247  'L_THUMBNAIL_PREFIX_INFO'=>$lang['conf_general_prefix_info'],
     248  'L_ACCESS'=>$lang['conf_general_access'],
     249  'L_ACCESS_INFO'=>$lang['conf_general_access_info'],
     250  'L_ACCESS_FREE'=>$lang['conf_general_access_1'],
     251  'L_ACCESS_RESTRICTED'=>$lang['conf_general_access_2'],
     252  'L_HISTORY'=>$lang['conf_general_log'],
     253  'L_HISTORY_INFO'=>$lang['conf_general_log_info'],
     254  'L_MAIL_NOTIFICATION'=>$lang['conf_general_mail_notification'],
     255  'L_MAIL_NOTIFICATION_INFO'=>$lang['conf_general_mail_notification_info'],
     256  'L_CONF_COMMENTS'=>$lang['conf_comments_title'],
     257  'L_SHOW_COMMENTS'=>$lang['conf_comments_show_comments'],
     258  'L_SHOW_COMMENTS_INFO'=>$lang['conf_comments_show_comments_info'],
     259  'L_COMMENTS_ALL'=>$lang['conf_comments_forall'],
     260  'L_COMMENTS_ALL_INFO'=>$lang['conf_comments_forall_info'],
     261  'L_NB_COMMENTS_PAGE'=>$lang['conf_comments_comments_number'],
     262  'L_NB_COMMENTS_PAGE_INFO'=>$lang['conf_comments_comments_number_info'],
     263  'L_VALIDATE_COMMENTS'=>$lang['conf_comments_validation'],
     264  'L_VALIDATE_COMMENTS_INFO'=>$lang['conf_comments_validation_info'],
     265  'L_ABILITIES_SETTINGS'=>$lang['conf_default_title'],
     266  'L_LANG_SELECT'=>$lang['customize_language'],
     267  'L_LANG_SELECT_INFO'=>$lang['conf_default_language_info'],
     268  'L_NB_IMAGE_LINE'=>$lang['customize_nb_image_per_row'],
     269  'L_NB_IMAGE_LINE_INFO'=>$lang['conf_default_nb_image_per_row_info'],
     270  'L_NB_ROW_PAGE'=>$lang['customize_nb_row_per_page'],
     271  'L_NB_ROW_PAGE_INFO'=>$lang['conf_default_nb_row_per_page_info'],
     272  'L_STYLE_SELECT'=>$lang['customize_theme'],
     273  'L_STYLE_SELECT_INFO'=>$lang['conf_default_theme_info'],
     274  'L_SHORT_PERIOD'=>$lang['customize_short_period'],
     275  'L_SHORT_PERIOD_INFO'=>$lang['conf_default_short_period_info'],
     276  'L_LONG_PERIOD'=>$lang['customize_long_period'],
     277  'L_LONG_PERIOD_INFO'=>$lang['conf_default_long_period_info'],
     278  'L_EXPAND_TREE'=>$lang['customize_expand'],
     279  'L_EXPAND_TREE_INFO'=>$lang['conf_default_expand_info'],
     280  'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'],
     281  'L_NB_COMMENTS_INFO'=>$lang['conf_default_show_nb_comments_info'],
     282  'L_UPLOAD'=>$lang['conf_upload_available'],
     283  'L_UPLOAD_INFO'=>$lang['conf_upload_available_info'],
     284  'L_CONF_UPLOAD'=>$lang['conf_upload_title'],
     285  'L_UPLOAD_MAXSIZE'=>$lang['conf_upload_maxfilesize'],
     286  'L_UPLOAD_MAXSIZE_INFO'=>$lang['conf_upload_maxfilesize_info'],
     287  'L_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth'],
     288  'L_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_info'],
     289  'L_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight'],
     290  'L_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_info'],
     291  'L_TN_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth_thumbnail'],
     292  'L_TN_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_thumbnail_info'],
     293  'L_TN_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight_thumbnail'],
     294  'L_TN_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_thumbnail'],
     295  'L_CONF_SESSION'=>$lang['conf_session_title'],
     296  'L_COOKIE'=>$lang['conf_session_cookie'],
     297  'L_COOKIE_INFO'=>$lang['conf_session_cookie_info'],
     298  'L_SESSION_LENGTH'=>$lang['conf_session_time'],
     299  'L_SESSION_LENGTH_INFO'=>$lang['conf_session_time_info'],
     300  'L_SESSION_ID_SIZE'=>$lang['conf_session_size'],
     301  'L_SESSION_ID_SIZE_INFO'=>$lang['conf_session_size_info'],
     302  'L_YES'=>$lang['yes'],
     303  'L_NO'=>$lang['no'],
     304  'L_SUBMIT'=>$lang['submit'],
     305 
     306  'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?page=configuration')
     307  ));
    282308
    283309$tpl = array( 'conf_confirmation','remote_site','delete',
    284310              'conf_remote_site_delete_info','submit','errors_title' );
    285 templatize_array( $tpl, 'lang', $sub );
     311
    286312//-------------------------------------------------------------- errors display
    287313if ( sizeof( $error ) != 0 )
    288314{
    289   $vtp->addSession( $sub, 'errors' );
     315  $template->assign_block_vars('errors',array());
    290316  for ( $i = 0; $i < sizeof( $error ); $i++ )
    291317  {
    292     $vtp->addSession( $sub, 'li' );
    293     $vtp->setVar( $sub, 'li.li', $error[$i] );
    294     $vtp->closeSession( $sub, 'li' );
    295   }
    296   $vtp->closeSession( $sub, 'errors' );
    297 }
    298 //-------------------------------------------------------- confirmation display
    299 if ( count( $error ) == 0 and isset( $_POST['submit'] ) )
    300 {
    301   $vtp->addSession( $sub, 'confirmation' );
    302   $vtp->closeSession( $sub, 'confirmation' );
    303 }
    304 //----------------------------------------------------------------- form action
    305 $form_action = add_session_id( './admin.php?page=configuration' );
    306 $vtp->setVar( $sub, 'form_action', $form_action );
    307 //------------------------------------------------------- general configuration
    308 $vtp->addSession( $sub, 'line' );
    309 $vtp->addSession( $sub, 'title_line' );
    310 $vtp->setVar( $sub, 'title_line.title', $lang['conf_general_title'] );
    311 $vtp->closeSession( $sub, 'title_line' );
    312 $vtp->closeSession( $sub, 'line' );
    313 
    314 $vtp->addSession( $sub, 'line' );
    315 $vtp->addSession( $sub, 'space_line' );
    316 $vtp->closeSession( $sub, 'space_line' );
    317 $vtp->closeSession( $sub, 'line' );
    318 // webmaster name
    319 $vtp->addSession( $sub, 'line' );
    320 $vtp->addSession( $sub, 'param_line' );
    321 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_webmaster'] );
    322 $vtp->addSession( $sub, 'hidden' );
    323 $vtp->setVar( $sub, 'hidden.text', $webmaster );
    324 $vtp->setVar( $sub, 'hidden.name', 'webmaster' );
    325 $vtp->setVar( $sub, 'hidden.value', $webmaster );
    326 $vtp->closeSession( $sub, 'hidden' );
    327 $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_webmaster_info'] );
    328 $vtp->closeSession( $sub, 'param_line' );
    329 $vtp->closeSession( $sub, 'line' );
    330 // webmaster mail address
    331 $vtp->addSession( $sub, 'line' );
    332 $vtp->addSession( $sub, 'param_line' );
    333 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_mail'] );
    334 $vtp->addSession( $sub, 'text' );
    335 $vtp->setVar( $sub, 'text.name', 'mail_webmaster' );
    336 $vtp->setVar( $sub, 'text.value', $mail_webmaster );
    337 $vtp->closeSession( $sub, 'text' );
    338 $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_mail_info'] );
    339 $vtp->closeSession( $sub, 'param_line' );
    340 $vtp->closeSession( $sub, 'line' );
    341 // prefix for thumbnails
    342 $vtp->addSession( $sub, 'line' );
    343 $vtp->addSession( $sub, 'param_line' );
    344 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_prefix'] );
    345 $vtp->addSession( $sub, 'text' );
    346 $vtp->setVar( $sub, 'text.name', 'prefix_thumbnail' );
    347 $vtp->setVar( $sub, 'text.value', $prefix_thumbnail );
    348 $vtp->closeSession( $sub, 'text' );
    349 $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_prefix_info'] );
    350 $vtp->closeSession( $sub, 'param_line' );
    351 $vtp->closeSession( $sub, 'line' );
    352 // access type
    353 $vtp->addSession( $sub, 'line' );
    354 $vtp->addSession( $sub, 'param_line' );
    355 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_access'] );
    356 $vtp->addSession( $sub, 'group' );
    357 $vtp->addSession( $sub, 'radio' );
    358 $vtp->setVar( $sub, 'radio.name', 'access' );
    359 $vtp->setVar( $sub, 'radio.value', 'free' );
    360 $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_1'] );
    361 $checked = '';
    362 if ( $access == 'free' )
    363 {
    364   $checked = ' checked="checked"';
    365 }
    366 $vtp->setVar( $sub, 'radio.checked', $checked );
    367 $vtp->closeSession( $sub, 'radio' );
    368 $vtp->addSession( $sub, 'radio' );
    369 $vtp->setVar( $sub, 'radio.name', 'access' );
    370 $vtp->setVar( $sub, 'radio.value', 'restricted' );
    371 $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_2'] );
    372 $checked = '';
    373 if ( $access == 'restricted' )
    374 {
    375   $checked = ' checked="checked"';
    376 }
    377 $vtp->setVar( $sub, 'radio.checked', $checked );
    378 $vtp->closeSession( $sub, 'radio' );
    379 $vtp->closeSession( $sub, 'group' );
    380 $vtp->setVar( $sub, 'param_line.def', $lang['conf_general_access_info'] );
    381 $vtp->closeSession( $sub, 'param_line' );
    382 $vtp->closeSession( $sub, 'line' );
    383 // maximum user number to display in the listbox of identification page
    384 $vtp->addSession( $sub, 'line' );
    385 $vtp->addSession( $sub, 'param_line' );
    386 $vtp->setVar( $sub, 'param_line.name',
    387               $lang['conf_general_max_user_listbox'] );
    388 $vtp->addSession( $sub, 'text' );
    389 $vtp->setVar( $sub, 'text.name', 'max_user_listbox' );
    390 $vtp->setVar( $sub, 'text.value', $max_user_listbox );
    391 $vtp->closeSession( $sub, 'text' );
    392 $vtp->setVar( $sub, 'param_line.def',
    393               $lang['conf_general_max_user_listbox_info'] );
    394 $vtp->closeSession( $sub, 'param_line' );
    395 $vtp->closeSession( $sub, 'line' );
    396 // activate log
    397 $vtp->addSession( $sub, 'line' );
    398 $vtp->addSession( $sub, 'param_line' );
    399 $vtp->setVar( $sub, 'param_line.name', $lang['conf_general_log'] );
    400 $vtp->addSession( $sub, 'group' );
    401 $vtp->addSession( $sub, 'radio' );
    402 $vtp->setVar( $sub, 'radio.name', 'log' );
    403 $vtp->setVar( $sub, 'radio.value', 'true' );
    404 $vtp->setVar( $sub, 'radio.option', $lang['yes'] );
    405 $checked = '';
    406 if ( $log == 'true' )
    407 {
    408   $checked = ' checked="checked"';
    409 }
    410 $vtp->setVar( $sub, 'radio.checked', $checked );
    411 $vtp->closeSession( $sub, 'radio' );
    412 $vtp->addSession( $sub, 'radio' );
    413 $vtp->setVar( $sub, 'radio.name', 'log' );
    414 $vtp->setVar( $sub, 'radio.value', 'false' );
    415 $vtp->setVar( $sub, 'radio.option', $lang['no'] );
    416 $checked = '';
    417 if ( $log == 'false' )
    418 {
    419   $checked = ' checked="checked"';
    420 }
    421 $vtp->setVar( $sub, 'radio.checked', $checked );
    422 $vtp->closeSession( $sub, 'radio' );
    423 $vtp->closeSession( $sub, 'group' );
    424 $vtp->setVar( $sub, 'param_line.def',
    425               $lang['conf_general_log_info'] );
    426 $vtp->closeSession( $sub, 'param_line' );
    427 $vtp->closeSession( $sub, 'line' );
    428 // mail notification for admins
    429 $vtp->addSession( $sub, 'line' );
    430 $vtp->addSession( $sub, 'param_line' );
    431 $vtp->setVar( $sub, 'param_line.name',
    432               $lang['conf_general_mail_notification'] );
    433 $vtp->addSession( $sub, 'group' );
    434 $vtp->addSession( $sub, 'radio' );
    435 $vtp->setVar( $sub, 'radio.name', 'mail_notification' );
    436 $vtp->setVar( $sub, 'radio.value', 'true' );
    437 $vtp->setVar( $sub, 'radio.option', $lang['yes'] );
    438 $checked = '';
    439 if ( $mail_notification == 'true' )
    440 {
    441   $checked = ' checked="checked"';
    442 }
    443 $vtp->setVar( $sub, 'radio.checked', $checked );
    444 $vtp->closeSession( $sub, 'radio' );
    445 $vtp->addSession( $sub, 'radio' );
    446 $vtp->setVar( $sub, 'radio.name', 'mail_notification' );
    447 $vtp->setVar( $sub, 'radio.value', 'false' );
    448 $vtp->setVar( $sub, 'radio.option', $lang['no'] );
    449 $checked = '';
    450 if ( $mail_notification == 'false' )
    451 {
    452   $checked = ' checked="checked"';
    453 }
    454 $vtp->setVar( $sub, 'radio.checked', $checked );
    455 $vtp->closeSession( $sub, 'radio' );
    456 $vtp->closeSession( $sub, 'group' );
    457 $vtp->setVar( $sub, 'param_line.def',
    458               $lang['conf_general_mail_notification_info'] );
    459 $vtp->closeSession( $sub, 'param_line' );
    460 $vtp->closeSession( $sub, 'line' );
    461 
    462 $vtp->addSession( $sub, 'line' );
    463 $vtp->addSession( $sub, 'space_line' );
    464 $vtp->closeSession( $sub, 'space_line' );
    465 $vtp->closeSession( $sub, 'line' );
    466 //------------------------------------------------------ comments configuration
    467 $vtp->addSession( $sub, 'line' );
    468 $vtp->addSession( $sub, 'title_line' );
    469 $vtp->setVar( $sub, 'title_line.title', $lang['conf_comments_title'] );
    470 $vtp->closeSession( $sub, 'title_line' );
    471 $vtp->closeSession( $sub, 'line' );
    472 
    473 $vtp->addSession( $sub, 'line' );
    474 $vtp->addSession( $sub, 'space_line' );
    475 $vtp->closeSession( $sub, 'space_line' );
    476 $vtp->closeSession( $sub, 'line' );
    477 // show comments ?
    478 $vtp->addSession( $sub, 'line' );
    479 $vtp->addSession( $sub, 'param_line' );
    480 $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_show_comments'] );
    481 $vtp->addSession( $sub, 'group' );
    482 $vtp->addSession( $sub, 'radio' );
    483 $vtp->setVar( $sub, 'radio.name', 'show_comments' );
    484 $vtp->setVar( $sub, 'radio.value', 'true' );
    485 $vtp->setVar( $sub, 'radio.option', $lang['yes'] );
    486 $checked = '';
    487 if ( $show_comments == 'true' )
    488 {
    489   $checked = ' checked="checked"';
    490 }
    491 $vtp->setVar( $sub, 'radio.checked', $checked );
    492 $vtp->closeSession( $sub, 'radio' );
    493 $vtp->addSession( $sub, 'radio' );
    494 $vtp->setVar( $sub, 'radio.name', 'show_comments' );
    495 $vtp->setVar( $sub, 'radio.value', 'false' );
    496 $vtp->setVar( $sub, 'radio.option', $lang['no'] );
    497 $checked = '';
    498 if ( $show_comments == 'false' )
    499 {
    500   $checked = ' checked="checked"';
    501 }
    502 $vtp->setVar( $sub, 'radio.checked', $checked );
    503 $vtp->closeSession( $sub, 'radio' );
    504 $vtp->closeSession( $sub, 'group' );
    505 $vtp->setVar( $sub, 'param_line.def',
    506               $lang['conf_comments_show_comments_info'] );
    507 $vtp->closeSession( $sub, 'param_line' );
    508 $vtp->closeSession( $sub, 'line' );
    509 // coments for all ? true -> guests can post messages
    510 $vtp->addSession( $sub, 'line' );
    511 $vtp->addSession( $sub, 'param_line' );
    512 $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_forall'] );
    513 $vtp->addSession( $sub, 'group' );
    514 $vtp->addSession( $sub, 'radio' );
    515 $vtp->setVar( $sub, 'radio.name', 'comments_forall' );
    516 $vtp->setVar( $sub, 'radio.value', 'true' );
    517 $vtp->setVar( $sub, 'radio.option', $lang['yes'] );
    518 $checked = '';
    519 if ( $comments_forall == 'true' )
    520 {
    521   $checked = ' checked="checked"';
    522 }
    523 $vtp->setVar( $sub, 'radio.checked', $checked );
    524 $vtp->closeSession( $sub, 'radio' );
    525 $vtp->addSession( $sub, 'radio' );
    526 $vtp->setVar( $sub, 'radio.name', 'comments_forall' );
    527 $vtp->setVar( $sub, 'radio.value', 'false' );
    528 $vtp->setVar( $sub, 'radio.option', $lang['no'] );
    529 $checked = '';
    530 if ( $comments_forall == 'false' )
    531 {
    532   $checked = ' checked="checked"';
    533 }
    534 $vtp->setVar( $sub, 'radio.checked', $checked );
    535 $vtp->closeSession( $sub, 'radio' );
    536 $vtp->closeSession( $sub, 'group' );
    537 $vtp->setVar( $sub, 'param_line.def',
    538               $lang['conf_comments_forall_info'] );
    539 $vtp->closeSession( $sub, 'param_line' );
    540 $vtp->closeSession( $sub, 'line' );
    541 // number of comments per page
    542 $vtp->addSession( $sub, 'line' );
    543 $vtp->addSession( $sub, 'param_line' );
    544 $vtp->setVar( $sub, 'param_line.name',
    545               $lang['conf_comments_comments_number'] );
    546 $vtp->addSession( $sub, 'text' );
    547 $vtp->setVar( $sub, 'text.name', 'nb_comment_page' );
    548 $vtp->setVar( $sub, 'text.value', $nb_comment_page );
    549 $vtp->closeSession( $sub, 'text' );
    550 $vtp->setVar( $sub, 'param_line.def',
    551               $lang['conf_comments_comments_number_info'] );
    552 $vtp->closeSession( $sub, 'param_line' );
    553 $vtp->closeSession( $sub, 'line' );
    554 // coments validation
    555 $vtp->addSession( $sub, 'line' );
    556 $vtp->addSession( $sub, 'param_line' );
    557 $vtp->setVar( $sub, 'param_line.name', $lang['conf_comments_validation'] );
    558 $vtp->addSession( $sub, 'group' );
    559 $vtp->addSession( $sub, 'radio' );
    560 $vtp->setVar( $sub, 'radio.name', 'comments_validation' );
    561 $vtp->setVar( $sub, 'radio.value', 'true' );
    562 $vtp->setVar( $sub, 'radio.option', $lang['yes'] );
    563 $checked = '';
    564 if ( $comments_validation == 'true' )
    565 {
    566   $checked = ' checked="checked"';
    567 }
    568 $vtp->setVar( $sub, 'radio.checked', $checked );
    569 $vtp->closeSession( $sub, 'radio' );
    570 $vtp->addSession( $sub, 'radio' );
    571 $vtp->setVar( $sub, 'radio.name', 'comments_validation' );
    572 $vtp->setVar( $sub, 'radio.value', 'false' );
    573 $vtp->setVar( $sub, 'radio.option', $lang['no'] );
    574 $checked = '';
    575 if ( $comments_validation == 'false' )
    576 {
    577   $checked = ' checked="checked"';
    578 }
    579 $vtp->setVar( $sub, 'radio.checked', $checked );
    580 $vtp->closeSession( $sub, 'radio' );
    581 $vtp->closeSession( $sub, 'group' );
    582 $vtp->setVar( $sub, 'param_line.def',
    583               $lang['conf_comments_validation_info'] );
    584 $vtp->closeSession( $sub, 'param_line' );
    585 $vtp->closeSession( $sub, 'line' );
    586 
    587 $vtp->addSession( $sub, 'line' );
    588 $vtp->addSession( $sub, 'space_line' );
    589 $vtp->closeSession( $sub, 'space_line' );
    590 $vtp->closeSession( $sub, 'line' );
    591 //-------------------------------------------------- default user configuration
    592 $vtp->addSession( $sub, 'line' );
    593 $vtp->addSession( $sub, 'title_line' );
    594 $vtp->setVar( $sub, 'title_line.title', $lang['conf_default_title'] );
    595 $vtp->closeSession( $sub, 'title_line' );
    596 $vtp->closeSession( $sub, 'line' );
    597 
    598 $vtp->addSession( $sub, 'line' );
    599 $vtp->addSession( $sub, 'space_line' );
    600 $vtp->closeSession( $sub, 'space_line' );
    601 $vtp->closeSession( $sub, 'line' );
    602 // default language
    603 $vtp->addSession( $sub, 'line' );
    604 $vtp->addSession( $sub, 'param_line' );
    605 $vtp->setVar( $sub, 'param_line.name', $lang['customize_language'] );
    606 $vtp->addSession( $sub, 'select' );
    607 $vtp->setVar( $sub, 'select.name', 'language' );
    608 $option = get_languages( './language/' );
    609 for ( $i = 0; $i < sizeof( $option ); $i++ )
    610 {
    611   $vtp->addSession( $sub, 'option' );
    612   $vtp->setVar( $sub, 'option.option', $option[$i] );
    613   if ( $option[$i] == $language )
    614   {
    615     $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
    616   }
    617   $vtp->closeSession( $sub, 'option' );
    618 }
    619 $vtp->closeSession( $sub, 'select' );
    620 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_language_info'] );
    621 $vtp->closeSession( $sub, 'param_line' );
    622 $vtp->closeSession( $sub, 'line' );
    623 // number of image per row
    624 $vtp->addSession( $sub, 'line' );
    625 $vtp->addSession( $sub, 'param_line' );
    626 $vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_image_per_row'] );
    627 $vtp->addSession( $sub, 'select' );
    628 $vtp->setVar( $sub, 'select.name', 'nb_image_line' );
    629 for ( $i = 0; $i < sizeof( $conf['nb_image_row'] ); $i++ )
    630 {
    631   $vtp->addSession( $sub, 'option' );
    632   $vtp->setVar( $sub, 'option.option', $conf['nb_image_row'][$i] );
    633   if ( $conf['nb_image_row'][$i] == $nb_image_line )
    634   {
    635     $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
    636   }
    637   $vtp->closeSession( $sub, 'option' );
    638 }
    639 $vtp->closeSession( $sub, 'select' );
    640 $vtp->setVar( $sub, 'param_line.def',
    641               $lang['conf_default_nb_image_per_row_info'] );
    642 $vtp->closeSession( $sub, 'param_line' );
    643 $vtp->closeSession( $sub, 'line' );
    644 // number of row per page
    645 $vtp->addSession( $sub, 'line' );
    646 $vtp->addSession( $sub, 'param_line' );
    647 $vtp->setVar( $sub, 'param_line.name', $lang['customize_nb_row_per_page'] );
    648 $vtp->addSession( $sub, 'select' );
    649 $vtp->setVar( $sub, 'select.name', 'nb_line_page' );
    650 for ( $i = 0; $i < sizeof( $conf['nb_row_page'] ); $i++ )
    651 {
    652   $vtp->addSession( $sub, 'option' );
    653   $vtp->setVar( $sub, 'option.option', $conf['nb_row_page'][$i] );
    654   if ( $conf['nb_row_page'][$i] == $nb_line_page )
    655   {
    656     $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
    657   }
    658   $vtp->closeSession( $sub, 'option' );
    659 }
    660 $vtp->closeSession( $sub, 'select' );
    661 $vtp->setVar( $sub, 'param_line.def',
    662               $lang['conf_default_nb_row_per_page_info'] );
    663 $vtp->closeSession( $sub, 'param_line' );
    664 $vtp->closeSession( $sub, 'line' );
    665 // template
    666 $vtp->addSession( $sub, 'line' );
    667 $vtp->addSession( $sub, 'param_line' );
    668 $vtp->setVar( $sub, 'param_line.name', $lang['customize_theme'] );
    669 $vtp->addSession( $sub, 'select' );
    670 $vtp->setVar( $sub, 'select.name', 'template' );
    671 $option = get_dirs( './template/' );
    672 
    673 for ( $i = 0; $i < sizeof( $option ); $i++ )
    674 {
    675   $vtp->addSession( $sub, 'option' );
    676   $vtp->setVar( $sub, 'option.option', $option[$i] );
    677   if ( $option[$i] == $template )
    678   {
    679     $vtp->setVar( $sub, 'option.selected', ' selected="selected"' );
    680   }
    681   $vtp->closeSession( $sub, 'option' );
    682 }
    683 $vtp->closeSession( $sub, 'select' );
    684 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_theme_info'] );
    685 $vtp->closeSession( $sub, 'param_line' );
    686 $vtp->closeSession( $sub, 'line' );
    687 // short period time
    688 $vtp->addSession( $sub, 'line' );
    689 $vtp->addSession( $sub, 'param_line' );
    690 $vtp->setVar( $sub, 'param_line.name', $lang['customize_short_period'] );
    691 $vtp->addSession( $sub, 'text' );
    692 $vtp->setVar( $sub, 'text.name', 'short_period' );
    693 $vtp->setVar( $sub, 'text.value', $short_period );
    694 $vtp->closeSession( $sub, 'text' );
    695 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_short_period_info']);
    696 $vtp->closeSession( $sub, 'param_line' );
    697 $vtp->closeSession( $sub, 'line' );
    698 // long period time
    699 $vtp->addSession( $sub, 'line' );
    700 $vtp->addSession( $sub, 'param_line' );
    701 $vtp->setVar( $sub, 'param_line.name', $lang['customize_long_period'] );
    702 $vtp->addSession( $sub, 'text' );
    703 $vtp->setVar( $sub, 'text.name', 'long_period' );
    704 $vtp->setVar( $sub, 'text.value', $long_period );
    705 $vtp->closeSession( $sub, 'text' );
    706 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_long_period_info'] );
    707 $vtp->closeSession( $sub, 'param_line' );
    708 $vtp->closeSession( $sub, 'line' );
    709 // max displayed width
    710 $vtp->addSession( $sub, 'line' );
    711 $vtp->addSession( $sub, 'param_line' );
    712 $vtp->setVar( $sub, 'param_line.name', $lang['maxwidth'] );
    713 $vtp->addSession( $sub, 'text' );
    714 $vtp->setVar( $sub, 'text.name', 'maxwidth' );
    715 $vtp->setVar( $sub, 'text.value', $maxwidth );
    716 $vtp->closeSession( $sub, 'text' );
    717 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxwidth_info'] );
    718 $vtp->closeSession( $sub, 'param_line' );
    719 $vtp->closeSession( $sub, 'line' );
    720 // max displayed height
    721 $vtp->addSession( $sub, 'line' );
    722 $vtp->addSession( $sub, 'param_line' );
    723 $vtp->setVar( $sub, 'param_line.name', $lang['maxheight'] );
    724 $vtp->addSession( $sub, 'text' );
    725 $vtp->setVar( $sub, 'text.name', 'maxheight' );
    726 $vtp->setVar( $sub, 'text.value', $maxheight );
    727 $vtp->closeSession( $sub, 'text' );
    728 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_maxheight_info'] );
    729 $vtp->closeSession( $sub, 'param_line' );
    730 $vtp->closeSession( $sub, 'line' );
    731 // expand all categories ?
    732 $vtp->addSession( $sub, 'line' );
    733 $vtp->addSession( $sub, 'param_line' );
    734 $vtp->setVar( $sub, 'param_line.name', $lang['customize_expand'] );
    735 $vtp->addSession( $sub, 'group' );
    736 $vtp->addSession( $sub, 'radio' );
    737 $vtp->setVar( $sub, 'radio.name', 'expand' );
    738 
    739 $vtp->setVar( $sub, 'radio.value', 'true' );
    740 $checked = '';
    741 if ( $expand == 'true' )
    742 {
    743   $checked = ' checked="checked"';
    744 }
    745 $vtp->setVar( $sub, 'radio.checked', $checked );
    746 $vtp->setVar( $sub, 'radio.option', $lang['yes'] );
    747 $vtp->closeSession( $sub, 'radio' );
    748 $vtp->addSession( $sub, 'radio' );
    749 $vtp->setVar( $sub, 'radio.name', 'expand' );
    750 $vtp->setVar( $sub, 'radio.value', 'false' );
    751 $checked = '';
    752 if ( $expand == 'false' )
    753 {
    754   $checked = ' checked="checked"';
    755 }
    756 $vtp->setVar( $sub, 'radio.checked', $checked );
    757 $vtp->setVar( $sub, 'radio.option', $lang['no'] );
    758 $vtp->closeSession( $sub, 'radio' );
    759 $vtp->closeSession( $sub, 'group' );
    760 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_expand_info'] );
    761 $vtp->closeSession( $sub, 'param_line' );
    762 $vtp->closeSession( $sub, 'line' );
    763 // show number of comments on thumbnails page
    764 $vtp->addSession( $sub, 'line' );
    765 $vtp->addSession( $sub, 'param_line' );
    766 $vtp->setVar( $sub, 'param_line.name', $lang['customize_show_nb_comments'] );
    767 $vtp->addSession( $sub, 'group' );
    768 $vtp->addSession( $sub, 'radio' );
    769 $vtp->setVar( $sub, 'radio.name', 'show_nb_comments' );
    770 $vtp->setVar( $sub, 'radio.value', 'true' );
    771 $checked = '';
    772 if ( $show_nb_comments == 'true' )
    773 {
    774   $checked = ' checked="checked"';
    775 }
    776 $vtp->setVar( $sub, 'radio.checked', $checked );
    777 $vtp->setVar( $sub, 'radio.option', $lang['yes'] );
    778 $vtp->closeSession( $sub, 'radio' );
    779 $vtp->addSession( $sub, 'radio' );
    780 $vtp->setVar( $sub, 'radio.name', 'show_nb_comments' );
    781 $vtp->setVar( $sub, 'radio.value', 'false' );
    782 $checked = '';
    783 if ( $show_nb_comments == 'false' )
    784 {
    785   $checked = ' checked="checked"';
    786 }
    787 $vtp->setVar( $sub, 'radio.checked', $checked );
    788 $vtp->setVar( $sub, 'radio.option', $lang['no'] );
    789 $vtp->closeSession( $sub, 'radio' );
    790 $vtp->closeSession( $sub, 'group' );
    791 $vtp->setVar( $sub, 'param_line.def', $lang['conf_default_show_nb_comments_info'] );
    792 $vtp->closeSession( $sub, 'param_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 //-------------------------------------------------------- upload configuration
    800 $vtp->addSession( $sub, 'line' );
    801 $vtp->addSession( $sub, 'title_line' );
    802 $vtp->setVar( $sub, 'title_line.title', $lang['conf_upload_title'] );
    803 $vtp->closeSession( $sub, 'title_line' );
    804 $vtp->closeSession( $sub, 'line' );
    805 
    806 $vtp->addSession( $sub, 'line' );
    807 $vtp->addSession( $sub, 'space_line' );
    808 $vtp->closeSession( $sub, 'space_line' );
    809 $vtp->closeSession( $sub, 'line' );
    810 // is upload available ?
    811 $vtp->addSession( $sub, 'line' );
    812 $vtp->addSession( $sub, 'param_line' );
    813 $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_available'] );
    814 $vtp->addSession( $sub, 'group' );
    815 $vtp->addSession( $sub, 'radio' );
    816 $vtp->setVar( $sub, 'radio.name', 'upload_available' );
    817 $vtp->setVar( $sub, 'radio.value', 'true' );
    818 $checked = '';
    819 if ( $upload_available == 'true' )
    820 {
    821   $checked = ' checked="checked"';
    822 }
    823 $vtp->setVar( $sub, 'radio.checked', $checked );
    824 $vtp->setVar( $sub, 'radio.option', $lang['yes'] );
    825 $vtp->closeSession( $sub, 'radio' );
    826 $vtp->addSession( $sub, 'radio' );
    827 $vtp->setVar( $sub, 'radio.name', 'upload_available' );
    828 $vtp->setVar( $sub, 'radio.value', 'false' );
    829 $checked = '';
    830 if ( $upload_available == 'false' )
    831 {
    832   $checked = ' checked="checked"';
    833 }
    834 $vtp->setVar( $sub, 'radio.checked', $checked );
    835 $vtp->setVar( $sub, 'radio.option', $lang['no'] );
    836 $vtp->closeSession( $sub, 'radio' );
    837 $vtp->closeSession( $sub, 'group' );
    838 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_available_info'] );
    839 $vtp->closeSession( $sub, 'param_line' );
    840 $vtp->closeSession( $sub, 'line' );
    841 // max filesize uploadable
    842 $vtp->addSession( $sub, 'line' );
    843 $vtp->addSession( $sub, 'param_line' );
    844 $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxfilesize'] );
    845 $vtp->addSession( $sub, 'text' );
    846 $vtp->setVar( $sub, 'text.name', 'upload_maxfilesize' );
    847 $vtp->setVar( $sub, 'text.value', $upload_maxfilesize );
    848 $vtp->closeSession( $sub, 'text' );
    849 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxfilesize_info'] );
    850 $vtp->closeSession( $sub, 'param_line' );
    851 $vtp->closeSession( $sub, 'line' );
    852 // maxwidth uploadable
    853 $vtp->addSession( $sub, 'line' );
    854 $vtp->addSession( $sub, 'param_line' );
    855 $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxwidth'] );
    856 $vtp->addSession( $sub, 'text' );
    857 $vtp->setVar( $sub, 'text.name', 'upload_maxwidth' );
    858 $vtp->setVar( $sub, 'text.value', $upload_maxwidth );
    859 $vtp->closeSession( $sub, 'text' );
    860 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxwidth_info'] );
    861 $vtp->closeSession( $sub, 'param_line' );
    862 $vtp->closeSession( $sub, 'line' );
    863 // maxheight uploadable
    864 $vtp->addSession( $sub, 'line' );
    865 $vtp->addSession( $sub, 'param_line' );
    866 $vtp->setVar( $sub, 'param_line.name', $lang['conf_upload_maxheight'] );
    867 $vtp->addSession( $sub, 'text' );
    868 $vtp->setVar( $sub, 'text.name', 'upload_maxheight' );
    869 $vtp->setVar( $sub, 'text.value', $upload_maxheight );
    870 $vtp->closeSession( $sub, 'text' );
    871 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_info'] );
    872 $vtp->closeSession( $sub, 'param_line' );
    873 $vtp->closeSession( $sub, 'line' );
    874 // maxwidth for thumbnail
    875 $vtp->addSession( $sub, 'line' );
    876 $vtp->addSession( $sub, 'param_line' );
    877 $vtp->setVar( $sub, 'param_line.name',$lang['conf_upload_maxwidth_thumbnail']);
    878 $vtp->addSession( $sub, 'text' );
    879 $vtp->setVar( $sub, 'text.name', 'upload_maxwidth_thumbnail' );
    880 $vtp->setVar( $sub, 'text.value', $upload_maxwidth_thumbnail );
    881 $vtp->closeSession( $sub, 'text' );
    882 $vtp->setVar($sub,'param_line.def',$lang['conf_upload_maxwidth_thumbnail_info']);
    883 $vtp->closeSession( $sub, 'param_line' );
    884 $vtp->closeSession( $sub, 'line' );
    885 // maxheight for thumbnail
    886 $vtp->addSession( $sub, 'line' );
    887 $vtp->addSession( $sub, 'param_line' );
    888 $vtp->setVar( $sub,'param_line.name',$lang['conf_upload_maxheight_thumbnail']);
    889 $vtp->addSession( $sub, 'text' );
    890 $vtp->setVar( $sub, 'text.name', 'upload_maxheight_thumbnail' );
    891 $vtp->setVar( $sub, 'text.value', $upload_maxheight_thumbnail );
    892 $vtp->closeSession( $sub, 'text' );
    893 $vtp->setVar( $sub, 'param_line.def', $lang['conf_upload_maxheight_thumbnail_info']);
    894 $vtp->closeSession( $sub, 'param_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 //------------------------------------------------------ sessions configuration
    902 $vtp->addSession( $sub, 'line' );
    903 $vtp->addSession( $sub, 'title_line' );
    904 $vtp->setVar( $sub, 'title_line.title', $lang['conf_session_title'] );
    905 $vtp->closeSession( $sub, 'title_line' );
    906 $vtp->closeSession( $sub, 'line' );
    907 
    908 $vtp->addSession( $sub, 'line' );
    909 $vtp->addSession( $sub, 'space_line' );
    910 $vtp->closeSession( $sub, 'space_line' );
    911 $vtp->closeSession( $sub, 'line' );
    912 // authorize cookies ?
    913 $vtp->addSession( $sub, 'line' );
    914 $vtp->addSession( $sub, 'param_line' );
    915 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_cookie'] );
    916 $vtp->addSession( $sub, 'group' );
    917 $vtp->addSession( $sub, 'radio' );
    918 $vtp->setVar( $sub, 'radio.name', 'authorize_cookies' );
    919 $vtp->setVar( $sub, 'radio.value', 'true' );
    920 $checked = '';
    921 if ( $authorize_cookies == 'true' )
    922 {
    923   $checked = ' checked="checked"';
    924 }
    925 $vtp->setVar( $sub, 'radio.checked', $checked );
    926 $vtp->setVar( $sub, 'radio.option', $lang['yes'] );
    927 $vtp->closeSession( $sub, 'radio' );
    928 $vtp->addSession( $sub, 'radio' );
    929 $vtp->setVar( $sub, 'radio.name', 'authorize_cookies' );
    930 $vtp->setVar( $sub, 'radio.value', 'false' );
    931 $checked = '';
    932 if ( $authorize_cookies == 'false' )
    933 {
    934   $checked = ' checked="checked"';
    935 }
    936 $vtp->setVar( $sub, 'radio.checked', $checked );
    937 $vtp->setVar( $sub, 'radio.option', $lang['no'] );
    938 $vtp->closeSession( $sub, 'radio' );
    939 $vtp->closeSession( $sub, 'group' );
    940 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_cookie_info'] );
    941 $vtp->closeSession( $sub, 'param_line' );
    942 $vtp->closeSession( $sub, 'line' );
    943 // session size
    944 $vtp->addSession( $sub, 'line' );
    945 $vtp->addSession( $sub, 'param_line' );
    946 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_size'] );
    947 $vtp->addSession( $sub, 'text' );
    948 $vtp->setVar( $sub, 'text.name', 'session_id_size' );
    949 $vtp->setVar( $sub, 'text.value', $session_id_size );
    950 $vtp->closeSession( $sub, 'text' );
    951 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_size_info']);
    952 $vtp->closeSession( $sub, 'param_line' );
    953 $vtp->closeSession( $sub, 'line' );
    954 // session length
    955 $vtp->addSession( $sub, 'line' );
    956 $vtp->addSession( $sub, 'param_line' );
    957 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_time'] );
    958 $vtp->addSession( $sub, 'text' );
    959 $vtp->setVar( $sub, 'text.name', 'session_time' );
    960 $vtp->setVar( $sub, 'text.value', $session_time );
    961 $vtp->closeSession( $sub, 'text' );
    962 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_time_info']);
    963 $vtp->closeSession( $sub, 'param_line' );
    964 $vtp->closeSession( $sub, 'line' );
    965 // session keyword
    966 $vtp->addSession( $sub, 'line' );
    967 $vtp->addSession( $sub, 'param_line' );
    968 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_key'] );
    969 $vtp->addSession( $sub, 'text' );
    970 $vtp->setVar( $sub, 'text.name', 'session_keyword' );
    971 $vtp->setVar( $sub, 'text.value', $session_keyword );
    972 $vtp->closeSession( $sub, 'text' );
    973 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_key_info']);
    974 $vtp->closeSession( $sub, 'param_line' );
    975 $vtp->closeSession( $sub, 'line' );
    976 // session deletion
    977 $vtp->addSession( $sub, 'line' );
    978 $vtp->addSession( $sub, 'param_line' );
    979 $vtp->setVar( $sub, 'param_line.name', $lang['conf_session_delete'] );
    980 $vtp->addSession( $sub, 'check' );
    981 $vtp->addSession( $sub, 'box' );
    982 $vtp->setVar( $sub, 'box.name', 'empty_session_table' );
    983 $vtp->setVar( $sub, 'box.value', '1' );
    984 $vtp->setVar( $sub, 'box.checked', ' checked="checked"' );
    985 $vtp->closeSession( $sub, 'box' );
    986 $vtp->closeSession( $sub, 'check' );
    987 $vtp->setVar( $sub, 'param_line.def', $lang['conf_session_delete_info'] );
    988 $vtp->closeSession( $sub, 'param_line' );
    989 $vtp->closeSession( $sub, 'line' );
    990 
    991 $vtp->addSession( $sub, 'line' );
    992 $vtp->addSession( $sub, 'space_line' );
    993 $vtp->closeSession( $sub, 'space_line' );
    994 $vtp->closeSession( $sub, 'line' );
     318    $template->assign_block_vars('errors.error',array('ERROR'=>$error[$i]));
     319  }
     320}
     321elseif ( isset( $_POST['submit'] ) )
     322{
     323  $template->assign_block_vars('confirmation' ,array());
     324}
    995325//------------------------------------------------ remote sites administration
    996326$query = 'select id,galleries_url';
    997 $query.= ' from '.PREFIX_TABLE.'sites';
     327$query.= ' from '.SITES_TABLE;
    998328$query.= " where galleries_url <> './galleries/';";
    999329$result = mysql_query( $query );
     
    1019349}
    1020350//----------------------------------------------------------- sending html code
    1021 $vtp->Parse( $handle , 'sub', $sub );
     351$template->assign_var_from_handle('ADMIN_CONTENT', 'config');
    1022352?>
Note: See TracChangeset for help on using the changeset viewer.