Пример #1
0
function multi_img_upload2($upload_files_array)
{
    foreach ($upload_files_array as $post_key => $upload_array) {
        if ($upload_array['error'] != 4) {
            if ($post_key == "picture") {
                $image_path = upload_img2("", $upload_array, "picture_poems");
                $post_data[$post_key] = "/uploads/picture_poems/" . $image_path['urls'][0];
            } else {
                $image_path = upload_img2("", $upload_array, "misc");
                $post_data[$post_key] = "/uploads/misc/" . $image_path['urls'][0];
            }
        }
    }
    return $post_data;
}
Пример #2
0
 if (!$birthdate) {
     $errmsg_arr[] = 'Please enter birthdate!';
     $errflag = true;
 }
 //--upload image--//
 if (isset($_FILES['data']['name']) and $_FILES['data']['name'] and $_FILES['data']['name']['picture'] != "") {
     $name_key = array_keys($_FILES['data']['name']);
     foreach ($_FILES['data'] as $key => $value) {
         $uploads[$name_key[0]][$key] = $value[$name_key[0]];
     }
     if ($name_key[0] == "picture") {
         $image_path = upload_img2("", $uploads[$name_key[0]], "user_pics");
     } elseif ($name_key[0] == "Video_URL") {
         $image_path = upload_img2("", $uploads[$name_key[0]], "video_images");
     } else {
         $image_path = upload_img2("", $uploads[$name_key[0]], "misc");
     }
     $_POST['data'][$name_key[0]] = $image_path['urls'][0];
     if ($_POST['data']['picture']) {
         $_SESSION['picture'] = $_POST['data']['picture'];
     }
 }
 if ($errflag) {
     $tpl->errors = $errmsg_arr;
 } else {
     $user_id = clean($_SESSION['user_id']);
     $user_data = array();
     $user_data['firstname'] = $firstname;
     $user_data['lastname'] = $lastname;
     $user_data['user_email'] = $user_email;
     $user_data['birthday'] = $birthdate;