Author Topic: [MOD] - Multiupload (thunderstrike version)  (Read 39305 times)

0 Members and 2 Guests are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[MOD] - Multiupload (thunderstrike version)
« on: February 24, 2008, 12:51:51 AM »
Ok, we know what this is. No need for say description for this right ? ;)

[28-02-2008] - instruction update -

// Upload same file name (for media and thumb) for each loop you select. ex: file1.jpg for media and file1.jpg for thumb. file2.jpg for media and file2.jpg for thumb in no 2 upload window (read instruction for integrate resize on upload - version 1 or 2 or V@no in my first post or second post - ((// Integrate with auto-resize) step)).

[28-02-2008] - end instruction update -

I full code this myself and now is work purfect. I patch all pass problem in forum with MOD.

No Kai - no demo Kai :!:

// Package:

- Single value number in ACP for say how number images is upload to gallery (yes, 1 include so no need for remove MOD to go back single upload).
- Multiupload / Single image upload button is change from 1 to 2 in categories page.
- New code for templates and media template folder for view upload images.
- User is possible for select value of file upload (max limit to admin setting: ACP - > Setting).
- If user access page with URL for multiupload form, auto change to 1 upload for this user.
- Each file is say for upload in media template (@Ivan: Is fix).
- Each content is regroup with thumb and media file so is detect right in mySQL.
- Each count file is match with upload form.
- $action = multiupload - REMOVE (no need).
- Captcha include.
- Convert string to array - ALL (axcept captcha).
- Additional image fields include with counter.
- HTML template: ALL parse and register for template.
- Single email for notify with all upload file - same time in email template.
- Possible for integrate other MOD in forum.
- I post screenshot.

This is VERY BIG MOD. Make FULL BACKUP of gallery (include mySQL) - or test with fresh gallery (4images v1.76).

// Step 1

In member.php file (very big step):

I change all 'uploadimage' and 'uploadform' and add 'requestuploadform' action to multiupload so you need replace this (test in fresh gallery if like) - to this:

