[PLUGIN] File2albummover [PLUGIN] File2albummover
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[PLUGIN] File2albummover

Started by ge-flopt, September 22, 2005, 10:42:31 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ge-flopt

Hi All,

I wanted to place this in the plugin forum, but it stated i couldn't post there, that i had to post it in the corresponding support forum. Well this forum is the only one dedicated to 1.4, so i hope it has to go in this one.

I would like to present to you my piece of software (plugin) for the 1.4 version of Coppermine.
All the info is in the file but i'll give you a bit of info about what this plugin do:
It sorts images according to the album they are in.
So let's say a picture is in the album Green and the directory the image is placed in is called Blue. After running File2albummover the directory the file is in is Green. If the directory didn't exist it was created.

Please read the info.txt before you install the plugin!
The codebase.php is well documented, so if you want to modify stuff, it'll be easy.

Hope you have fun with it.

ge-flopt

Hmmm the first who reacts on my own topic :P

Well, I don't do this to have a reply and don't have something interresting to tell. So here's the real reason to reply, version 0.2 (Codename: Machine Head) has arrived!

Difference from v0.1 (Soulfly) to v0.2 (Machine Head)
- Created Log Facility:
      - Counting of how many files are moved
      - Color codes if copy/move went correct or not
      - Error_code to see what went wrong
- Better checking if all files are moved

ToDo:
- Better integration with Coppermine (Can anyone explain how to do this?!) <- A big help would be someone who can help me with this!
- If the file has the same name, maybe change the filename and then move it

tutone

Great idea.  I was thinking that my folders are getting out of hand.  But, i can't get this to work...

Not sure what you mean by "change $imagefolder variable".  Not sure what to change this too.  i put in a /

when i try to call up the plugin i get:


Fatal error: Call to undefined function: cpg_db_query() in /plugins/f2am/codebase.php on line 23

let me know what i am doing wrong.

thanks

ge-flopt

Woei the first to reply  :P

Well that variable is a directory under the images directory. In my case:
the variable is:
$imagefolder='folder/';
and then the directory is:
albums/folder

If you want to place everything in the root of albums, you need to set the variable as:
$imagefolder='';

Hmm found a little bug, not a severe one, place a ; afters the line

note that you have to be logged in and in a seperate (Internet browser) screen you need to start the plugin like this: index.php?file=mp2d/codebase
Mp2d is the directory you have placed the plugin in

tutone

That didn't work... still get the same error...

ge-flopt

Just to make sure, if you use the variable as i entered it, what happens then?

tutone

I used the variable as you suggested and i get the same error.

ge-flopt

What i think is strange is that the function : cpg_db_query is used in coppermine but at your place you get an "undefined function: cpg_db_query" error in the script.. Strange because, if you would have an error with the script it would have it through out coppermine.

Maybe i'v found something, after the cpg_db_query on line 23 is a tab, would you like to replace it with a space?

Maybe found another solution... Which version are you using? 1.3? This one is only tested on 1.4 a possible solutions is posted here:
http://forum.coppermine-gallery.net/index.php?topic=14600.msg102271#msg102271

tutone

I took out the tab after cpg_db_query but still get the same error.

I am using 1.4x bridged with mambo.  Let me know if you want me to send you anything else.

ge-flopt

And isf you replace cpg_db_query with db_query?

Nibbler

include/init.inc.php doesn't get included if you call the plugin using ?file= - check the code at the top of index.php

ge-flopt

But how come that it works at my pc?

Nibbler

You are probably running an outdated version of 1.4 - update from cvs.

tutone

ge-flopt,

Based on Nibbler's suggestions... what do you want me to add to the code?


Stramm

Quote from: tutone on October 12, 2005, 11:16:21 PM
ge-flopt,

Based on Nibbler's suggestions... what do you want me to add to the code?




you should update your CPG 1.4

ge-flopt

Nibbler, was the last remark about me or about tutone?

Nibbler

The plugin only works because ge-flopt is running an outdated version of Coppermine. It is vital that those testing 1.4 keep their installation up to date.

tutone

ge-flopt,

Let me know when you have something for me to test.

tutone

ge-flopt

Nibbler,

I've updated CM to the latest cvs version. Now i want te update the script, but is there some info on how to work at best?

Regards

Joachim Müller

There's no documentation what mod authors are suppossed to do - this would be a very complicated task to come up with a documentation for all steps of an app that is under development. I suggest using a diff viewer to see what actually changed. Then apply your existing plugin to the most recent cvs checkout files and test-drive it. Welcome to the world of bug-hunting ;D.