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

Split of langage files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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?>
Note: See TracChangeset for help on using the changeset viewer.