Code: [Select]
if ($action == "uploadimage") {
  if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
    show_error_page($lang['no_permission']);
    exit;
  }

  $txt_clickstream = "";
  if ($cat_id && isset($cat_cache[$cat_id])) {
    $txt_clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
  }
  $txt_clickstream .= $lang['user_upload'];
  
  $num_counter = (isset($HTTP_POST_VARS['num_counter'])) ? intval(trim($HTTP_POST_VARS['num_counter'])) : 1;  
  
  for ($i = 0; $i < $num_counter; $i++) {      
      $remote_media_file = format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['remote_media_file' . $i])));
      $remote_thumb_file = format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['remote_thumb_file' . $i])));
      
      $image_name = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_name' . $i]));
      $image_description = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_description' . $i]));
      $image_keywords = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_keywords' . $i]));

      $image_keywords = preg_replace("/[\n\r]/is", ",", $image_keywords);
      $image_keywords_arr = explode(',', $image_keywords);
      array_walk($image_keywords_arr, 'trim_value');
      $image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));      

      $image_active = (isset($HTTP_POST_VARS['image_active' . $i]) && $HTTP_POST_VARS['image_active' . $i] == 0) ? 0 : 1;
      $image_allow_comments = (isset($HTTP_POST_VARS['image_allow_comments' . $i]) && $HTTP_POST_VARS['image_allow_comments' . $i] == 0) ? 0 : 1;
      $image_download_url = (isset($HTTP_POST_VARS['image_download_url' . $i])) ? format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_download_url' . $i]))) : "";            
  } // End for.

  $captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim((string)$HTTP_POST_VARS['captcha'])) : "";

  $direct_upload = (check_permission("auth_directupload", $cat_id)) ? 1 : 0;
  $upload_cat = ($direct_upload) ? $cat_id : 0;

  $error = 0;
  $uploaderror = 0;

  if ($cat_id == 0)  {
    $error = 1;
    $field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['category']), $lang['field_required']);
    $msg .= (($msg != "") ? "<br />" : "").$field_error;
  }
  
  for ($i = 0; $i < $num_counter; $i++) {
      if ((empty($HTTP_POST_FILES['media_file' . $i]['tmp_name']) || $HTTP_POST_FILES['media_file' . $i]['tmp_name'] == "none") && (sizeof($remote_media_file) == 0 || !check_remote_media($remote_media_file))) {
          $error = 1;
          $msg .= (($msg != "") ? "<br />" : "").$lang['image_file_required'];
      }
      
      if (sizeof($image_name) == 0)  {
          $error = 1;
          $field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['image_name']), $lang['field_required']);
          $msg .= (($msg != "") ? "<br />" : "").$field_error;
      }  
  } // End for.

  if ($captcha_enable_upload && !captcha_validate($captcha)) {
    $msg .= (($msg != "") ? "<br />" : "").$lang['captcha_required'];
    $error = 1;
  }

  if (!empty($additional_image_fields)) {
      foreach ($additional_image_fields as $key => $val) {
          for ($i = 0; $i < $num_counter; $i++) {
              if (isset($HTTP_POST_VARS[$key . $i]) && intval($val[2]) == 1 && sizeof($HTTP_POST_VARS[$key . $i]) == 0) {
                  $error = 1;
                  $field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $val[0]), $lang['field_required']);
                  $msg .= (($msg != "") ? "<br />" : "").$field_error;
              }
          }          
       }
  }

  if (!$error) {
    // Start Upload
    include(ROOT_PATH.'includes/upload.php');
    $site_upload = new Upload();

    // Upload Media file
    
    for ($i = 0; $i < $num_counter; $i++) {        
        $remote_media_file = format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['remote_media_file' . $i])));        
        
        if (!empty($HTTP_POST_FILES['media_file' . $i]['tmp_name']) && $HTTP_POST_FILES['media_file' . $i]['tmp_name'] != "none") {
            $HTTP_POST_FILES['media_file' . $i]['name'] = $site_upload->upload_file("media_file" . $i, "media", $upload_cat);
            if (!$HTTP_POST_FILES['media_file' . $i]['name']) {
                $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$HTTP_POST_FILES['media_file' . $i]['name']."</b><br />".$site_upload->get_upload_errors();
                $uploaderror = 1;
            }
        } else {            
                $HTTP_POST_FILES['media_file' . $i]['name'] = $remote_media_file;
        }      
    } // End for.        

    // Uplad thumb file
    require(ROOT_PATH.'includes/image_utils.php');
    $convert_options = init_convert_options();
    $do_create = 0;    
    
    for ($i = 0; $i < $num_counter; $i++) {        
        $remote_thumb_file = format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['remote_thumb_file' . $i])));            
        
        if (!empty($HTTP_POST_FILES['thumb_file' . $i]['tmp_name']) && $HTTP_POST_FILES['thumb_file' . $i]['tmp_name'] != "none" && !$uploaderror) {
            $HTTP_POST_FILES['thumb_file' . $i]['name'] = $site_upload->upload_file("thumb_file" . $i, "thumb", $upload_cat, get_basefile($HTTP_POST_FILES['media_file' . $i]['name']));
            if (get_basefile(stripslashes(trim(!$HTTP_POST_FILES['thumb_file' . $i]['name'])))) {
                $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['thumb_upload_error'].": ".$HTTP_POST_FILES['thumb_file' . $i]['name']."</b><br />".$site_upload->get_upload_errors();
                @unlink(MEDIA_TEMP_PATH."/".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name']))));
                $uploaderror = 1;
            }        
        
         } elseif (check_remote_thumb($remote_thumb_file)) {            
             $HTTP_POST_FILES['thumb_file' . $i]['name'] = $remote_thumb_file;
        
         } elseif ($config['auto_thumbnail'] == 1 && !empty($HTTP_POST_FILES['media_file' . $i]['tmp_name']) && $HTTP_POST_FILES['media_file' . $i]['tmp_name'] != "none" && !$uploaderror) {
             if ($direct_upload) {
                 $src = MEDIA_PATH."/".$cat_id."/".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
                 $dest = THUMB_PATH."/".$cat_id."/".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
            
             } else {
                 $src = MEDIA_TEMP_PATH."/".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
                 $dest = THUMB_TEMP_PATH."/".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
             }            
             if ($image_info = @getimagesize($src)) {
                 if ($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) {
                     $do_create = 1;
                 }
             }
             if ($do_create) {                
                 if (!$convert_options['convert_error']) {
                     $dimension = (intval($config['auto_thumbnail_dimension'])) ? intval($config['auto_thumbnail_dimension']) : 100;
                     $resize_type = (intval($config['auto_thumbnail_resize_type'])) ? intval($config['auto_thumbnail_resize_type']) : 1;
                     $quality = (intval($config['auto_thumbnail_quality']) && intval($config['auto_thumbnail_quality']) <= 100) ? intval($config['auto_thumbnail_quality']) : 100;
                    
                     if (create_thumbnail($src, $dest, $quality, $dimension, $resize_type)) {
                         $HTTP_POST_FILES['thumb_file' . $i]['name'] = get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
                     }
                 }
             }
         }
    } // End for.

    if (!$uploaderror) {
      $current_time = time();
      
      if ($direct_upload) {
          include(ROOT_PATH.'includes/search_utils.php');
          $search_words = array();
          
          for ($i = 0; $i < $num_counter; $i++) {
              
              $remote_media_file = format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['remote_media_file' . $i])));
              $remote_thumb_file = format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['remote_thumb_file' . $i])));
              
              $image_name = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_name' . $i]));
              $new_name = (isset($remote_media_file) && !empty($remote_media_file)) ? $remote_media_file : get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
              $new_thumb_name = (isset($remote_thumb_file) && !empty($remote_thumb_file)) ? $remote_thumb_file : get_basefile(stripslashes(trim($HTTP_POST_FILES['thumb_file' . $i]['name'])));
              $image_description = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_description' . $i]));
              $image_keywords = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_keywords' . $i]));
              $image_keywords = preg_replace("/[\n\r]/is", ",", $image_keywords);
              $image_keywords_arr = explode(',', $image_keywords);
              array_walk($image_keywords_arr, 'trim_value');
              $image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));
              
              $image_active = (isset($HTTP_POST_VARS['image_active' . $i]) && $HTTP_POST_VARS['image_active' . $i] == 0) ? 0 : 1;
              $image_allow_comments = (isset($HTTP_POST_VARS['image_allow_comments' . $i]) && $HTTP_POST_VARS['image_allow_comments' . $i] == 0) ? 0 : 1;
              $image_download_url = (isset($HTTP_POST_VARS['image_download_url' . $i])) ? format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_download_url' . $i]))) : "";                          
              
              $additional_field_sql = "";
              $additional_value_sql = "";
              if (!empty($additional_image_fields)) {
                  $table_fields = $site_db->get_table_fields(IMAGES_TABLE);
                  foreach ($additional_image_fields as $key => $val) {
                      if (isset($HTTP_POST_VARS[$key . $i]) && isset($table_fields[$key])) {
                          $additional_field_sql .= ", $key";
                          $additional_value_sql .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key . $i]))."'";
                      }
                  }
              }
              
              $sql = "INSERT INTO ".IMAGES_TABLE."
              (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments".$additional_field_sql.")
              VALUES ($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, $image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments".$additional_value_sql.")";
              $result = $site_db->query($sql);
              $image_id = $site_db->get_insert_id();
              if ($result) {                  
                  foreach ($search_match_fields as $image_column => $match_column) {
                      if (isset($HTTP_POST_VARS[$image_column])) {
                          $search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column]);
                      }
                  }
              }                                
              add_searchwords($image_id, $search_words);
          } // End for.      
      }
      else {
          for ($i = 0; $i < $num_counter; $i++) {
              
              $remote_media_file = format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['remote_media_file' . $i])));
              $remote_thumb_file = format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['remote_thumb_file' . $i])));
              
              $image_name = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_name' . $i]));
              $new_name = (isset($remote_media_file) && !empty($remote_media_file)) ? $remote_media_file : get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
              $new_thumb_name = (isset($remote_thumb_file) && !empty($remote_thumb_file)) ? $remote_thumb_file : get_basefile(stripslashes(trim($HTTP_POST_FILES['thumb_file' . $i]['name'])));
              $image_description = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_description' . $i]));
              $image_keywords = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_keywords' . $i]));
              $image_keywords = preg_replace("/[\n\r]/is", ",", $image_keywords);
              $image_keywords_arr = explode(',', $image_keywords);
              array_walk($image_keywords_arr, 'trim_value');
              $image_keywords = implode(',', array_unique(array_filter($image_keywords_arr)));
              
              $image_active = (isset($HTTP_POST_VARS['image_active' . $i]) && $HTTP_POST_VARS['image_active' . $i] == 0) ? 0 : 1;
              $image_allow_comments = (isset($HTTP_POST_VARS['image_allow_comments' . $i]) && $HTTP_POST_VARS['image_allow_comments' . $i] == 0) ? 0 : 1;
              $image_download_url = (isset($HTTP_POST_VARS['image_download_url' . $i])) ? format_url(un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_download_url' . $i]))) : "";            
              
              $additional_field_sql = "";
              $additional_value_sql = "";
              if (!empty($additional_image_fields)) {
                  $table_fields = $site_db->get_table_fields(IMAGES_TEMP_TABLE);
                  foreach ($additional_image_fields as $key => $val) {
                      if (isset($HTTP_POST_VARS[$key . $i]) && isset($table_fields[$key])) {
                          $additional_field_sql .= ", $key";
                          $additional_value_sql .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key . $i]))."'";
                      }
                  }
              }
              
              $sql = "INSERT INTO ".IMAGES_TEMP_TABLE."
              (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_media_file, image_thumb_file, image_download_url".$additional_field_sql.")                
              VALUES ($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url'".$additional_value_sql.")";
              $result = $site_db->query($sql);
          }
      }

      if ($config['upload_notify'] == 1 && !$direct_upload) {
        include(ROOT_PATH.'includes/email.php');
        $site_email = new Email();

        $config['upload_emails'] = str_replace(" ", "", $config['upload_emails']);
        $emails = explode(",", $config['upload_emails']);

        $validation_url = $script_url."/admin/index.php?goto=".urlencode("validateimages.php?action=validateimages");

        $site_email->set_to($config['site_email']);
        $site_email->set_subject($lang['new_upload_emailsubject']);
        
        for ($i = 0; $i < $num_counter; $i++) {
            $image_name = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_name' . $i]));
            
            $site_email->register_vars(array(
               "image_name" => format_text(trim($image_name), 2),
               "media_file_name" => get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name']))),
               "thumb_file_name" => get_basefile(stripslashes(trim($HTTP_POST_FILES['thumb_file' . $i]['name'])))
            ));            
        } // End for.
        $site_email->register_vars(array(
          "cat_name" => format_text(trim($cat_cache[$cat_id]['cat_name']), 2),
          "validation_url" => $validation_url,
          "site_name" => format_text(trim($config['site_name']), 2)
        ));
        $site_email->set_body("upload_notify", $config['language_dir_default']);
        $site_email->set_bcc($emails);
        $site_email->send_email();
      }
      
      $bgcounter = 0;
      $total_files_uploaded = 0;
      for ($i = 0; $i < $num_counter; $i++) {          
          $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
          
          $image_name = un_htmlspecialchars(trim((string)$HTTP_POST_VARS['image_name' . $i]));
          
          $msg .= $lang['image_add_success'].": <b>".format_text(stripslashes($image_name), 2)."</b> (" . get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name']))).")<br />";
          $msg .= (!$direct_upload) ? "<br />".$lang['new_upload_validate_desc'] : "";          
          
          $file_extension = get_file_extension(get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name']))));
          $file = (is_remote($HTTP_POST_FILES['media_file' . $i]['name'])) ? get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name']))) : (($direct_upload) ? MEDIA_PATH."/".$cat_id."/".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name']))) : MEDIA_TEMP_PATH."/".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name']))));
          $width_height = "";
          if (!is_remote($file) && $imageinfo = @getimagesize($file)) {
              $width_height = " ".$imageinfo[3];
          }
          $media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"\" />";
          $site_template->register_vars(array(
             "media_src" => $file,
             "media_icon" => $media_icon,
             "image_name" => format_text(stripslashes($image_name)),
             "width_height" => $width_height
          ));
          $media = $site_template->parse_template("media/".$file_extension);
          $site_template->register_vars(array(
             "lang_multiupload_media_file_name" => preg_replace("/" . $site_template->start . "media_file_name" . $site_template->end . "/siU", get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name']))), $lang['multiupload_media_file_name']),
             "media" => $media,
             "counter" => $row_bg_number
          ));          
          $content .= $site_template->parse_template("member_multiupload_media");          
          
          $total_files_uploaded++;
      } // End for.    
      
    }
    else {
      $action = "uploadform";
      $sendprocess = 1;
    }
  }
  else {
    $action = "uploadform";
    $sendprocess = 1;
  }
}

