1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

Remove need for session_ids for "allowed" bots, dump user_founder/user_active in favour of user_type, new user_type, USER_IGNORE

git-svn-id: file:///svn/phpbb/trunk@4603 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2003-10-15 17:43:07 +00:00
parent 8661a45de5
commit a47fa4d6ca
21 changed files with 425 additions and 251 deletions

View File

@@ -357,7 +357,7 @@ function avatar_upload($data, &$error)
}
unset($url_ary);
$tmp_path = (!@ini_get('safe_mode')) ? false : $phpbb_root_path . 'cache/tmp';
$tmp_path = (!@ini_get('safe_mode')) ? false : $phpbb_root_path . 'cache';
$filename = tempnam($tmp_path, uniqid(rand()) . '-');
if (!($fp = @fopen($filename, 'wb')))
@@ -389,7 +389,7 @@ function avatar_upload($data, &$error)
// Replace any chars which may cause us problems with _
$bad_chars = array(' ', '/', ':', '*', '?', '"', '<', '>', '|');
$data['filename'] = $user->data['user_id'] . '_' . str_replace($bad_chars, '_', $realname) . '.' . $filetype;
$data['filename'] = $data['user_id'] . '_' . str_replace($bad_chars, '_', $realname) . '.' . $filetype;
$data['width'] = $width;
$data['height'] = $height;
@@ -415,6 +415,48 @@ function avatar_upload($data, &$error)
return $data;
}
function avatar_gallery($category, &$error)
{
global $config;
$path = $phpbb_root_path . $config['avatar_gallery_path'];
// To be replaced with SQL ... before M3 completion
$dp = @opendir($path);
$data = array();
$avatar_row_count = $avatar_col_count = 0;
while ($file = readdir($dp))
{
if ($file{0} != '.' && is_dir("$path/$file"))
{
$dp2 = @opendir("$path/$file");
while ($sub_file = readdir($dp2))
{
if (preg_match('#\.(gif$|png$|jpg|jpeg)$#i', $sub_file))
{
$data[$file][$avatar_row_count][$avatar_col_count]['file'] = "$file/$sub_file";
$data[$file][$avatar_row_count][$avatar_col_count]['name'] = ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $sub_file)));
$avatar_col_count++;
if ($avatar_col_count == 4)
{
$avatar_row_count++;
$avatar_col_count = 0;
}
}
}
closedir($dp2);
}
}
closedir($dp);
@ksort($data);
return $data;
}
// Generates an alphanumeric random string of given length
function gen_rand_string($num_chars)
{
@@ -444,7 +486,7 @@ function add_to_group($action, $group_id, $user_id_ary, $username_ary, $colour,
$which_ary = ($user_id_ary) ? 'user_id_ary' : 'username_ary';
if ($$which_ary && !is_array($$which_ary ))
if ($$which_ary && !is_array($$which_ary))
{
$user_id_ary = array($user_id_ary);
}