• [PLUGIN] Batch Import From ZIP Files 5 0 5 1
Currently:  

Author Topic: [PLUGIN] Batch Import From ZIP Files  (Read 224691 times)

0 Members and 1 Guest are viewing this topic.

toby86

  • Guest
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #75 on: February 12, 2007, 10:03:31 PM »
I wrote a little modification for the Batch-script:

If the exif-date of the image can be extracted, it will be stored as the picture's date in the database..
Please save your original file, I won't guarantee for anything! For me it works fine and stable.


Open "batch_zip_import.php"

Find:
Code: [Select]
    for ($i = $batchstart; $i <= $batchend; $i++) {
      $file = $files[$i];

Before add:
Code: [Select]
  function tf_get_exif_info($exif) {
  $exif_match = array();
  $exif_match['DateTimeOriginal'] = "datetime";

  $exif_array = array();
  if (is_array($exif)) {
foreach ($exif as $key => $val) {
  if (isset($exif_match[$key])) {
$exif_info = $val;
if ($key == "DateTimeOriginal") {
  $tf_exif_date_raw = preg_replace("/([0-9]{4}):([0-9]{2}):([0-9]{2})/", "\\3.\\2.\\1", $exif_info);
  $tf_exif_date_raw = explode(' ', $tf_exif_date_raw);
  $tf_exif_date_raw[0] = explode('.', $tf_exif_date_raw[0]);
  $tf_exif_date_raw[1] = explode(':', $tf_exif_date_raw[1]);
 
  $tf_exif_date = mktime( $tf_exif_date_raw[1][0], $tf_exif_date_raw[1][1], $tf_exif_date_raw[1][2], $tf_exif_date_raw[0][1], $tf_exif_date_raw[0][0], $tf_exif_date_raw[0][2] );
}
  }
}
  }
  return $tf_exif_date;
}



Find:
Code: [Select]
      $image_date = ($use_image_filemtime) ? filemtime($dir_array[$cat]['cat_path']."/".$file) : time();


Replace with:
Code: [Select]
  $src = $dir_array[$cat]['cat_path']."/".$file;
  if(function_exists('exif_read_data') && $exif_data = @exif_read_data($src, 'EXIF')) {
  $image_date = tf_get_exif_info($exif_data);
  } else {
  //fallback
  $image_date = ($use_image_filemtime) ? filemtime($dir_array[$cat]['cat_path']."/".$file) : time();
  }


Find:
Code: [Select]
show_radio_row("Use file modification time as date", "useimagefiletime", $use_image_filemtime);

Replace with:
Code: [Select]
show_radio_row("Use file modification time as date if exif-information can't be extracted", "useimagefiletime", $use_image_filemtime);


Find:
Code: [Select]
  }else{
$use_image_filemtime = 0;
}

Replace with:
Code: [Select]
  }else{
$use_image_filemtime = 1;
}

Save "batch_zip_import.php" & upload

kazimir

  • Guest
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #76 on: April 09, 2007, 12:56:07 AM »
Hi there,

I installed the mod. It works ALMOST 100%, it unzips, imports etc. But it puts the subcategorys in the Root/Main folder no matter what i choose in the Batch ZIP Import menu for "Subcategory under".

I use 1.7.4.

Anyone please??

Got the same problem... it's alwasy anzipped into the root directory... Is there a solution out there?

Greetz, kaz

Offline skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #77 on: August 07, 2007, 06:27:39 AM »
Been using the plug in successfully all day today, but as of now, when I try top use it, it just refreshed the admin panel to the main menu, the gallery menu, with no listing of files that it batch uploaded..  Any help would be appreciated..

-- Skidpics

http://skidpics.com

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #78 on: August 07, 2007, 02:27:47 PM »
Can use GZip with host ? What do if refresh ? Error message ? Just return ACP - > home page ?
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 skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #79 on: August 07, 2007, 03:39:24 PM »
Can use GZip with host ? What do if refresh ? Error message ? Just return ACP - > home page ?

I am not understanding the message, if it was intended for me?..  No error message, refresh just bring me back to the same main gallery screen..


Offline skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #80 on: August 07, 2007, 04:02:25 PM »
Can use GZip with host ? What do if refresh ? Error message ? Just return ACP - > home page ?

I am not understanding the message, if it was intended for me?..  No error message, refresh just bring me back to the same main gallery screen..



When using it, the left frame remain in the ACP home page, but the right frame side refreshes to the gallery home page..  Hope that answers that question...

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #81 on: August 07, 2007, 04:04:50 PM »
Enable GZip compression in ACP - > Setting ? Host let you 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 skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #82 on: August 07, 2007, 04:54:39 PM »
Enable GZip compression in ACP - > Setting ? Host let you use ?

All there.  Okay, I set up a generic way of what is going on, by using a e404.html file with a counter only for that page.  When a file is not found on my servier, it access the e404.html for  a redirect to another page.  I just ran it, and I am assuming that itis not finding the batch_zip file...  it is located in the /4images/admin/plugins  folder.

I am not sure what changed since yesterday, but for some reason, it is not finding the file..


Offline skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #83 on: August 07, 2007, 04:59:28 PM »
Enable GZip compression in ACP - > Setting ? Host let you use ?

figured it out.  I have a subdomain for 4images.skidpics.com, and it was access the file wrong - not sure why it does allow forwarding like that, but it works now.


if I use http://skidpics.com, etc..  it works, but if I use 4images.skidpics.com/etc...  it doesn't..  my apologies for taking up your time!

Offline dbranko

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #84 on: August 07, 2007, 07:45:08 PM »
Is it posible to import existing images to zip!

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #85 on: August 07, 2007, 07:47:06 PM »
Close thing:

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

(support ZIP in download) ;)
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 lanps9.99

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #86 on: August 29, 2007, 03:41:32 PM »
is there any problem if i delete the zip file after i put category and sub have been made

Offline skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #87 on: September 25, 2007, 06:20:36 AM »
Is there a way to allow the plugin to browse the vitual directory in order to find the .zip file instead of having a default directory to have to upload to.   I am at a cross between photopost and coppermine software, and trying to find a bit more manageable software for my users, and pictures..

http://skidpics.com

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #88 on: September 25, 2007, 12:30:14 PM »
Quote
is there any problem if i delete the zip file after i put category and sub have been made

No problem for delete. ;)

Quote
Is there a way to allow the plugin to browse the vitual directory in order to find the .zip file instead of having a default directory to have to upload to.   I am at a cross between photopost and coppermine software, and trying to find a bit more manageable software for my users, and pictures..

Yes, is possible. ;)
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 skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: [PLUGIN] Batch Import From ZIP Files
« Reply #89 on: September 25, 2007, 04:09:07 PM »
Quote
Is there a way to allow the plugin to browse the vitual directory in order to find the .zip file instead of having a default directory to have to upload to.   I am at a cross between photopost and coppermine software, and trying to find a bit more manageable software for my users, and pictures..

Yes, is possible. ;)
[/quote]

What would I need to change?