if ($action == "requestuploadform") {    
    
    if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
        show_error_page($lang['no_permission']);
        exit;
    }
    $txt_clickstream = get_category_path($cat_id, 1).$config['category_separator'] . $lang['multiupload_select_title'];
    
    if (isset($config['multiupload_size'])) {        
        if ($config['multiupload_size'] > 1) {            
            $request_uploadform_content = "";            
            for ($i = $config['multiupload_size']; $i > 0; $i--) {                
                $site_template->register_vars("i", $i);
                $request_uploadform_content .= $site_template->parse_template("member_multiuploadform_select_content");                                                
            }
            $site_template->register_vars(array(
            "lang_member_multiuploadform_select" => $lang['member_multiuploadform_select'],
            "lang_multiupload_select_title" => $lang['multiupload_select_title'],
            "member_multiuploadform_select_content" => $request_uploadform_content,
            "cat_id" => $cat_id,
            "request_uploadform_value" => $cat_id            
            ));
            $content .= $site_template->parse_template("member_multiuploadform_select");
        }
    }    
}

if ($action == "uploadform") {
  if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
    show_error_page($lang['no_permission']);
    exit;
  }

  $txt_clickstream = "";
  if ($cat_id && isset($cat_cache[$cat_id])) {
    $txt_clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
  }
  $txt_clickstream .= $lang['user_upload'];
  
  if (isset($HTTP_POST_VARS['request_uploadform_value'])) {
      $request_uploadform_value = (isset($HTTP_POST_VARS['request_uploadform_value'])) ? intval(trim($HTTP_POST_VARS['request_uploadform_value'])) : "";
  } else {
      $request_uploadform_value = 1;
  }

  if (!$sendprocess) {
    $remote_media_file = "";
    $remote_thumb_file = "";
    $image_name = "";
    $image_description = "";
    $image_keywords = "";
    $image_download_url = "";
    $image_allow_comments = 1;
  }
  
  if ($sendprocess) {
      $site_template->register_vars(array(
         "cat_id" => $cat_id,
         "cat_name" => ($cat_id != 0) ? format_text($cat_cache[$cat_id]['cat_name'], 2) : get_category_dropdown($cat_id)
      ));      
      
      for ($i = 0; $i < $num_counter; $i++) {
          
          $site_template->register_vars(array(          
            "remote_media_file" => format_text(stripslashes($remote_media_file), 2),
            "remote_thumb_file" => format_text(stripslashes($remote_thumb_file), 2),
            "image_name" => format_text(stripslashes($image_name), 2),
            "image_description" => format_text(stripslashes($image_description), 2),
            "image_keywords" => format_text(stripslashes($image_keywords), 2),
            "image_allow_comments_yes" => ($image_allow_comments) ? " checked=\"checked\"" : "",
            "image_allow_comments_no" => (!$image_allow_comments) ? " checked=\"checked\"" : "",
            "image_download_url" => format_text(stripslashes($image_download_url), 2),
            "lang_category" => $lang['category'],            
            "lang_user_upload" => $lang['user_upload'],
            "lang_media_file" => $lang['media_file'],
            "lang_thumb_file" => $lang['thumb_file'],
            "lang_allowed_file_types" => $lang['allowed_mediatypes_desc'],
            "allowed_media_types" => str_replace(",",", ",$config['allowed_mediatypes']),
            "allowed_thumb_types" => "jpg, gif, png",
            "lang_max_filesize" => $lang['max_filesize'],
            "lang_max_imagewidth" => $lang['max_imagewidth'],
            "lang_max_imageheight" => $lang['max_imageheight'],
            "max_thumb_filsize" => $config['max_thumb_size']."&nbsp;".$lang['kb'],
            "max_thumb_imagewidth" => $config['max_thumb_width']."&nbsp;".$lang['px'],
            "max_thumb_imageheight" => $config['max_thumb_height']."&nbsp;".$lang['px'],
            "max_media_filsize" => $config['max_media_size']."&nbsp;".$lang['kb'],
            "max_media_imagewidth" => $config['max_image_width']."&nbsp;".$lang['px'],
            "max_media_imageheight" => $config['max_image_height']."&nbsp;".$lang['px'],
            "lang_image_name" => $lang['image_name'],
            "lang_description" => $lang['description'],
            "lang_keywords" => $lang['keywords_ext'],
            "lang_allow_comments" => isset($lang['allow_comments']) ? $lang['allow_comments'] : "",          
            "lang_submit" => $lang['submit'],
            "lang_reset" => $lang['reset'],
            "lang_yes" => $lang['yes'],
            "lang_no" => $lang['no'],
            "lang_captcha" => $lang['captcha'],
            "lang_captcha_desc" => $lang['captcha_desc'],
            "captcha_upload" => (bool)$captcha_enable_upload
          ));
          
          if (!empty($additional_image_fields)) {
              $additional_field_array = array();        
              foreach ($additional_image_fields as $key => $val) {                            
                  if ($val[1] == "radio") {
                      $value = (isset($HTTP_POST_VARS[$key . $i])) ? intval($HTTP_POST_VARS[$key . $i]) : 1;
                      if ($value == 1) {
                          $additional_field_array[$key.'_yes'] = " checked=\"checked\"";
                          $additional_field_array[$key.'_no'] = "";
                      } else {
                              $additional_field_array[$key.'_yes'] = "";
                              $additional_field_array[$key.'_no'] = " checked=\"checked\"";
                      }
                  } else {
                      $value = (isset($HTTP_POST_VARS[$key . $i])) ? format_text(trim($HTTP_POST_VARS[$key . $i]), 1) : "";
                  }
                  $additional_field_array[$key] = $value;
                  $additional_field_array['lang_'.$key] = $val[0];        
              }
              if (!empty($additional_field_array)) {
                  $site_template->register_vars($additional_field_array);
              }
          }
          
      } // End for.
  
  } elseif (!$send_process) {
      
      $site_template->register_vars(array(
        "cat_id" => $cat_id,
        "cat_name" => ($cat_id != 0) ? format_text($cat_cache[$cat_id]['cat_name'], 2) : get_category_dropdown($cat_id),    
        "remote_media_file" => format_text(stripslashes($remote_media_file), 2),
        "remote_thumb_file" => format_text(stripslashes($remote_thumb_file), 2),
        "image_name" => format_text(stripslashes($image_name), 2),
        "image_description" => format_text(stripslashes($image_description), 2),
        "image_keywords" => format_text(stripslashes($image_keywords), 2),
        "image_allow_comments_yes" => ($image_allow_comments) ? " checked=\"checked\"" : "",
        "image_allow_comments_no" => (!$image_allow_comments) ? " checked=\"checked\"" : "",
        "image_download_url" => format_text(stripslashes($image_download_url), 2),
        "lang_category" => $lang['category'],
        "lang_user_upload" => $lang['user_upload'],        
        "lang_media_file" => $lang['media_file'],
        "lang_thumb_file" => $lang['thumb_file'],
        "lang_allowed_file_types" => $lang['allowed_mediatypes_desc'],
        "allowed_media_types" => str_replace(",",", ",$config['allowed_mediatypes']),
        "allowed_thumb_types" => "jpg, gif, png",
        "lang_max_filesize" => $lang['max_filesize'],
        "lang_max_imagewidth" => $lang['max_imagewidth'],
        "lang_max_imageheight" => $lang['max_imageheight'],
        "max_thumb_filsize" => $config['max_thumb_size']."&nbsp;".$lang['kb'],
        "max_thumb_imagewidth" => $config['max_thumb_width']."&nbsp;".$lang['px'],
        "max_thumb_imageheight" => $config['max_thumb_height']."&nbsp;".$lang['px'],
        "max_media_filsize" => $config['max_media_size']."&nbsp;".$lang['kb'],
        "max_media_imagewidth" => $config['max_image_width']."&nbsp;".$lang['px'],
        "max_media_imageheight" => $config['max_image_height']."&nbsp;".$lang['px'],
        "lang_image_name" => $lang['image_name'],
        "lang_description" => $lang['description'],
        "lang_keywords" => $lang['keywords_ext'],
        "lang_allow_comments" => isset($lang['allow_comments']) ? $lang['allow_comments'] : "",
        "lang_submit" => $lang['submit'],
        "lang_reset" => $lang['reset'],
        "lang_yes" => $lang['yes'],
        "lang_no" => $lang['no'],
        "lang_captcha" => $lang['captcha'],
        "lang_captcha_desc" => $lang['captcha_desc'],
        "captcha_upload" => (bool)$captcha_enable_upload
      ));  
  }

  if (!empty($additional_image_fields)) {
    $additional_field_array = array();        
    foreach ($additional_image_fields as $key => $val) {                            
        if ($val[1] == "radio") {
            $value = (isset($HTTP_POST_VARS[$key])) ? intval($HTTP_POST_VARS[$key]) : 1;
            if ($value == 1) {
                $additional_field_array[$key.'_yes'] = " checked=\"checked\"";
                $additional_field_array[$key.'_no'] = "";
            } else {
                $additional_field_array[$key.'_yes'] = "";
                $additional_field_array[$key.'_no'] = " checked=\"checked\"";
            }
        } else {
            $value = (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key]), 1) : "";
        }
        $additional_field_array[$key] = $value;
        $additional_field_array['lang_'.$key] = $val[0];        
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  }  
  $multiupload_content = "";
  $counter = 0;
  for ($i = 1; $i <= $request_uploadform_value; $i++) {      
      $lang_multiupload_title_content = preg_replace("/" . $site_template->start . "counter" . $site_template->end . "/siU", $counter + 1, $lang['multiupload_file_title']);      
      $site_template->register_vars("lang_multiupload_file_title", $lang_multiupload_title_content);
      $site_template->register_vars("counter", $counter);
      $multiupload_content .= $site_template->parse_template("member_multiupload_form");
      
      $counter++;
  }
  $site_template->register_vars("member_multiupload_form", $multiupload_content);
  $site_template->register_vars("num_counter", $counter);  
  $content = $site_template->parse_template("member_uploadform");
  unset ($multiupload_file_title);
  unset ($multiupload_content);  
}

