mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-21 09:03:38 +02:00
Split of langage files
git-svn-id: http://piwigo.org/svn/trunk@364 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -260,15 +260,16 @@ function get_picture_size( $original_width, $original_height,
|
||||
// disponibles pour PhpWebGallery
|
||||
function get_languages( $rep_language )
|
||||
{
|
||||
global $lang;
|
||||
$languages = array();
|
||||
$i = 0;
|
||||
if ( $opendir = opendir ( $rep_language ) )
|
||||
{
|
||||
while ( $file = readdir ( $opendir ) )
|
||||
{
|
||||
if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') )
|
||||
if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') && isset($lang['lang'][$file]))
|
||||
{
|
||||
$languages[$i++] =$file;
|
||||
$languages[$i++] =$lang['lang'][$file];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,7 +388,7 @@ function notify( $type, $infos = '' )
|
||||
$options = '-f '.$conf['mail_webmaster'];
|
||||
// retrieving all administrators
|
||||
$query = 'SELECT username,mail_address,language';
|
||||
$query.= ' FROM '.PREFIX_TABLE.'users';
|
||||
$query.= ' FROM '.USERS_TABLE;
|
||||
$query.= " WHERE status = 'admin'";
|
||||
$query.= ' AND mail_address IS NOT NULL';
|
||||
$query.= ';';
|
||||
@@ -460,57 +461,4 @@ function pwg_debug( $string )
|
||||
$debug.= "\n";
|
||||
}
|
||||
|
||||
//
|
||||
// Initialise user settings on page load
|
||||
function init_userprefs($userdata)
|
||||
{
|
||||
global $conf, $template, $lang, $phpwg_root_path;
|
||||
|
||||
$style = $conf['default_style'];
|
||||
if ( !$userdata['is_the_guest'] )
|
||||
{
|
||||
if ( !empty($userdata['language']))
|
||||
{
|
||||
$conf['default_lang'] = $userdata['language'];
|
||||
}
|
||||
if ( !empty($userdata['template']))
|
||||
{
|
||||
$style = $userdata['template'];
|
||||
}
|
||||
}
|
||||
|
||||
if ( !file_exists(@realpath($phpwg_root_path . 'language/' . $conf['default_lang'] . '/lang_main.php')) )
|
||||
{
|
||||
$conf['default_lang'] = 'english';
|
||||
}
|
||||
|
||||
include_once($phpwg_root_path . 'language/' . $conf['default_lang'] . '/lang_main.php');
|
||||
$template= setup_style($style);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
function setup_style($style)
|
||||
{
|
||||
global $phpwg_root_path;
|
||||
|
||||
$template_path = 'template/' ;
|
||||
$template_name = $style ;
|
||||
|
||||
$template = new Template($phpwg_root_path . $template_path . $template_name);
|
||||
return $template;
|
||||
}
|
||||
|
||||
function encode_ip($dotquad_ip)
|
||||
{
|
||||
$ip_sep = explode('.', $dotquad_ip);
|
||||
return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);
|
||||
}
|
||||
|
||||
function decode_ip($int_ip)
|
||||
{
|
||||
$hexipbang = explode('.', chunk_split($int_ip, 2, '.'));
|
||||
return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user