public static function uploadpic($file, $smallkey, $bigkey, $size, $const = array()) { $fd = Fun::uploadfile_post($file, $const); if ($fd["ec"] > 0) { $smallpic = "data/files/" . Fun::getuploadfilename(pathinfo($fd['fn'], PATHINFO_EXTENSION), 'small'); resizeimg($fd["fn"], $smallpic, $size, $size); Sqle::updateVal("users", array($smallkey => $smallpic, $bigkey => $fd["fn"]), array("id" => User::loginId())); } return $fd["ec"]; }