(paste full code from uploadimage and stop right before: emailuser action).

// Step 2

In lang/english/main.php file,

add in top ?>:

Code: [Select]
//-----------------------------------------------------
//--- Multiupload (Thunderstrike version) -------------
//-----------------------------------------------------
$lang['multiupload_file_title'] = "File no. {counter}";
$lang['multiupload_media_file_name'] = "Filename: {media_file_name}";
$lang['member_multiuploadform_select'] = "Select the number of images for upload:<br /><span class=\"smalltext\"><font color=\"red\">Note:</font> Check all field before upload.</span>";
$lang['multiupload_select_title'] = "Multiupload - select";

// Step 3

In categories.php file,

find:

Code: [Select]
//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
if (!check_permission("auth_upload", $cat_id)) {
  $upload_url = "";
  $upload_button = "<img src=\"".get_gallery_image("upload_off.gif")."\" border=\"0\" alt=\"\" />";
}
else {
  $upload_url = $site_sess->url(ROOT_PATH."member.php?action=uploadform&amp;".URL_CAT_ID."=".$cat_id);
  $upload_button = "<a href=\"".$upload_url."\"><img src=\"".get_gallery_image("upload.gif")."\" border=\"0\" alt=\"\" /></a>";
}

replace:

Code: [Select]
//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
if (!check_permission("auth_upload", $cat_id)) {
  $upload_url = "";
  $upload_button = "<img src=\"".get_gallery_image("upload_off.gif")."\" border=\"0\" alt=\"\" />";
}
elseif (check_permission("auth_upload", $cat_id) && isset($config['multiupload_size']) && $config['multiupload_size'] == 1) {
  $upload_url = $site_sess->url(ROOT_PATH."member.php?action=uploadform&amp;".URL_CAT_ID."=".$cat_id);
  $upload_button = "<a href=\"".$upload_url."\"><img src=\"".get_gallery_image("upload.gif")."\" border=\"0\" alt=\"\" /></a>";
}
elseif (check_permission("auth_upload", $cat_id) && isset($config['multiupload_size']) && $config['multiupload_size'] > 1) {
  $upload_url = $site_sess->url(ROOT_PATH."member.php?action=requestuploadform&amp;".URL_CAT_ID."=".$cat_id);
  $upload_button = "<a href=\"".$upload_url."\"><img src=\"".get_gallery_image("multiupload.gif")."\" border=\"0\" alt=\"\" /></a>";
}

