Avatar

Step by step introduction, still failed (General)

by Micha ⌂, Monday, November 28, 2016, 23:00 (2699 days ago) @ Magma

Hi,

maybe this modified getAvatar()-function works instead of the modern one:

function getAvatar($user_id) {
 $avatar_images_path = 'images/avatars/';
 $fileList = glob( $avatar_images_path . intval($user_id) . "[_.]*{png,jpg,jpeg,gif,bmp}" , GLOB_BRACE);
 if (isset($fileList) && count($fileList) > 0) {
  foreach ($fileList as $file) {
   if (preg_match("/^(" . preg_quote($avatar_images_path, '/') . ")(" . preg_quote(intval($user_id)) . "(_\d+)?\.(jpg|gif|png|jpeg,bmp))$/", $file, $matches)) {
    //var_dump($matches);
    $filename = $matches[2];
    if (file_exists($avatar_images_path.$filename))
     return array($avatar_images_path, $filename, $avatar_images_path.$filename);
   }
  }
 }
 return false;
}

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences


Complete thread:

 RSS Feed of thread