Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 [2] 3 4 5 6   Go Down

Author Topic: Batch add with automatic album/cat structure from directory tree.  (Read 138263 times)

0 Members and 1 Guest are viewing this topic.

Juanito

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #20 on: April 14, 2005, 06:11:05 am »

i get the following error message:

Warning: array_diff_assoc(): Argument #2 is not an array in C:\WebRoot\photogallery\timer.php on line 102
After filtering 0 pictures will be added
structure created, 0 files to add.

im trying to use flux's versio... plz help!!  :(

the original one by nibbler works great though but the other 2 modified versions are giving me errors. it'd be nice to have the extra features. any help is appreciated. thanks!
« Last Edit: April 14, 2005, 09:38:05 am by Juanito »
Logged

moulari

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #21 on: April 17, 2005, 05:18:00 pm »

The idea for the timer script is what i have been searchin now for almost a year for my CPG, unfortunatly none of the three works for me.
Since I was feed up with the normal upload process my gallery stopped at 615 Pics -> although on my local disc i got 3000+. So now i did as discribed set up a directory structure under albums/test/test/ and uploaded some random pics for a quick test - but all the three tested scripts give me the following back "Using root Category
structure created, 0 files to add."  -> But there is no structure created.

So schould i use a fresh install of CPG for the scripts or are there any special options in CPG which i schouldn't use?

Thx for the script anyway hope it works for me too soon

Setup:
Apache 1.xxx
PHP 4.3.8
Logged

Nibbler

  • Guest
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #22 on: April 17, 2005, 05:22:40 pm »

Make sure you setup a legal file structure - check the previous postingt about this.
Logged

moulari

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #23 on: April 18, 2005, 11:06:01 am »

thx for the tip

my directory structure looks like this (nevermind the word since its german)

/albums/Schloss/Sommer/xxxxxx.jpg

So is this legal or do i have to change something?

Solved it: installed cpg1.4.1 now the script isrunning flawless
« Last Edit: April 18, 2005, 08:19:35 pm by moulari »
Logged

moulari

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #24 on: April 20, 2005, 11:45:03 pm »

Ok maybe my flawless was to fast written  ;D

After a night of running, i counted 2549 files in 53 albums and 28 categories added. When comparing the structured in CPG with the directory structure in /albums. I found one directory which wasn't added, i'm not speaking of userpics and edit, I mean a drectory with a legal structure.

the structure would be: /albums/Urlaube & Reisen/Wagrain Skifahren/Februar03

when running again found out the, creation process for albums and categorys stops and displays a warning message and stops. Pls check attached picture for the look of the message.

any suggestions??
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #25 on: April 21, 2005, 03:41:29 am »

The '&' in the folder name may be causing the issue. Try using something else.
Logged

moulari

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #26 on: April 22, 2005, 12:23:24 am »

The & can't be the error because it is in another categoryname too and that one was addede correctly.
Logged

Nibbler

  • Guest
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #27 on: April 22, 2005, 02:30:44 pm »

So enable debug mode and post the actual mysql error message ;)
Logged

moulari

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #28 on: April 24, 2005, 11:46:17 am »

thx for the debug tip, solved the problem. The error was in another directory with an album name with an invalid character.
Logged

tramfam

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #29 on: April 25, 2005, 03:51:46 am »

Thanks to all who've done a great job on this script. I started with a fresh install of Coppermine and the scripts would create the categories, but not populate the albums. I realized that the scripts fail if there are no pictures already defined in the database!

So import a single file by hand to ensure that at least one picture is in the gallery. Then proceed with the timer script!

Thanks,
Mark
Logged

londonhogfan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
    • The Razorback Legacy
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #30 on: April 29, 2005, 08:37:46 pm »

works great.  Installed from scratch and have uploaded over 1,000 pics with no problems.  Saved me soo much gime.

www.razorbacklegacy.com/hog_archive
Logged
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.razorbacklegacy.com%2Fhog_archive%2Fpic.jpg&hash=86770976fd31816f54516583076916c0)

niuck

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #31 on: July 01, 2005, 07:37:49 pm »

I'm having problems with the original script. It doesn't upload the pictures, just creates category and albums.
My dirs look like this: /var/www/localhost/htdocs/fester/albums/Categories/Albums/Pics.jpg <- thats okey right? It's all chmodded to 777.