// Step 4

In lang/english/admin.php file,

add in top ?>:

Code: [Select]
/*-- Setting-Group XX --*/
$setting_group[XX] = "Multiupload";
$setting['multiupload_size'] = "Set max value for user to upload images to gallery";

Replace XX with last value in list.

// Step 5

In admin/settings.php file,

find:

Code: [Select]
show_form_footer($lang['save_changes'], "", 2);

add before :

Code: [Select]
show_table_separator($setting_group[XX], 2, "setting_group_XX");  
show_setting_row("multiupload_size");

Replace XX with last value in list.

// Step 6

In templates/your_template/member_uploadform.html file,

find:

Code: [Select]
   <input type="submit" name="uploadbutton" value="{lang_submit}" class="button" />

add before :

Code: [Select]
<input type="hidden" name="num_counter" value="{num_counter}">

// Step 7

In templates/your_template - create new file: member_multiupload_form.html file,

add:

Code: [Select]
 <tr>
            <td colspan="2" valign="top" class="head1">{lang_multiupload_file_title}</td>
          </tr>
 <tr>
            <td class="row2" valign="top">
 <b>{lang_media_file}</b><br />
 <span class="smalltext">
 {lang_max_filesize}<b>{max_media_filsize}</b><br />
 {lang_max_imagewidth}<b>{max_media_imagewidth}</b><br />
 {lang_max_imageheight}<b>{max_media_imageheight}</b><br />
 </span>
