コード例 #1
0
 public static function common()
 {
     global $_G;
     $avatarpath = $_G['setting']['attachdir'];
     $filetype = null;
     $imgtype = array(1 => '.gif', 2 => '.jpg', 3 => '.png');
     foreach ($imgtype as $_filetype) {
         if (file_exists($avatarpath . './temp/upload' . $_G['uid'] . $_filetype)) {
             $filetype = $_filetype;
             break;
         }
     }
     if (is_null($filetype)) {
         self::error('api_uploadavatar_unavailable_pic');
     }
     $tmpavatar = $avatarpath . './temp/upload' . $_G['uid'] . $filetype;
     $tmpavatarbig = './temp/upload' . $_G['uid'] . 'big' . $filetype;
     $tmpavatarmiddle = './temp/upload' . $_G['uid'] . 'middle' . $filetype;
     $tmpavatarsmall = './temp/upload' . $_G['uid'] . 'small' . $filetype;
     self::$tmpavatar = $tmpavatar;
     self::$tmpavatarbig = $avatarpath . $tmpavatarbig;
     self::$tmpavatarmiddle = $avatarpath . $tmpavatarmiddle;
     self::$tmpavatarsmall = $avatarpath . $tmpavatarsmall;
 }