This is what i get when i click begin in the script:.
Code: [Select]
Created root category
created album 000429_Valborg
created album 000517_Boras
created album 001012_Forfest_Kaneback
created album 001105_Kanarieoarna
created album 000101_Fest_Atvid
created album 000101_Pokerkvall_David
created album 000205_Pokerkvall_Bigalow

Notice: Undefined index: auto in /var/www/localhost/htdocs/fester/timer.php on line 175
structure created, 325 files to add.
When i click continue to convert the pictures nothing happens.

Here is some info:
Code: [Select]
USER:
------------------
Array
(
    [ID] => 826d834b7f0764b5223187fec79ce0d4
    [am] => 1
    [liv] => Array
        (
            [0] => 236
            [1] => 176
            [2] => 229
            [3] => 223
            [4] => 209
        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_group] => 1
    [user_active] => YES
    [user_name] => niuck
    [user_password] => ********
    [user_lastvisit] => 2005-07-01 18:57:34
    [user_regdate] => 2005-06-29 05:51:31
    [user_group_list] =>
    [user_email] =>
    [user_website] =>
    [user_location] =>
    [user_interests] =>
    [user_occupation] =>
    [user_actkey] =>
    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 3
    [ufc_min] => 3
    [custom_user_upload] => 0
    [num_file_upload] => 5
    [num_URI_upload] => 3
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 3
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
    [groups] => Array
        (
            [1] => 1
        )

)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content FROM cpg133_filetypes;
    [1] => SELECT * FROM cpg133_users WHERE user_id='1'AND user_active = 'YES' AND user_password != '' AND BINARY MD5(user_password) = '48f8d008981572fd9fc3218c2460c833'
    [2] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg133_usergroups WHERE group_id in (1)
    [3] => SELECT group_name FROM  cpg133_usergroups WHERE group_id= 1
    [4] => DELETE FROM cpg133_banned WHERE expiry < '2005-07-01 19:32:34'
    [5] => SELECT * FROM cpg133_banned WHERE ip_addr='192.168.1.1' OR ip_addr='192.168.1.1' OR user_id=1
    [6] => SELECT parent FROM cpg133_categories WHERE cid = '33' LIMIT 1
    [7] => UPDATE cpg133_categories SET parent='0' WHERE parent = '33'
    [8] => UPDATE cpg133_albums SET category='0' WHERE category = '33'
    [9] => DELETE FROM cpg133_categories WHERE cid='33' LIMIT 1
    [10] => SELECT cid FROM cpg133_categories WHERE 1
    [11] => UPDATE cpg133_categories SET parent = '0' WHERE parent=cid OR parent NOT IN (1)
    [12] => SELECT cid, name, description FROM cpg133_categories WHERE parent = '0' ORDER BY pos
    [13] => SELECT cid, name, description FROM cpg133_categories WHERE parent = '1' ORDER BY pos
    [14] => UPDATE cpg133_categories SET pos='0' WHERE cid = '1' LIMIT 1
    [15] => SELECT pid, filepath, filename, url_prefix FROM cpg133_pictures,cpg133_albums WHERE cpg133_pictures.aid = cpg133_albums.aid AND cpg133_albums.category = '33' AND approved='YES' ORDER BY filename
)

