aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions.inc.php62
1 files changed, 5 insertions, 57 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index d4d10920b..55a4426d7 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -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]);
-}
-
-?>
+?> \ No newline at end of file