4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
February 24, 2018, 06:42:13 AM

Login with username, password and session length
Search:     Advanced search
4images is now on facebook. Click here and become a fan!
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support)
| | |-+  Plugins (Moderators: mawenzi, Rembrandt)
| | | |-+  [PLUGIN] Batch Import From ZIP Files
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 4 5 ... 9 » »» Print
Current Topic Rating: *****
Author Topic: [PLUGIN] Batch Import From ZIP Files  (Read 204830 times)
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« 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 Very Happy (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 Sad
----------------------

[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.

* batch_zip_import.zip (30.54 KB - downloaded 1008 times.)
« Last Edit: November 02, 2008, 11:52:20 PM by V@no » Logged

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)
Maweryk
Sr. Member
****
Offline Offline

Posts: 253

Thank You
-Given: 0
-Receive: 0


View Profile
« 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
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #2 on: March 17, 2003, 02:15:52 AM »

Quote from: Maweryk   [Expand]
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. Wink
Logged

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
« 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?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

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
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #4 on: March 20, 2003, 03:45:34 AM »

First, what kind of files are u actualy trying to import? Confused
Quote  [Expand]
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   [Expand]
[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.
Logged

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
« 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...
Logged
neothealien
Guest
« Reply #6 on: March 20, 2003, 03:55:32 AM »

and yes i changed:

Quote  [Expand]
$show_extracted = 1;

and it shows all the files perfectly! just not copying .. and yeah i did check my CHMOD ...
Logged
neothealien
Guest
« 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.
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #8 on: March 20, 2003, 04:47:12 AM »

Quote from: neothealien   [Expand]
and yes i changed:

Quote  [Expand]
$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 ^...Very Happy

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
1
$data_src_path = "./batch_zip_import/zip";

to exact path to those folder i.e.
1
$data_src_path = "/home/users/blah_blah/batch_zip_import/zip";
Logged

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
« Reply #9 on: March 20, 2003, 05:48:23 AM »

Sad  not working... nothing for the extracted files Sad ... 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 Sad Sad ... 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 ..
Logged
neothealien
Guest
« Reply #10 on: March 20, 2003, 05:56:56 AM »

and also whats with this database error?

1
2
3
4
5
6
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
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #11 on: March 20, 2003, 06:09:32 AM »

Quote from: neothealien   [Expand]
Sad  not working... nothing for the extracted files Sad

already doesnt sounds too good...Confused

Quote from: neothealien   [Expand]
... 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 Sad Sad

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

Quote from: neothealien   [Expand]
... 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   [Expand]
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.
Logged

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
« Reply #12 on: March 20, 2003, 06:24:29 AM »

any reason why its not extracting the zip? i mean it can read?
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 565

mmm PHP...


View Profile WWW
« Reply #13 on: March 20, 2003, 06:26:57 AM »

Quote from: neothealien   [Expand]
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?
Logged

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
« 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
Logged
Pages: [1] 2 3 4 5 ... 9 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.228 seconds with 20 queries.