==========================
GET :
------------------
Array
(
    [op] => deletecat
    [cid] => 33
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 4.3.11 - OK
------------------
mySQL version: 4.0.24
------------------
Coppermine version: 1.3.3
==========================
Module: gd
------------------
GD Support enabled
GD Version bundled (2.0.28 compatible)
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
==========================
Module: mysql
------------------
Active Persistent Links 0
Active Links 1
Client API version 4.0.24
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.2.2
Linked Version 1.2.2
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/lib/php | .:/usr/lib/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 999999 | 999999
max_input_time | 300 | 300
upload_max_filesize | 2M | 2M
post_max_size | 16M | 16M
==========================
Page generated in 0.237 seconds - 16 queries in 0.012 seconds - Album set :

Anyone knows what could be wrong?
I'm using 1.3.3 in Gentoo if that matters.

Thanks!
« Last Edit: July 01, 2005, 07:59:39 pm by niuck »
Logged

Woofy

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #32 on: September 02, 2005, 11:26:57 am »

Hi there !

I'm having some troubles with timer.php.
Well, I'm using Coppermine 1.3.3 , Apache 2, PHP 5 on a FC4 distro.

When I try to use timer.php, I get this Fatal error :

"Fatal error: Call to undefined function cpg_db_query() in /var/www/html/cpg/timer.php on line 241"

My "albums" directory's structured as following :

albums
   FTP
      categ
         album
            .jpg files

After a litlle search, I don't find any cpg_db_query declaration ... Is this hack working with cpg 1.3.3 ? Am I missing something ?

Thanks for your help !
Logged

Nibbler

  • Guest
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #33 on: September 02, 2005, 12:15:45 pm »

Looks like you are using a version designed for cpg1.4. Which version of the mod are you using ?
Logged

Woofy

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #34 on: September 07, 2005, 04:00:25 pm »

I've tried the one post by Flux, and the mod posted by donnoman (your mod modified to enable retries).

In some posts, I've seen some answer for similar problems on several mods (between 1.4 and 1.3.x), and the solution was to replace cpg_db_xxx function call by db_xxx. Is that a solution for me too ?

!!! EDIT :

I've solved my problem : I've changed changing cpg_db_query function call to db_query which is the correct function nam in cpg 1.3.3.
My mod was effectively for cpg1.4, sorry for my mistake Nibbler (and for my poor english of french guy)  ;D
« Last Edit: September 07, 2005, 05:27:29 pm by Woofy »
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #35 on: September 30, 2005, 06:26:53 am »

I took Flux's timer.php and merged a couple of my changes to his code.  This is tested with cpg 1.3, for 1.4 you should just need to change the db_query's with cpg_db_query's.

« Last Edit: October 01, 2005, 06:10:09 am by donnoman »
Logged

flux

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 80
    • CPG Remote Hack Demo
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #36 on: October 02, 2005, 12:27:00 am »

lo,

@donnoman
what kind of changes did you add to my script exactly ?


i was stupid enough not to see that a more advanced script than the original one had been already made when i started mine..
basically the only thing i made in my script that may not have been in the previous script was to skip all the already existing pictures in the galleries at once, that increased the processing speed greatly.. besides that my script just made sure categories/albums didn't already exist before creating new ones, as the other script does..

And yes i made my script for 1.3 only so it shouldn't work with 1.4 and to make it work you only have to replace the db function name..

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #37 on: October 10, 2005, 09:37:12 pm »

I liked your method of filtering out stuff that already had been imported. So I dropped most of my code in favor of yours. I just added the pieces that allow you to pass the intial directory as null and it will import everything under the "albums" directory.
Logged

CLG

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #38 on: October 18, 2005, 01:23:07 pm »

Hi,
I have some problem by adding with the postet scripts (i tryed all, from flux&donnoman). I must add 38 Gigabyte Pictures (50k+) and some pictures have a size of >5mb, all pictures under 1mb add the script without problems, when a bigger picture in the directory the whole script stop..

i have changes the php.ini of 2400 and 500mb, and have in the config from coppermine 6000kb, and the script canīt import a file with 1500kb, why this?

please help me.. pascal
Logged

flux

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 80
    • CPG Remote Hack Demo
Re: Batch add with automatic album/cat structure from directory tree.
« Reply #39 on: October 19, 2005, 02:06:22 pm »

don't think it has anything to do with the scripts..

as far as i can tell you've covered with your settings the various sources of limitations (cpg & php)..
Now if you don't get any debug info it'll be hard to debug, i guess you should turn on dubug in cpg config and maybe you'll get some interesting output when the script fails..

But personnaly i'd put my money on the image component, not sure GD2 or image magic are bug free..

Once you've found some debug info you should ask some support in a support forum..

A good test would also be to try it thru cpg integrated batch add tool and see what happens, if it fails too then it has nothing to do with the script itself but more with a cpg core funtion maybe or with a server component (gd, php, apache and so on..) and don't forget to turn debug on in your cpg config..
Pages: 1 [2] 3 4 5 6   Go Up
 

Page created in 0.049 seconds with 23 queries.