</td>
            <td class="row2">
              <b>Upload:</b><br />
 <input type="file" name="media_file{counter}" class="input" /><br />
 <b>URL:</b><br />
 <input type="text" name="remote_media_file{counter}"  size="30" value="{remote_media_file}" class="input" /><br />
 <span class="smalltext"><b>{lang_allowed_file_types}</b> {allowed_media_types}</span>
            </td>
          </tr>
          <tr>
            <td class="row1" valign="top">
 <b>{lang_thumb_file}</b><br />
 <span class="smalltext">
 {lang_max_filesize}<b>{max_thumb_filsize}</b><br />
 {lang_max_imagewidth}<b>{max_thumb_imagewidth}</b><br />
 {lang_max_imageheight}<b>{max_thumb_imageheight}</b><br />
 </span>
</td>
            <td class="row1">
              <b>Upload:</b><br />
 <input type="file" name="thumb_file{counter}" class="input" /><br />
 <b>URL:</b><br />
 <input type="text" name="remote_thumb_file{counter}"  size="30" value="{remote_thumb_file}" class="input" /><br />
 <span class="smalltext"><b>{lang_allowed_file_types}</b> {allowed_thumb_types}</span>
            </td>
          </tr>
          <tr>
            <td class="row2"><b>{lang_image_name}</b></td>
            <td class="row2"><input type="text" name="image_name{counter}"  size="30" value="{image_name}" class="input" /></td>
          </tr>
          <tr>
            <td class="row1" valign="top"><b>{lang_description}</b></td>
            <td class="row1">
              <textarea name="image_description{counter}" cols="30" class="textarea" rows="10" wrap="VIRTUAL">{image_description}</textarea>
            </td>
          </tr>
          <tr>
            <td class="row2" valign="top"><b>{lang_keywords}</b></td>
            <td class="row2">
              <textarea cols="30" class="textarea" rows="10" wrap="VIRTUAL" name="image_keywords{counter}">{image_keywords}</textarea>
            </td>
          </tr>

// Step 8

In templates/your_template - create new file: member_multiupload_media.html file,

add:

Code: [Select]
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="tablebottom">
<tr>
<td class="head1">&nbsp;{lang_multiupload_media_file_name}</td>
</tr>
<tr>
<td class="row{counter}" align="center"><br />{media}<br /></td>
</tr>
</table>

