diff --git a/e107_admin/image.php b/e107_admin/image.php
index bdfb48778..2f48723d3 100644
--- a/e107_admin/image.php
+++ b/e107_admin/image.php
@@ -2127,13 +2127,13 @@ function show_avatars()
$mes = e107::getMessage();
- $avFiles = e107::getFile()->get_files(e_MEDIA."avatars/",".jpg|.png|.gif|.jpeg|.JPG|.GIF|.PNG");
+ $avFiles = e107::getFile()->get_files(e_MEDIA."avatars/",".jpg|.png|.gif|.jpeg|.JPG|.GIF|.PNG",null,2);
$dirlist = array();
foreach($avFiles as $f)
{
- $dirlist[] = $f['fname'];
+ $dirlist[] = str_replace(e_MEDIA."avatars/","",$f['path']). $f['fname'];
}
$text = '';
@@ -2179,7 +2179,7 @@ function show_avatars()
// :
- $users = (in_array($image_name,$imageUsed)) ? "Image in use" : 'Not in use';
+ $users = (in_array(basename($image_name),$imageUsed)) ? "Image in use" : 'Not in use';
//directory?
if(is_dir(e_MEDIA."avatars/".$image_name))
@@ -2205,6 +2205,20 @@ function show_avatars()
$attr = "aw=".$pref['im_width']."&ah=".$pref['im_height'];
$img_path = $tp->thumbUrl(e_MEDIA_ABS."avatars/".$image_name,$attr);
+ $type = dirname($image_name);
+
+ if($prevType != $type)
+ {
+ $text .= "
+ ".$type."
";
+ }
+
+
+
+
+
+
+
$for = $frm->name2id('multiaction-'.$image_name);
$img_src = "";
+
+ $prevType = $type;
}
diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php
index 516ae5767..cb0d00a74 100644
--- a/e107_admin/update_routines.php
+++ b/e107_admin/update_routines.php
@@ -1151,7 +1151,7 @@ function update_706_to_800($type='')
$root_media = str_replace(basename(e_MEDIA)."/","",e_MEDIA);
- $user_media_dirs = array("images","avatars","files","temp","videos","icons");
+ $user_media_dirs = array("images","avatars", "avatars/default", "avatars/uploaded", "files","temp","videos","icons");
// check for old paths and rename.
if(is_dir($root_media."images") || is_dir($root_media."temp"))
@@ -1163,7 +1163,7 @@ function update_706_to_800($type='')
}
// create sub-directories if they do not exist.
- if(!is_dir(e_MEDIA."images") || !is_dir(e_MEDIA."temp"))
+ if(!is_dir(e_MEDIA."images") || !is_dir(e_MEDIA."temp") || !is_dir(e_MEDIA."avatars/default") )
{
foreach($user_media_dirs as $md)
{
@@ -1185,7 +1185,9 @@ function update_706_to_800($type='')
if ($just_check) return update_needed('Avatar paths require updating.');
foreach($avatar_images as $av)
{
- @rename($av['path'].$av['fname'],e_MEDIA."avatars/".$av['fname']);
+ $apath = (strstr($av['path'],'public/')) ? 'uploaded/' : 'default/';
+
+ @rename($av['path'].$av['fname'],e_MEDIA."avatars/".$apath. $av['fname']);
}
}
diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php
index b72a069d6..c2d75ea4a 100644
--- a/e107_handlers/form_handler.php
+++ b/e107_handlers/form_handler.php
@@ -397,7 +397,7 @@ class e_form
$previnput = $idinput."-preview";
$optioni = $idinput."-options";
- $img = (strpos($curVal,"://")!==false) ? $curVal : $tp->thumbUrl(e_MEDIA."avatars/".$curVal,"aw=".vartrue($width)."&ah=".vartrue($height));
+ $img = (strpos($curVal,"://")!==false) ? $curVal : $tp->thumbUrl(e_MEDIA."avatars/default/".$curVal,"aw=".vartrue($width)."&ah=".vartrue($height));
if(!$curVal)
{
@@ -416,7 +416,7 @@ class e_form
$text .= ""; //TODO Common LAN.
}
- $avFiles = e107::getFile()->get_files(e_MEDIA."avatars/",".jpg|.png|.gif|.jpeg|.JPG|.GIF|.PNG");
+ $avFiles = e107::getFile()->get_files(e_MEDIA."avatars/default/",".jpg|.png|.gif|.jpeg|.JPG|.GIF|.PNG");
$text .= "\n\n"; //TODO unique id.
@@ -433,7 +433,7 @@ class e_form
foreach($avFiles as $fi)
{
- $img_path = $tp->thumbUrl(e_MEDIA_ABS."avatars/".$fi['fname'],$attr);
+ $img_path = $tp->thumbUrl(e_MEDIA_ABS."avatars/default/".$fi['fname'],$attr);
$text .= "\n

";
//TODO javascript CSS selector
}
diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php
index 22578bb23..1e9b8c078 100644
--- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php
+++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php
@@ -163,6 +163,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
$height = e107::getPref("im_height");
$width = e107::getPref("im_width");
+ $img = e_IMAGE_ABS."generic/blank_avatar.jpg";
if ($this->postInfo['post_user'] && $this->postInfo['user_image'])
{
@@ -171,7 +172,17 @@ class plugin_forum_view_shortcodes extends e_shortcode
if ($this->postInfo['user_image'])
{
// require_once(e_HANDLER.'avatar_handler.php');
- $avatar = "

postInfo['user_name']."\"/>";
+
+ if(file_exists(e_MEDIA_AVATAR."default/".$this->postInfo['user_image']))
+ {
+ $img = e_MEDIA_AVATAR_ABS."default/".$this->postInfo['user_image'];
+ }
+ elseif(file_exists(e_MEDIA_AVATAR."uploaded/".$this->postInfo['user_image']))
+ {
+ $img = e_MEDIA_AVATAR_ABS."uploaded/".$this->postInfo['user_image'];
+ }
+
+ $avatar = "

postInfo['user_name']."\"/>";
}
else
{
@@ -184,7 +195,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
// $img = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","w=".$width."&h=".$height);
// return print_a($img, true);
- $img = e_IMAGE."generic/blank_avatar.jpg";
+
return "

";