Changeset 364 for trunk/include/functions.inc.php
- Timestamp:
- Feb 19, 2004, 1:31:09 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r362 r364 261 261 function get_languages( $rep_language ) 262 262 { 263 global $lang; 263 264 $languages = array(); 264 265 $i = 0; … … 267 268 while ( $file = readdir ( $opendir ) ) 268 269 { 269 if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') )270 if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') && isset($lang['lang'][$file])) 270 271 { 271 $languages[$i++] =$ file;272 $languages[$i++] =$lang['lang'][$file]; 272 273 } 273 274 } … … 388 389 // retrieving all administrators 389 390 $query = 'SELECT username,mail_address,language'; 390 $query.= ' FROM '. PREFIX_TABLE.'users';391 $query.= ' FROM '.USERS_TABLE; 391 392 $query.= " WHERE status = 'admin'"; 392 393 $query.= ' AND mail_address IS NOT NULL'; … … 461 462 } 462 463 463 //464 // Initialise user settings on page load465 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 516 464 ?>
Note: See TracChangeset
for help on using the changeset viewer.