// Step 9

In templates/your_template - create new file: member_multiuploadform_select_content.html file,

add:

Code: [Select]
<option value="{i}">{i}</option>

// Step 10

I attach ZIP file for screenshot and multiupload button so upload in templates/your_template/images folder (or same place for upload.gif file).

// Step 11

In SQL Patches (expert mode),

use:

Code: [Select]
INSERT INTO 4images_settings (setting_name, setting_value) VALUES ('multiupload_size', '2');

// Integrate with auto-resize

Ok so if use this:

http://www.4homepages.de/forum/index.php?topic=7700.0

(step 1 of V@no for member.php file) -

replace:

Code: [Select]
//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
if ($config['auto_image'] && !$uploaderror) {
    $do_resize = 0;
    for ($i = 0; $i < $num_counter; $i++) {
        if ($direct_upload) {
            $HTTP_POST_FILES['media_file' . $i]['name'] = MEDIA_PATH."/".$cat_id."/".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
        } else {
            $HTTP_POST_FILES['media_file' . $i]['name'] = MEDIA_TEMP_PATH."/".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
        }
        
        if ($image_info = @getimagesize($HTTP_POST_FILES['media_file' . $i]['name'])) {
            if ($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) {
                $do_resize = 1;
            }
        }
    }
    if ($do_resize) {
        if (!function_exists(init_convert_options)) {
            require(ROOT_PATH.'includes/image_utils.php');
        }
        
        if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
            $convert_options = init_convert_options();
            if (!$convert_options['convert_error']) {
                $quality = (intval($config['auto_image_quality']) && intval($config['auto_image_quality']) <= 100) ? intval($config['auto_image_quality']) : 100;
                for ($i = 0; $i < $num_counter; $i++) {
                    if (!resize_image($HTTP_POST_FILES['media_file' . $i]['name'], $quality, $config['max_image_width'], 1, $config['max_image_height'])) {
                        $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".get_basefile(stripslashes(trim($HTTP_POST_FILES['media_file' . $i]['name'])));
                        $uploaderror = 1;
                    }
                }
            }
        }
    }
}
//-------------------------------------------


[29-02-2008] - Subject update by Nicky
« Last Edit: August 27, 2011, 02:25:28 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #1 on: February 24, 2008, 12:52:49 AM »
or if use this (member.php file):

http://www.4homepages.de/forum/index.php?topic=7700.msg22313#msg22313

replace:

Code: [Select]
//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
if ($config['auto_image'] && !$uploaderror) {    
    $src_copy = MEDIA_PATH."/".$cat_id."/big";
    if ($direct_upload) {
        for ($i = 0; $i < $num_counter; $i++) {
            $HTTP_POST_FILES['media_file' . $i]['name'] = MEDIA_PATH."/".$cat_id."/".get_file_name(basename($HTTP_POST_FILES['media_file' . $i]['name']));            
        }        
    
    } else {
        for ($i = 0; $i < $num_counter; $i++) {
            $HTTP_POST_FILES['media_file' . $i]['name'] = MEDIA_TEMP_PATH."/".get_file_name(basename($HTTP_POST_FILES['media_file' . $i]['name']));
        }
    }
    
    $do_resize = 0;
    for ($i = 0; $i < $num_counter; $i++) {
        if ($image_info = @getimagesize($HTTP_POST_FILES['media_file' . $i]['name'])) {
            if ($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) {
                $do_resize = 1;
            }
        }
    }
    if ($do_resize) {
        if (!function_exists(init_convert_options)) {
            require(ROOT_PATH.'includes/image_utils.php');
            $convert_options = init_convert_options();
        }
        $convert_options = init_convert_options();
        if (!$convert_options['convert_error']) {
            if ($image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height']) {
                $result = true;
                if (!@is_dir($src_copy)) {
                    $oldumask = umask(0);
                    $result = mkdir($src_copy);
                    umask($oldumask);
                    if (!@is_dir($src_copy) || !$result) {
                        $result = mkdir($src_copy, 0755);
           }
                }
                if ($result == true) {
                    for ($i = 0; $i < $num_counter; $i++) {
                        copy($HTTP_POST_FILES['media_file' . $i]['name'], $src_copy."/".get_file_name(basename($HTTP_POST_FILES['media_file' . $i]['name'])));                                            
                        if (!$convert_options['convert_error']) {
                            $quality = (intval($config['auto_image_quality']) && intval($config['auto_image_quality']) <= 100) ? intval($config['auto_image_quality']) : 100;
                            if (!resize_image($HTTP_POST_FILES['media_file' . $i]['name'], $quality, $config['max_image_width'], 1)) {
                                $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".get_file_name(basename($HTTP_POST_FILES['media_file' . $i]['name']));
                                $uploaderror = 1;
                            }
                        }
                    }
                    
                } else {
                    $do_resize = 0;
                }
            }
        }
    }
}
//-------------------------------------------

// Step 11

In lang/english/email/upload_notify.html file,

find:

Code: [Select]
Image Name: {image_name}
File: {file_name}
Category: {cat_name}

replace:

Code: [Select]
Image Name:    {image_name}
Media file: {media_file_name}
Thumb file: {thumb_file_name}
Category: {cat_name}


// Step 12

In templates/your_template folder - create: member_multiuploadform_select.html file.

Add:

