Changeset 364 for trunk


Ignore:
Timestamp:
Feb 19, 2004, 1:31:09 AM (20 years ago)
Author:
gweltas
Message:

Split of langage files

Location:
trunk
Files:
6 added
2 deleted
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/about.php

    r362 r364  
    2727
    2828//----------------------------------------------------------- include
    29 $phpwg_root_path = './';
    30 include_once( $phpwg_root_path.'include/common.inc.php' );
     29define('PHPWG_ROOT_PATH','./');
     30include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3131//----------------------------------------------------- template initialization
    3232//
  • trunk/admin.php

    r362 r364  
    2727
    2828//----------------------------------------------------------- include
    29 $phpwg_root_path = './';
    30 include_once( $phpwg_root_path.'include/common.inc.php' );
     29define('PHPWG_ROOT_PATH','./');
     30include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3131include_once( './admin/include/isadmin.inc.php' );
    3232//----------------------------------------------------- template initialization
     
    5555   if ( !is_numeric( $_GET['user_id'] ) ) $_GET['user_id'] = -1;
    5656   $query = 'SELECT status,username';
    57    $query.= ' FROM '.PREFIX_TABLE.'users';
     57   $query.= ' FROM '.USERS_TABLE;
    5858   $query.= ' WHERE id = '.$_GET['user_id'];
    5959   $query.= ';';
  • trunk/admin/cat_modify.php

    r362 r364  
    100100  // checking users favorites
    101101  $query = 'SELECT id';
    102   $query.= ' FROM '.PREFIX_TABLE.'users';
     102  $query.= ' FROM '.USERS_TABLE;
    103103  $query.= ';';
    104104  $result = mysql_query( $query );
  • trunk/admin/cat_perm.php

    r362 r364  
    7676  mysql_query( $query );
    7777  $query = 'SELECT id';
    78   $query.= ' FROM '.PREFIX_TABLE.'users';
     78  $query.= ' FROM '.USERS_TABLE;
    7979  $query.= ';';
    8080  $result = mysql_query( $query );
     
    138138//----------------------------------------------------------------------- users
    139139$query = 'SELECT id,username,status';
    140 $query.= ' FROM '.PREFIX_TABLE.'users';
     140$query.= ' FROM '.USERS_TABLE;
    141141// only the webmaster can modify webmaster's permissions
    142142if ( $user['username'] != $conf['webmaster'] )
  • trunk/admin/configuration.php

    r362 r364  
    218218    mysql_query( $query );
    219219
    220     $query = 'UPDATE '.PREFIX_TABLE.'users';
     220    $query = 'UPDATE '.USERS_TABLE;
    221221    $query.= ' SET';
    222222    foreach ( $default_user_infos as $i => $default_user_info ) {
     
    258258
    259259  $query  = 'SELECT '.implode( ',', $default_user_infos );
    260   $query.= ' FROM '.PREFIX_TABLE.'users';
     260  $query.= ' FROM '.USERS_TABLE;
    261261  $query.= " WHERE username = 'guest'";
    262262  $query.= ';';
  • trunk/admin/group_perm.php

    r362 r364  
    6262  // checking users favorites
    6363  $query = 'SELECT id';
    64   $query.= ' FROM '.PREFIX_TABLE.'users';
     64  $query.= ' FROM '.USERS_TABLE;
    6565  $query.= ';';
    6666  $result = mysql_query( $query );
  • trunk/admin/include/functions.php

    r362 r364  
    283283
    284284  // destruction of the user
    285   $query = 'DELETE FROM '.PREFIX_TABLE.'users';
     285  $query = 'DELETE FROM '.USERS_TABLE;
    286286  $query.= ' WHERE id = '.$user_id;
    287287  $query.= ';';
     
    323323{
    324324  $query = 'SELECT status,forbidden_categories';
    325   $query.= ' FROM '.PREFIX_TABLE.'users';
     325  $query.= ' FROM '.USERS_TABLE;
    326326  $query.= ' WHERE id = '.$user_id;
    327327  $query.= ';';
     
    853853 
    854854  $query = 'SELECT id';
    855   $query.= ' FROM '.PREFIX_TABLE.'users';
     855  $query.= ' FROM '.USERS_TABLE;
    856856  $query.= ';';
    857857  $result = mysql_query( $query );
     
    902902 
    903903  $query = 'SELECT id';
    904   $query.= ' FROM '.PREFIX_TABLE.'users';
     904  $query.= ' FROM '.USERS_TABLE;
    905905  $query.= ', '.PREFIX_TABLE.'user_group';
    906906  $query.= ' WHERE group_id = '.$group_id;
     
    927927
    928928  // update the users.forbidden_categories in database
    929   $query = 'UPDATE '.PREFIX_TABLE.'users';
     929  $query = 'UPDATE '.USERS_TABLE;
    930930  $query.= ' SET forbidden_categories = ';
    931931  if ( count( $restrictions ) > 0 )
     
    951951 
    952952  $query = 'SELECT status';
    953   $query.= ' FROM '.PREFIX_TABLE.'users';
     953  $query.= ' FROM '.USERS_TABLE;
    954954  $query.= ' WHERE id = '.$user_id;
    955955  $query.= ';';
  • trunk/admin/include/isadmin.inc.php

    r362 r364  
    2929
    3030$isadmin = true;
    31 include_once( './language/'.$user['language'].'/lang_admin.php' );
    32 
    3331if ( $user['status'] != 'admin' )
    3432{
  • trunk/admin/user_list.php

    r362 r364  
    6262{
    6363  $query = 'SELECT username';
    64   $query.= ' FROM '.PREFIX_TABLE.'users';
     64  $query.= ' FROM '.USERS_TABLE;
    6565  $query.= ' WHERE id = '.$_GET['delete'];
    6666  $query.= ';';
     
    8686    {
    8787      $query = 'SELECT COUNT(*) AS nb_result';
    88       $query.= ' FROM '.PREFIX_TABLE.'users';
     88      $query.= ' FROM '.USERS_TABLE;
    8989      $query.= ' WHERE id = '.$_GET['delete'];
    9090      $query.= ';';
     
    132132
    133133  $query = 'SELECT id,username,status,mail_address';
    134   $query.= ' FROM '.PREFIX_TABLE.'users';
     134  $query.= ' FROM '.USERS_TABLE;
    135135  $query.= ' ORDER BY status ASC, username ASC';
    136136  $query.= ';';
     
    234234    $mails = array();
    235235    $query = 'SELECT id,mail_address';
    236     $query.= ' FROM '.PREFIX_TABLE.'users';
     236    $query.= ' FROM '.USERS_TABLE;
    237237    $query.= ';';
    238238    $result = mysql_query( $query );
  • trunk/admin/user_modify.php

    r362 r364  
    4242$query = 'select';
    4343$query.= ' username,status,mail_address';
    44 $query.= ' from '.PREFIX_TABLE.'users';
     44$query.= ' from '.USERS_TABLE;
    4545$query.= ' where id = '.$_GET['user_id'];
    4646$query.= ';';
  • trunk/category.php

    r362 r364  
    2727
    2828//--------------------------------------------------------------------- include
    29 $phpwg_root_path = './';
    30 include_once( $phpwg_root_path.'include/common.inc.php' );
     29define('PHPWG_ROOT_PATH','./');
     30include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3131//---------------------------------------------------------------------- logout
    3232if ( isset( $_GET['act'] )
     
    190190}
    191191
    192 // favorites management
     192// authentification mode management
    193193if ( !$user['is_the_guest'] )
    194194{
     
    199199  $row = mysql_fetch_array( $result );
    200200  $template->assign_block_vars('favorites', array ('NB_FAV'=>$row['count']) );
     201  $template->assign_block_vars('username', array());
    201202}
    202203//--------------------------------------------------------------------- summary
  • trunk/comments.php

    r362 r364  
    2727
    2828//----------------------------------------------------------- include
    29 $phpwg_root_path = './';
    30 include_once( $phpwg_root_path.'include/common.inc.php' );
     29define('PHPWG_ROOT_PATH','./');
     30include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3131
    3232//--------------------------------------------------- number of days to display
  • trunk/identification.php

    r362 r364  
    2727
    2828//----------------------------------------------------------- include
    29 $phpwg_root_path = './';
    30 include_once( $phpwg_root_path.'include/common.inc.php' );
     29define('PHPWG_ROOT_PATH','./');
     30include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3131
    3232//-------------------------------------------------------------- identification
  • trunk/include/common.inc.php

    r362 r364  
    2525// | USA.                                                                  |
    2626// +-----------------------------------------------------------------------+
    27 
    28 // determine the initial instant to indicate the generation time of this
    29 // page
     27if( !defined("PHPWG_ROOT_PATH") )
     28{
     29        die ("Hacking attempt!");
     30}
     31// determine the initial instant to indicate the generation time of this page
    3032$t1 = explode( ' ', microtime() );
    3133$t2 = explode( '.', $t1[0] );
     
    110112$lang = array();
    111113
     114
     115include(PHPWG_ROOT_PATH .'config.php');
    112116if( !defined("PHPWG_INSTALLED") )
    113117{
     
    116120}
    117121
    118 include( $phpwg_root_path.'include/constants.php' );
    119 include( $phpwg_root_path.'include/functions.inc.php' );
    120 include( $phpwg_root_path.'include/template.php' );
    121 include( $phpwg_root_path.'include/vtemplate.class.php' );
    122 include( $phpwg_root_path.'include/config.inc.php' );
     122
     123include(PHPWG_ROOT_PATH . 'include/constants.php');
     124include(PHPWG_ROOT_PATH . 'include/functions.inc.php');
     125include(PHPWG_ROOT_PATH . 'include/template.php');
     126include(PHPWG_ROOT_PATH . 'include/vtemplate.class.php');
     127include(PHPWG_ROOT_PATH . 'include/config.inc.php');
    123128
    124129//
     
    198203//---------------
    199204
    200 include($phpwg_root_path . 'include/user.inc.php');
     205include(PHPWG_ROOT_PATH . 'include/user.inc.php');
    201206
    202207// displaying the username in the language of the connected user, instead of
  • trunk/include/config.inc.php

    r363 r364  
    5555$conf['max_LOV_categories'] = 50;
    5656
    57 $conf['default_lang'] = 'francais';
     57$conf['default_lang'] = 'fr_FR';
    5858$conf['default_style'] = 'default';
    5959
  • trunk/include/functions.inc.php

    r362 r364  
    261261function get_languages( $rep_language )
    262262{
     263  global $lang;
    263264  $languages = array();
    264265  $i = 0;
     
    267268    while ( $file = readdir ( $opendir ) )
    268269    {
    269       if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') )
     270      if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') && isset($lang['lang'][$file]))
    270271      {
    271         $languages[$i++] =$file;
     272        $languages[$i++] =$lang['lang'][$file];
    272273      }
    273274    }
     
    388389  // retrieving all administrators
    389390  $query = 'SELECT username,mail_address,language';
    390   $query.= ' FROM '.PREFIX_TABLE.'users';
     391  $query.= ' FROM '.USERS_TABLE;
    391392  $query.= " WHERE status = 'admin'";
    392393  $query.= ' AND mail_address IS NOT NULL';
     
    461462}
    462463
    463 //
    464 // Initialise user settings on page load
    465 function init_userprefs($userdata)
    466 {
    467         global $conf, $template, $lang, $phpwg_root_path;
    468        
    469         $style = $conf['default_style'];
    470         if ( !$userdata['is_the_guest'] )
    471         {
    472                 if ( !empty($userdata['language']))
    473                 {
    474                         $conf['default_lang'] = $userdata['language'];
    475                 }
    476                 if ( !empty($userdata['template']))
    477                 {
    478                         $style = $userdata['template'];
    479                 }
    480         }
    481 
    482         if ( !file_exists(@realpath($phpwg_root_path . 'language/' . $conf['default_lang'] . '/lang_main.php')) )
    483         {
    484                 $conf['default_lang'] = 'english';
    485         }
    486        
    487         include_once($phpwg_root_path . 'language/' . $conf['default_lang'] . '/lang_main.php');
    488         $template= setup_style($style);
    489 
    490         return;
    491 }
    492 
    493 function setup_style($style)
    494 {
    495         global $phpwg_root_path;
    496 
    497         $template_path = 'template/' ;
    498         $template_name = $style ;
    499 
    500         $template = new Template($phpwg_root_path . $template_path . $template_name);
    501         return $template;
    502 }
    503 
    504 function encode_ip($dotquad_ip)
    505 {
    506         $ip_sep = explode('.', $dotquad_ip);
    507         return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);
    508 }
    509 
    510 function decode_ip($int_ip)
    511 {
    512         $hexipbang = explode('.', chunk_split($int_ip, 2, '.'));
    513         return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
    514 }
    515 
    516464?>
  • trunk/include/functions_session.inc.php

    r362 r364  
    7676  // 2. retrieving id of the username given in parameter
    7777  $query = 'select id';
    78   $query.= ' from '.PREFIX_TABLE.'users';
     78  $query.= ' from '.USERS_TABLE;
    7979  $query.= " where username = '".$username."';";
    8080  $row = mysql_fetch_array( mysql_query( $query ) );
  • trunk/include/functions_user.inc.php

    r362 r364  
    6767  {
    6868    $query = 'SELECT id';
    69     $query.= ' FROM '.PREFIX_TABLE.'users';
     69    $query.= ' FROM '.USERS_TABLE;
    7070    $query.= " WHERE username = '".$login."'";
    7171    $query.= ';';
     
    9393      $query.= $infos[$i];
    9494    }
    95     $query.= ' FROM '.PREFIX_TABLE.'users';
     95    $query.= ' FROM '.USERS_TABLE;
    9696    $query.= " WHERE username = 'guest'";
    9797    $query.= ';';
    9898    $row = mysql_fetch_array( mysql_query( $query ) );
    9999    // 2. adding new user
    100     $query = 'INSERT INTO '.PREFIX_TABLE.'users';
     100    $query = 'INSERT INTO '.USERS_TABLE;
    101101    $query.= ' (';
    102102    $query.= ' username,password,mail_address,status';
     
    120120    // 3. retrieving the id of the newly created user
    121121    $query = 'SELECT id';
    122     $query.= ' FROM '.PREFIX_TABLE.'users';
     122    $query.= ' FROM '.USERS_TABLE;
    123123    $query.= " WHERE username = '".$login."';";
    124124    $row = mysql_fetch_array( mysql_query( $query ) );
     
    189189  if ( sizeof( $error ) == 0 )
    190190  {
    191     $query = 'UPDATE '.PREFIX_TABLE.'users';
     191    $query = 'UPDATE '.USERS_TABLE;
    192192    $query.= " SET status = '".$status."'";
    193193    if ( $use_new_password )
     
    225225  }
    226226}
     227
     228//
     229// Initialise user settings on page load
     230function init_userprefs($userdata)
     231{
     232  global $conf, $template, $lang, $lang_mapping;
     233  $style = $conf['default_style'];
     234  if ( !$userdata['is_the_guest'] )
     235  {
     236    if ( !empty($userdata['language']))
     237    {
     238      $conf['default_lang'] = $userdata['language'];
     239    }
     240    if ( !empty($userdata['template']))
     241    {
     242      $style = $userdata['template'];
     243    }
     244  }
     245
     246  if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/common.lang.php')) )
     247  {
     248    $conf['default_lang'] = 'en_EN';
     249  }
     250  include_once(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/common.lang.php');
     251 
     252  if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/lang.lang.php')) )
     253  {
     254    $conf['default_lang'] = 'en_EN';
     255  }
     256  include_once(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/lang.lang.php');
     257 
     258  if ($userdata['status'] == 'admin')
     259  {
     260    $admin_lang = $userdata['language'];
     261    if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $conf['default_lang'] . '/admin.lang.php')) )
     262    {
     263      $admin_lang = 'en_EN';
     264    }
     265        include_once(PHPWG_ROOT_PATH . 'language/' . $admin_lang . '/admin.lang.php');
     266  }
     267
     268  $template= setup_style($style);
     269  return;
     270}
     271
     272function setup_style($style)
     273{
     274        $template_path = 'template/' ;
     275        $template_name = $style ;
     276
     277        $template = new Template(PHPWG_ROOT_PATH . $template_path . $template_name);
     278        return $template;
     279}
     280
     281function encode_ip($dotquad_ip)
     282{
     283        $ip_sep = explode('.', $dotquad_ip);
     284        return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);
     285}
     286
     287function decode_ip($int_ip)
     288{
     289        $hexipbang = explode('.', chunk_split($int_ip, 2, '.'));
     290        return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
     291}
    227292?>
  • trunk/index.php

    r362 r364  
    2727
    2828//----------------------------------------------------------- include
    29 $phpwg_root_path = './';
    30 include_once( $phpwg_root_path.'include/common.inc.php' );
     29define('PHPWG_ROOT_PATH','./');
     30include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3131if ( $conf['access'] == 'restricted' )
    3232{
  • trunk/picture.php

    r362 r364  
    2626// +-----------------------------------------------------------------------+
    2727//----------------------------------------------------------- include
    28 $phpwg_root_path = './';
    29 include_once( $phpwg_root_path.'include/common.inc.php' );   
     28define('PHPWG_ROOT_PATH','./');
     29include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );   
    3030//-------------------------------------------------- access authorization check
    3131check_cat_id( $_GET['cat'] );
     
    577577    {
    578578      $query = 'SELECT COUNT(*) AS user_exists';
    579       $query.= ' FROM '.PREFIX_TABLE.'users';
     579      $query.= ' FROM '.USERS_TABLE;
    580580      $query.= " WHERE username = '".$author."'";
    581581      $query.= ';';
  • trunk/profile.php

    r362 r364  
    2828// customize appearance of the site for a user
    2929//----------------------------------------------------------- include
    30 $phpwg_root_path = './';
    31 include_once( $phpwg_root_path.'include/common.inc.php' );
     30define('PHPWG_ROOT_PATH','./');
     31include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3232//-------------------------------------------------- access authorization check
    3333check_login_authorization();
     
    8686  if ( count( $errors ) == 0 )
    8787  {
    88     $query = 'UPDATE '.PREFIX_TABLE.'users';
     88    $query = 'UPDATE '.USERS_TABLE;
    8989    $query.= ' SET ';
    9090    foreach ( $infos as $i => $info ) {
     
    101101    if ( isset( $_POST['use_new_pwd'] ) )
    102102    {
    103       $query = 'UPDATE '.PREFIX_TABLE.'users';
     103      $query = 'UPDATE '.USERS_TABLE;
    104104      $query.= " SET password = '".md5( $_POST['password'] )."'";
    105105      $query.= ' WHERE id = '.$user['id'];
     
    112112                 cookie_path() );
    113113      // update the expiration date of the session
    114       $query = 'UPDATE '.PREFIX_TABLE.'sessions';
     114      $query = 'UPDATE '.SESSIONS_TABLE;
    115115      $query.= ' SET expiration = '.$_POST['cookie_expiration'];
    116116      $query.= " WHERE id = '".$page['session_id']."'";
     
    134134include('include/page_header.php');
    135135
    136 $handle = $vtp->Open( './template/'.$user['template'].'/profile.vtp' );
     136$template->set_filenames(array('profile'=>'profile.tpl'));
    137137initialize_template();
    138 $tpl = array( 'customize_title','password','new',
    139               'reg_confirm','submit','create_cookie' );
    140 templatize_array( $tpl, 'lang', $handle );
    141 //----------------------------------------------------------------- form action
    142 $url = './profile.php';
    143 $vtp->setGlobalVar( $handle, 'form_action', add_session_id( $url ) );
     138
     139$template->assign_vars(array(
     140  'L_TITLE' => $lang['customize_title'],
     141  'L_PASSWORD' => $lang['password'],
     142  'L_NEW' =>  $lang['new'],
     143  'L_CONFIRM' =>  $lang['reg_confirm'],
     144  'L_SUBMIT' =>  $lang['submit'],
     145  'L_COOKIE' =>  $lang['create_cookie'],
     146       
     147  'F_ACTION' => add_session_id( './profile.php' ),
     148
     149  'U_RETURN' => add_session_id('./category.php?'.$_SERVER['QUERY_STRING'])
     150  ));
     151       
    144152//-------------------------------------------------------------- errors display
    145 if ( count( $errors ) != 0 )
    146 {
    147   $vtp->addSession( $handle, 'errors' );
    148   foreach ( $errors as $error ) {
    149     $vtp->addSession( $handle, 'li' );
    150     $vtp->setVar( $handle, 'li.li', $error );
    151     $vtp->closeSession( $handle, 'li' );
    152   }
    153   $vtp->closeSession( $handle, 'errors' );
    154 }
    155 //---------------------------------------------------- number of images per row
    156 if ( in_array( 'nb_image_line', $infos ) )
    157 {
    158   $vtp->addSession( $handle, 'line' );
    159   $vtp->setVar( $handle, 'line.name', $lang['customize_nb_image_per_row'] );
    160   $vtp->addSession( $handle, 'select' );
    161   $vtp->setVar( $handle, 'select.name', 'nb_image_line' );
    162   for ( $i = 0; $i < sizeof( $conf['nb_image_row'] ); $i++ )
    163   {
    164     $vtp->addSession( $handle, 'option' );
    165     $vtp->setVar( $handle, 'option.option', $conf['nb_image_row'][$i] );
    166     if ( $conf['nb_image_row'][$i] == $user['nb_image_line'] )
    167     {
    168       $vtp->setVar( $handle, 'option.selected', ' selected="selected"' );
    169     }
    170     $vtp->closeSession( $handle, 'option' );
    171   }
    172   $vtp->closeSession( $handle, 'select' );
    173   $vtp->closeSession( $handle, 'line' );
    174 }
    175 //------------------------------------------------------ number of row per page
    176 if ( in_array( 'nb_line_page', $infos ) )
    177 {
    178   $vtp->addSession( $handle, 'line' );
    179   $vtp->setVar( $handle, 'line.name', $lang['customize_nb_row_per_page'] );
    180   $vtp->addSession( $handle, 'select' );
    181   $vtp->setVar( $handle, 'select.name', 'nb_line_page' );
    182   for ( $i = 0; $i < sizeof( $conf['nb_row_page'] ); $i++ )
    183   {
    184     $vtp->addSession( $handle, 'option' );
    185     $vtp->setVar( $handle, 'option.option', $conf['nb_row_page'][$i] );
    186     if ( $conf['nb_row_page'][$i] == $user['nb_line_page'] )
    187     {
    188       $vtp->setVar( $handle, 'option.selected', ' selected="selected"' );
    189     }
    190     $vtp->closeSession( $handle, 'option' );
    191   }
    192   $vtp->closeSession( $handle, 'select' );
    193   $vtp->closeSession( $handle, 'line' );
    194 }
    195 //-------------------------------------------------------------------- template
    196 if ( in_array( 'template', $infos ) )
    197 {
    198   $vtp->addSession( $handle, 'line' );
    199   $vtp->setVar( $handle, 'line.name', $lang['customize_template'] );
    200   $vtp->addSession( $handle, 'select' );
    201   $vtp->setVar( $handle, 'select.name', 'template' );
    202   $option = get_dirs( './template' );
    203   for ( $i = 0; $i < sizeof( $option ); $i++ )
    204   {
    205     $vtp->addSession( $handle, 'option' );
    206     $vtp->setVar( $handle, 'option.option', $option[$i] );
    207     if ( $option[$i] == $user['template'] )
    208     {
    209       $vtp->setVar( $handle, 'option.selected', ' selected="selected"' );
    210     }
    211     $vtp->closeSession( $handle, 'option' );
    212   }
    213   $vtp->closeSession( $handle, 'select' );
    214   $vtp->closeSession( $handle, 'line' );
    215 }
    216 //-------------------------------------------------------------------- language
    217 if ( in_array( 'language', $infos ) )
    218 {
    219   $vtp->addSession( $handle, 'line' );
    220   $vtp->setVar( $handle, 'line.name', $lang['customize_language'] );
    221   $vtp->addSession( $handle, 'select' );
    222   $vtp->setVar( $handle, 'select.name', 'language' );
    223   $option = get_languages( './language/' );
    224   for ( $i = 0; $i < sizeof( $option ); $i++ )
    225   {
    226     $vtp->addSession( $handle, 'option' );
    227     $vtp->setVar( $handle, 'option.option', $option[$i] );
    228     if( $option[$i] == $user['language'] )
    229     {
    230       $vtp->setVar( $handle, 'option.selected', ' selected="selected"' );
    231     }
    232     $vtp->closeSession( $handle, 'option' );
    233   }
    234   $vtp->closeSession( $handle, 'select' );
    235   $vtp->closeSession( $handle, 'line' );
    236 }
    237 //---------------------------------------------------------------- short period
    238 if ( in_array( 'short_period', $infos ) )
    239 {
    240   $vtp->addSession( $handle, 'line' );
    241   $vtp->setVar( $handle, 'line.name', $lang['customize_short_period'] );
    242   $vtp->addSession( $handle, 'text' );
    243   $vtp->setVar( $handle, 'text.name', 'short_period' );
    244   $vtp->setVar( $handle, 'text.value', $user['short_period'] );
    245   $vtp->closeSession( $handle, 'text' );
    246   $vtp->closeSession( $handle, 'line' );
    247 }
    248 //----------------------------------------------------------------- long period
    249 if ( in_array( 'long_period', $infos ) )
    250 {
    251   $vtp->addSession( $handle, 'line' );
    252   $vtp->setVar( $handle, 'line.name', $lang['customize_long_period'] );
    253   $vtp->addSession( $handle, 'text' );
    254   $vtp->setVar( $handle, 'text.name', 'long_period' );
    255   $vtp->setVar( $handle, 'text.value', $user['long_period'] );
    256   $vtp->closeSession( $handle, 'text' );
    257   $vtp->closeSession( $handle, 'line' );
    258 }
    259 //--------------------------------------------------------- max displayed width
    260 if ( in_array( 'maxwidth', $infos ) )
    261 {
    262   $vtp->addSession( $handle, 'line' );
    263   $vtp->setVar( $handle, 'line.name', $lang['maxwidth'] );
    264   $vtp->addSession( $handle, 'text' );
    265   $vtp->setVar( $handle, 'text.name', 'maxwidth' );
    266   $vtp->setVar( $handle, 'text.value', $user['maxwidth'] );
    267   $vtp->closeSession( $handle, 'text' );
    268   $vtp->closeSession( $handle, 'line' );
    269 }
    270 //-------------------------------------------------------- max displayed height
    271 if ( in_array( 'maxheight', $infos ) )
    272 {
    273   $vtp->addSession( $handle, 'line' );
    274   $vtp->setVar( $handle, 'line.name', $lang['maxheight'] );
    275   $vtp->addSession( $handle, 'text' );
    276   $vtp->setVar( $handle, 'text.name', 'maxheight' );
    277   $vtp->setVar( $handle, 'text.value', $user['maxheight'] );
    278   $vtp->closeSession( $handle, 'text' );
    279   $vtp->closeSession( $handle, 'line' );
    280 }
    281 //---------------------------------------------------------------- mail address
    282 if ( in_array( 'mail_address', $infos ) )
    283 {
    284   $vtp->addSession( $handle, 'line' );
    285   $vtp->setVar( $handle, 'line.name', $lang['mail_address'] );
    286   $vtp->addSession( $handle, 'text' );
    287   $vtp->setVar( $handle, 'text.name', 'mail_address' );
    288   $vtp->setVar( $handle, 'text.value', $user['mail_address'] );
    289   $vtp->closeSession( $handle, 'text' );
    290   $vtp->closeSession( $handle, 'line' );
    291 }
    292 //----------------------------------------------------- expand all categories ?
    293 if ( in_array( 'expand', $infos ) )
    294 {
    295   $vtp->addSession( $handle, 'line' );
    296   $vtp->setVar( $handle, 'line.name', $lang['customize_expand'] );
    297   $vtp->addSession( $handle, 'group' );
    298   $vtp->addSession( $handle, 'radio' );
    299   $vtp->setVar( $handle, 'radio.name', 'expand' );
    300   $vtp->setVar( $handle, 'radio.value', 'true' );
    301   $checked = '';
    302   if ( $user['expand'] )
    303   {
    304     $checked = ' checked="checked"';
    305   }
    306   $vtp->setVar( $handle, 'radio.checked', $checked );
    307   $vtp->setVar( $handle, 'radio.option', $lang['yes'] );
    308   $vtp->closeSession( $handle, 'radio' );
    309   $vtp->addSession( $handle, 'radio' );
    310   $vtp->setVar( $handle, 'radio.name', 'expand' );
    311   $vtp->setVar( $handle, 'radio.value', 'false' );
    312   $checked = '';
    313   if ( !$user['expand'] )
    314   {
    315     $checked = ' checked="checked"';
    316   }
    317   $vtp->setVar( $handle, 'radio.checked', $checked );
    318   $vtp->setVar( $handle, 'radio.option', $lang['no'] );
    319   $vtp->closeSession( $handle, 'radio' );
    320   $vtp->closeSession( $handle, 'group' );
    321   $vtp->closeSession( $handle, 'line' );
    322 }
    323 //---------------------------------- show number of comments on thumbnails page
    324 if ( in_array( 'show_nb_comments', $infos ) )
    325 {
    326   $vtp->addSession( $handle, 'line' );
    327   $vtp->setVar( $handle, 'line.name', $lang['customize_show_nb_comments'] );
    328   $vtp->addSession( $handle, 'group' );
    329   $vtp->addSession( $handle, 'radio' );
    330   $vtp->setVar( $handle, 'radio.name', 'show_nb_comments' );
    331   $vtp->setVar( $handle, 'radio.value', 'true' );
    332   $checked = '';
    333   if ( $user['show_nb_comments'] )
    334   {
    335     $checked = ' checked="checked"';
    336   }
    337   $vtp->setVar( $handle, 'radio.checked', $checked );
    338   $vtp->setVar( $handle, 'radio.option', $lang['yes'] );
    339   $vtp->closeSession( $handle, 'radio' );
    340   $vtp->addSession( $handle, 'radio' );
    341   $vtp->setVar( $handle, 'radio.name', 'show_nb_comments' );
    342   $vtp->setVar( $handle, 'radio.value', 'false' );
    343   $checked = '';
    344   if ( !$user['show_nb_comments'] )
    345   {
    346     $checked = ' checked="checked"';
    347   }
    348   $vtp->setVar( $handle, 'radio.checked', $checked );
    349   $vtp->setVar( $handle, 'radio.option', $lang['no'] );
    350   $vtp->closeSession( $handle, 'radio' );
    351   $vtp->closeSession( $handle, 'group' );
    352   $vtp->closeSession( $handle, 'line' );
    353 }
     153if ( sizeof( $errors ) != 0 )
     154{
     155  $template->assign_block_vars('errors',array());
     156  for ( $i = 0; $i < sizeof( $errors ); $i++ )
     157  {
     158    $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i]));
     159  }
     160}
     161
     162$template->assign_block_vars('select',array(
     163  'F_LABEL'=>$lang['customize_nb_image_per_row'],
     164  'F_NAME'=>'nb_image_line',
     165  'F_OPTIONS'=>make_jumpbox($conf['nb_image_row'], $user['nb_image_line'])
     166  ));
     167
     168$template->assign_block_vars('select',array(
     169  'F_LABEL'=>$lang['customize_nb_row_per_page'],
     170  'F_NAME'=>'nb_line_page',
     171  'F_OPTIONS'=>make_jumpbox($conf['nb_row_page'], $user['nb_line_page'])
     172  ));
     173
     174$template->assign_block_vars('select',array(
     175  'F_LABEL'=>$lang['customize_template'],
     176  'F_NAME'=>'template',
     177  'F_OPTIONS'=>make_jumpbox(get_dirs( './template' ), $user['template'])
     178  ));
     179
     180$template->assign_block_vars('select',array(
     181  'F_LABEL'=>$lang['customize_language'],
     182  'F_NAME'=>'language',
     183  'F_OPTIONS'=>make_jumpbox($lang['lang'], $user['language'], true)
     184  ));
     185
     186$template->assign_block_vars('text',array(
     187  'F_LABEL'=>$lang['customize_short_period'],
     188  'F_NAME'=>'short_period',
     189  'F_VALUE'=>$user['short_period']
     190  ));
     191
     192$template->assign_block_vars('text',array(
     193  'F_LABEL'=>$lang['customize_long_period'],
     194  'F_NAME'=>'long_period',
     195  'F_VALUE'=>$user['long_period']
     196  ));
     197
     198$template->assign_block_vars('text',array(
     199  'F_LABEL'=>$lang['maxwidth'],
     200  'F_NAME'=>'maxwidth',
     201  'F_VALUE'=>$user['maxwidth']
     202  ));
     203
     204$template->assign_block_vars('text',array(
     205  'F_LABEL'=>$lang['maxheight'],
     206  'F_NAME'=>'maxheight',
     207  'F_VALUE'=>$user['maxheight']
     208  ));
     209
     210$template->assign_block_vars('text',array(
     211  'F_LABEL'=>$lang['mail_address'],
     212  'F_NAME'=>'mail_address',
     213  'F_VALUE'=>$user['mail_address']
     214  ));
     215
     216$template->assign_block_vars('radio',array(
     217  'F_LABEL'=>$lang['customize_expand'],
     218  'F_OPTIONS'=>make_radio('expand', array(true=>$lang['yes'], false=>$lang['no']), $user['expand'], true)
     219  ));
     220
     221$template->assign_block_vars('radio',array(
     222  'F_LABEL'=>$lang['customize_show_nb_comments'],
     223  'F_OPTIONS'=>make_radio('show_nb_comments', array(true=>$lang['yes'], false=>$lang['no']), $user['show_nb_comments'], true)
     224  ));
     225
    354226//--------------------------------------------------------------- create cookie
    355227if ( $conf['authorize_cookies'] )
     
    375247}
    376248//----------------------------------------------------------- html code display
    377 $code = $vtp->Display( $handle, 0 );
    378 echo $code;
     249$template->pparse('profile');
    379250include('include/page_tail.php');
    380251?>
  • trunk/register.php

    r362 r364  
    2727
    2828//----------------------------------------------------------- include
    29 $phpwg_root_path = './';
    30 include_once( $phpwg_root_path.'incelude/common.inc.php' );
     29define('PHPWG_ROOT_PATH','./');
     30include_once( PHPWG_ROOT_PATH.'incelude/common.inc.php' );
    3131//-------------------------------------------------- access authorization check
    3232if ( $conf['access'] == "restricted" )
  • trunk/search.php

    r362 r364  
    2727
    2828//----------------------------------------------------------- include
    29 $phpwg_root_path = './';
    30 include_once( $phpwg_root_path.'include/common.inc.php' );
     29define('PHPWG_ROOT_PATH','./');
     30include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3131//-------------------------------------------------- access authorization check
    3232check_login_authorization();
  • trunk/template/default/about.tpl

    r351 r364  
    22      <tr align="center" valign="middle">
    33        <td>
    4           {F_START}1px{F_BEGIN}
     4          {T_START}1px{T_BEGIN}
    55            <div class="titrePage">{PAGE_TITLE}</div>
    6           {F_END}
     6          {T_END}
    77          <div style="margin-bottom:5px;">&nbsp;</div>
    8           {F_START}50%{F_BEGIN}
     8          {T_START}50%{T_BEGIN}
    99            <div class="menu" style="white-space:normal;margin:10px;">
    1010              {L_ABOUT}
    1111            </div>
    12           {F_END}
     12          {T_END}
    1313          <div style="text-align:center;margin:5px;">
    1414            <a href="{U_RETURN}">{L_RETURN}</a>
  • trunk/template/default/category.tpl

    r355 r364  
    9797                        {T_START}1%{T_BEGIN}
    9898                          <div class="info">
     99                                <!-- BEGIN username -->
    99100                                {L_USER}&nbsp;{USERNAME}<br />
    100                                 {L_RECENT_IMG}&nbsp;{S_SHORT_PERIOD}&nbsp;{L_DAYS}
     101                                <!-- END username -->
     102                                {L_RECENT_IMAGE}&nbsp;{S_SHORT_PERIOD}&nbsp;{L_DAYS}
    101103                                  {T_SHORT}<br />
    102104                                {L_RECENT_IMAGE}&nbsp;{S_LONG_PERIOD}&nbsp;{L_DAYS}
  • trunk/template/default/htmlfunctions.inc.php

    r362 r364  
    233233  }
    234234}
     235
     236function make_jumpbox($value, $selected, $usekeys=false)
     237{
     238  $boxstring = '';
     239  $nb = sizeof( $value);
     240  $keys = ($usekeys?array_keys($value):$value);
     241  $value = ($usekeys?array_values($value):$value);
     242  for ( $i = 0; $i < $nb; $i++ )
     243  {
     244    $boxstring .= '<option value="'.$keys[$i].'"';
     245    if ($selected == $keys[$i]) $boxstring .=' selected="selected"';
     246    $boxstring .='>'.$value[$i].'</option>';
     247  }
     248  return $boxstring;
     249}
     250
     251function make_radio($name, $value, $selected, $usekeys=false)
     252{
     253  $boxstring = '';
     254  $nb = sizeof( $value);
     255  $keys = ($usekeys?array_keys($value):$value);
     256  $value = ($usekeys?array_values($value):$value);
     257  for ( $i = 0; $i < $nb; $i++ )
     258  {
     259    $boxstring .= '<input type="radio" name="'.$name.'" value="'.$keys[$i].'"';
     260    if ($selected == $keys[$i]) $boxstring .=' checked';
     261    $boxstring .='/>'.$value[$i];
     262  }
     263  return $boxstring;
     264}
    235265?>
  • trunk/upload.php

    r362 r364  
    2525// | USA.                                                                  |
    2626// +-----------------------------------------------------------------------+
    27 $phpwg_root_path = './';
    28 include_once( $phpwg_root_path.'include/common.inc.php' );
     27define('PHPWG_ROOT_PATH','./');
     28include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    2929
    3030//------------------------------------------------------------------- functions
Note: See TracChangeset for help on using the changeset viewer.