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

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

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[PLUGIN] Batch Import From ZIP Files
« on: March 16, 2003, 12:51:09 AM »
Since only one person has problem with this PLUGIN, and it works for many others, I moved this PLUGIN as FINAL version in MODs forum :D (no changes has been made though)

[OVERVIEW]
-----------------------------------------------
This is an addon for Admin Control Panel (Plugin) that works 98% as "Batch Import" Plugin: http://4homepages.de/forum/viewtopic.php?t=2164
The difference is that this plugin looking for .zip file in sertain folder, then unzip it and import files into 4images. Also, this plugin has all necesery settings that can be changed through web interface, no need modify ANY files.

This plugin uses PclZip library.
----------------------

-----------------------------------------------
I dont know how it will behave on *nix servers or on Windows + IIS
Also, with this plugin u can not import images into already existing category :(
----------------------

[INSTALATION]
-----------------------------------------------
Download attached file.

Create following folder:
/admin/plugins/batch_zip_import/zip/
extract files from downloaded batch_zip_import.zip
upload them into /admin/plugins/
after that u should have this tree of files on your server:

/admin/plugins/batch_zip_import.php
/admin/plugins/batch_zip_import/pclzip.lib.php
/admin/plugins/batch_zip_import/zip/


IMPORTANT:
CHMOD 777 /admin/plugins/batch_zip_import/zip/
----------------------

[HOW TO USE]
-----------------------------------------------
1. Create a folder, with name as u want your new category named (e.i. nature).
2. Copy your pictures in that folder.
If u want import thumbnails at ones, create subfolder with name thumbnails (i.e. /nature/thumbnails/ ). Copy your thumbnails in it.
3. Create a zip archive from main folder (in my example "nature").
4. Upload it into /admin/plugins/batch_zip_import/zip/ folder.
5. Go to Admin Control Panel, on left-bottom u should see new link "Batch ZIP Import"
----------------------

[KNOWN BUGS]
-----------------------------------------------
U can not have ANY files in the root of your .zip archive
All importing files MUST be located inside a folder in the .zip file.
e.i.
This archive tree is wrong:

/summer.jpg
/winter.jpg
/thumbnails/summer.jpg
/thumbnails/winter.jpg


This archive tree is correct:

/seasons/summer.jpg
/seasons/winter.jpg
/seasons/thumbnails/summer.jpg
/seasons/thumbnails/winter.jpg


Please let me know if it works or not, so I can move this thread in MODs forum.
« Last Edit: November 02, 2008, 11:52:20 PM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Maweryk

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
[PLUGIN] Batch Import From ZIP Files
« Reply #1 on: March 17, 2003, 12:58:05 AM »
Hi V@no!
Another great mod! Thanks!
It is possible to modify the mod, so that a user can upload a zip-file and the mod extract the files in the category.

http://www.4homepages.de/forum/viewtopic.php?t=3979&highlight=

Thanks a lot for your great Mods!

Cheers

Markus

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[PLUGIN] Batch Import From ZIP Files
« Reply #2 on: March 17, 2003, 02:15:52 AM »
Quote from: Maweryk
It is possible to modify the mod, so that a user can upload a zip-file and the mod extract the files in the category.

Modify this plugin -> no
but create separate mod -> will try. ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

neothealien

  • Guest
[PLUGIN] Batch Import From ZIP Files
« Reply #3 on: March 20, 2003, 03:28:20 AM »
i tried it on my first server .. worked perfectly ... but when i tried it on the second server (different hos) it gives me the following error... can u help me with it?? whats wrong? how to fix it?

Code: [Select]

Import category ...
DB Error: Bad SQL Query: SELECT cat_order FROM gallery_categories WHERE cat_parent_id = ORDER BY cat_order DESC LIMIT 1
You have an error in your SQL syntax near 'ORDER BY cat_order DESC LIMIT 1' at line 4

DB Error: Bad SQL Query: INSERT INTO gallery_categories (cat_id, cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment) VALUES (21, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 0)
You have an error in your SQL syntax near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 0)' at line 4
FAILED

1. Importing image aquota.group

Warning: Unable to access /aquota.group in /home/virtual/site385/fst/var/www/html/gallery/admin/plugins/batch_zip_import.php on line 206
Copy Image: Error while copying image /aquota.group
Skipping.....

2. Importing image aquota.user

Warning: Unable to access /aquota.user in /home/virtual/site385/fst/var/www/html/gallery/admin/plugins/batch_zip_import.php on line 206
Copy Image: Error while copying image /aquota.user
Skipping.....

3. Importing image cmd.txt

Warning: Unable to access /cmd.txt in /home/virtual/site385/fst/var/www/html/gallery/admin/plugins/batch_zip_import.php on line 206
Copy Image: Error while copying image /cmd.txt
Skipping.....

4. Importing image core

Warning: Unable to access /core in /home/virtual/site385/fst/var/www/html/gallery/admin/plugins/batch_zip_import.php on line 206
Copy Image: Error while copying image /core
Skipping.....

5. Importing image lwp.pl

Warning: Unable to access /lwp.pl in /home/virtual/site385/fst/var/www/html/gallery/admin/plugins/batch_zip_import.php on line 206
Copy Image: Error while copying image /lwp.pl
Skipping.....


Import finished

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [PLUGIN] [ALPHA] Batch Import From ZIP Files
« Reply #4 on: March 20, 2003, 03:45:34 AM »
First, what kind of files are u actualy trying to import? :?
Quote
Importing image aquota.group

that's not an image...
Second, make sure your .ZIP files are created with this tree format:
Quote from: V@no
[KNOWN BUGS]
-----------------------------------------------
U can not have ANY files in the root of your .zip archive
All importing files MUST be located inside a folder in the .zip file.
e.i.
This archive tree is wrong:

/summer.jpg
/winter.jpg
/thumbnails/summer.jpg
/thumbnails/winter.jpg


This archive tree is correct:

/seasons/summer.jpg
/seasons/winter.jpg
/seasons/thumbnails/summer.jpg
/seasons/thumbnails/winter.jpg


Please let me know if it works or not, so I can move this thread in MODs forum.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

neothealien

  • Guest
[PLUGIN] Batch Import From ZIP Files
« Reply #5 on: March 20, 2003, 03:47:43 AM »
thats the problem... the zip file contains 5 jpgs... the zip workls perffectly on a different server ... but this server its grabbing these unkown files... (i tried 2 zips with images.. all gave me these unknown files..) ... kinda confused...

neothealien

  • Guest
[PLUGIN] Batch Import From ZIP Files
« Reply #6 on: March 20, 2003, 03:55:32 AM »
and yes i changed:

Quote
$show_extracted = 1;

and it shows all the files perfectly! just not copying .. and yeah i did check my CHMOD ...

neothealien

  • Guest
[PLUGIN] Batch Import From ZIP Files
« Reply #7 on: March 20, 2003, 03:59:49 AM »
for some reason grabbing the wrong files... and no they files dont even exist on my ftp.. to my knowledge at least.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[PLUGIN] Batch Import From ZIP Files
« Reply #8 on: March 20, 2003, 04:47:12 AM »
Quote from: neothealien
and yes i changed:

Quote
$show_extracted = 1;

and it shows all the files perfectly! just not copying .. and yeah i did check my CHMOD ...

While I modifyed the plugin, to have extra option for debug, u posted it ^...:D

redownload the plugin, u'll see new option "Only show extracted files".
it will show u files that found inside .zip file and files phisicaly extracted in ./temp/ folder
if they are the same, then I really have no clue what could be wrong.
also, change
Code: [Select]
$data_src_path = "./batch_zip_import/zip";
to exact path to those folder i.e.
Code: [Select]
$data_src_path = "/home/users/blah_blah/batch_zip_import/zip";
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

neothealien

  • Guest
[PLUGIN] Batch Import From ZIP Files
« Reply #9 on: March 20, 2003, 05:48:23 AM »
:(  not working... nothing for the extracted files :( ... btw still wondering where is the thing getting those unknown files from.. ill try to do some debugign my self.. but doubt it.. i need this BAD :( :( ... btw i forgot to tell u ..

if u type in www.mydomainname.com/admin
it goes to my hosting control panel

and next
if u type in www.mydomainname.com/gallery --> it wont work
if u type in www.mydomainname.com/gallery/ --> will work

its strange first time seen that u gotto add a trailing / in the url to load the page ..

neothealien

  • Guest
[PLUGIN] Batch Import From ZIP Files
« Reply #10 on: March 20, 2003, 05:56:56 AM »
and also whats with this database error?

Code: [Select]
DB Error: Bad SQL Query: SELECT cat_order FROM gallery_categories WHERE cat_parent_id = ORDER BY cat_order DESC LIMIT 1
You have an error in your SQL syntax near 'ORDER BY cat_order DESC LIMIT 1' at line 4

DB Error: Bad SQL Query: INSERT INTO gallery_categories (cat_id, cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment) VALUES (21, '', '', , 10, 0, 0, 2, 2, 9, 0, 0, 0, 0)
You have an error in your SQL syntax near ' 10, 0, 0, 2, 2, 9, 0, 0, 0, 0)' at line 4
FAILED

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[PLUGIN] Batch Import From ZIP Files
« Reply #11 on: March 20, 2003, 06:09:32 AM »
Quote from: neothealien
:(  not working... nothing for the extracted files :(

already doesnt sounds too good...:?

Quote from: neothealien
... btw still wondering where is the thing getting those unknown files from.. ill try to do some debugign my self.. but doubt it.. i need this BAD :( :(

since there is nothing actualy extracted, then it probably trying take files from server's root dir.

Quote from: neothealien
... btw i forgot to tell u ..

if u type in www.mydomainname.com/admin
it goes to my hosting control panel

then, try change data_src_path to another folder that doesnt point to /admn/ folder and upload your .zip files there (in this case, u'll have to put full path "/home/user/blah_blah/path"

Quote from: neothealien
and next
if u type in www.mydomainname.com/gallery --> it wont work
if u type in www.mydomainname.com/gallery/ --> will work

its strange first time seen that u gotto add a trailing / in the url to load the page ..

usualy that how it goes, when in Apache config Alias set as "alias_name/"
ask your host about it.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

neothealien

  • Guest
[PLUGIN] Batch Import From ZIP Files
« Reply #12 on: March 20, 2003, 06:24:29 AM »
any reason why its not extracting the zip? i mean it can read?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[PLUGIN] Batch Import From ZIP Files
« Reply #13 on: March 20, 2003, 06:26:57 AM »
Quote from: neothealien
any reason why its not extracting the zip? i mean it can read?

not sure, maybe because /admin/ dir point to somewhere else?
by the way, how do u actualy go to 4images admin control panel?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

neothealien

  • Guest
[PLUGIN] Batch Import From ZIP Files
« Reply #14 on: March 20, 2003, 06:28:57 AM »
well actually here is the structure:


http://66.36.167.14/ --> Root but redirects to folder "gallery"

http://66.36.167.14/gallery/ -->  Main site

http://66.36.167.14/gallery/index.php --> Gallery Index

http://66.36.167.14/gallery/admin/ --> Gallery Admin

http://66.36.167.14/admin/ --> Host CP