Code: [Select]
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="tablebottom">
<tr>
<td width="100%" class="head1">&nbsp;{lang_multiupload_select_title}</td>
</tr>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="tablebottom">
<tr>
<td width="50%" class="row2" align="right">{lang_member_multiuploadform_select}&nbsp;&nbsp;</td>
<td width="50%" class="row2" align="center"><br />
<form name="jumpbox" method="post" action="{url_member}">
<input type="hidden" name="action" value="uploadform">
<input type="hidden" name="cat_id" value="{cat_id}">
<select name="request_uploadform_value" onchange="if (this.options[this.selectedIndex].value != 0){ forms['jumpbox'].submit() }" class="categoryselect" class="select" />
<option>---</option>
{member_multiuploadform_select_content}
</select>
</form>
<br /><br />
</td>
</tr>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="tablebottom">
<tr>
<td width="100%" class="head1">&nbsp;</td>
</tr>
</table>

// Is work

ACP - > Setting and Change value of multiupload. Easy and finish. ;)
« Last Edit: February 18, 2011, 02:31:25 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #2 on: February 24, 2008, 02:04:48 AM »
Quote
1) Template Error: Couldn't open Template ./templates/default/member_multiuploadform_select.html

Fix post in no 2. I add step 12.

Quote
2) is upload button deleted? if only multiupload button, is this correct?

No. Is say here:

Quote
- Multiupload / Single image upload button is change from 1 to 2 in categories page.

So in ACP - if say value 1 - is single upload button. If say start from 2 - is multiupload button.

Quote
3) watermark mod is missing
http://www.4homepages.de/forum/index.php?topic=13719.0

I no have this MOD install ... what you need for integrate ? ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #3 on: February 24, 2008, 03:17:19 AM »
Quote
2) clickstream for multiupload (category missing) (see image)

In member.php file,

find:

Code: [Select]
if ($action == "requestuploadform") {   
    $txt_clickstream = $lang['multiupload_select_title'];

   
    if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
        show_error_page($lang['no_permission']);
        exit;
    }

replace:

Code: [Select]
if ($action == "requestuploadform") {   
   
    if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
        show_error_page($lang['no_permission']);
        exit;
    }
    $txt_clickstream = get_category_path($cat_id, 1).$config['category_separator'] . $lang['multiupload_select_title'];

Quote
3) error upload form see image

German form - no get.

Quote
4) error multiupload > two image > one uploadform

Yes ... and this is right ... I say in note of select page ... fill all before upload (axcept for add image fields if no require field) ...

Quote
5) very complex with 4 template files

If no like, you can always use yours ? I like this with template and easy for all for edit HTML.

Quote
6) watermark mod, yes i need it... is very popular

And ... again ... what is it you need for integrate in the MOD ? I no install the watermark MOD so what is need ?

For upload image problem, I no can reproduce this. Is work purfect for me with all info in DB and FTP.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #4 on: February 24, 2008, 04:50:01 AM »
/* Important bugfix - 23-02-2008 */

I fix step 1. Please replace full code of step.
Problem and Fix: Additional image fields for multiupload.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #5 on: February 24, 2008, 02:14:54 PM »
1 - I see category name, file no. 1 and file no. 2 in screenshot ... where is error in screenshot ?
2 - You install bugfix ?
3 - You try MOD in fresh 4images v1.76 install ?
4 - Check screenshot no 3 of ZIP file I post ... is work purfect ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #6 on: February 24, 2008, 04:01:11 PM »
I add image07.jpg screenshot in ZIP file for show multiupload additional image fields.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #7 on: February 24, 2008, 04:15:53 PM »
Quote
its your screenshot

You say you see problem with MOD and post my screenshot ? ... I no get this ... if see problem - please post your screenshot man.  :?

You moderator. What is position you do for 4homepages ? (if possible for ask)

Quote
2 - You install bugfix ? yes
3 - You try MOD in fresh 4images v1.76 install ? yes

After create bugfix, I see nada problem for multiupload. If install in fresh and no MOD, I no can reproduce this. What is PHP version use ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #8 on: February 24, 2008, 05:13:59 PM »
Is what I get for: 1 upload form if I no upload file (if select 1 / say 1 from ACP) for upload. See attach file here. I no can reproduce 2 error for 1 upload form.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #9 on: February 24, 2008, 05:56:54 PM »
Sigh - test with real server Ivan. If want test local, use Ubuntu. I use Linux, no windows. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #10 on: February 25, 2008, 02:41:11 PM »
@ivan:

I find patch for windows. Array is no create so IIS (or free package) no like this.

In member.php file,

find:

Code: [Select]
if (sizeof($image_name) == 0)  {
          $error = 1;
          $field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['image_name']), $lang['field_required']);
          $msg .= (($msg != "") ? "<br />" : "").$field_error;
      }

replace:

Code: [Select]
if (sizeof($HTTP_POST_FILES['media_file' . $i]['name']) == 0)  {
    $error = 1;
    $field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['image_name']), $lang['field_required']);
    $msg .= (($msg != "") ? "<br />" : "").$field_error;
}
« Last Edit: February 25, 2008, 03:10:11 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #11 on: February 27, 2008, 02:50:21 PM »
Now that MOD is work right ... is possible move this to release ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #12 on: February 28, 2008, 09:00:29 AM »
morning thunderstrike,

i tested this mod on windows and linux(suse).
have the same like ivan

multiupload with 2 pics.
getting only 1 form.
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Multiupload (MY version)
« Reply #13 on: February 29, 2008, 01:37:30 AM »
I update first post. MOD is no get different filename for each. Only same file name for media and thumb file for each upload window. Read update instruction for info.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline baghdad4ever

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: [MOD] - Multiupload (thunderstrike version)
« Reply #14 on: April 05, 2008, 09:28:45 PM »
it is not work

this error will come

Couldn't open Template ./templates/Default/member_multiuploadform_select_content.html