[PLUGIN] File2albummover - Page 2 [PLUGIN] File2albummover - Page 2
 

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]

Main Menu

[PLUGIN] File2albummover

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ge-flopt

Made a quick an dirty update to make it work. Probibly not the most buitifull one, but it works, so now can everyone work with it that has the latest CVS version of CM

tutone

I ran it and it seemed to move alot of the files... but there were alot that had "error 1".  How do i fix "error 1"?

ge-flopt

Errorcode 1 means that he can't copy the original file to the new location, probably that the rights on the original file/directory aren't sufficiant.

tutone

Ok i tried to change the rights to each folder (and the files) to 777.... the files still were not moved.  ANd upon further investigation none have been moved.  what else should i try?

ge-flopt

Just checking:
- The destination dir has sufficiant right?
- What's the album name? Does it contain "strange" characters?

tutone

the destinatin directory has 777 rights... so do the beginning folders
a couple of the albums have & or "... but the albums are created ok... the files aren't being moved.  What else should i try?

ge-flopt

If all your directories have that problem, and all of them have & in it, i have to make a change to the convert part (Change spaces and /'s to undescores). Probebly only the creation of the directory hoes ok, but the copy goes wrong.

tutone

only a couple of them have & so i don't think that is the problem. 

ge-flopt

Then i don't have an idea why it goes wrong, sorry..

One last try, do the log files of apache give an error or something?

javog

For Coppermine 1.4.2 you need to change the following in codebase.php:

Code (Line 34) Select
        $OLD_DIR=$ALBUMS_DIR."".$total[15];                                                                     //eg Albums/trees/
to
        $OLD_DIR=$ALBUMS_DIR."".$total[18];                                                                     //eg Albums/trees/
and
Code (Line 35) Select
        $OLD_FILE=$total[16];                                                                                           //eg greentree.jpg
to
        $OLD_FILE=$total[19];                                                                                           //eg greentree.jpg
and
Code (Line 113) Select
                        $UPDATE_SQL_QUERY="UPDATE ".$CONFIG['TABLE_PICTURES']." SET filepath='".$NEW_DIR_NO_AD."' WHERE pid=".$total[13];       //This is the sql statement that modifies the database so the new dir's are corrected
to
                        $UPDATE_SQL_QUERY="UPDATE ".$CONFIG['TABLE_PICTURES']." SET filepath='".$NEW_DIR_NO_AD."' WHERE pid=".$total[16];       //This is the sql statement that modifies the database so the new dir's are corrected

ge-flopt

Sorry for the late reply.. Due to personal problems, i didn;t have time to update. New version is here. Didn't change the numbers as asked, but changed the query to make it work also with a newer version of CM.

Have tested it and it seems to work. If someone has another problem, please post, will try to fix it within a week and not a month.

ktwenrick

i got this error when trying to install.. im using 1.4.5

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/xpressi/public_html/jake/gallery/plugins/f2am/codebase.php on line 24

ktwenrick

if anyone can help, i really love this mod, it makes things easier.. i got it to work once a long time ago, but since then have updated my coppermine and it doesn't seem to work anymore..thanks yall

Paver

This last plugin version is certainly a beta version because it has syntax errors.

Near the beginning, modify your codebase.php to match this:
require_once('include/init.inc.php');
include('configuration.php');
$TABLE_PREFIX=$CONFIG['TABLE_PREFIX'];
$RESULT = cpg_db_query("SELECT {$CONFIG['TABLE_PICTURES']}.filepath, {$CONFIG['TABLE_PICTURES']}.filename,
{$CONFIG['TABLE_PICTURES']}.pid, {$CONFIG['TABLE_ALBUMS']}.title
FROM {$CONFIG['TABLE_ALBUMS']},{$CONFIG['TABLE_PICTURES']}
WHERE {$CONFIG['TABLE_ALBUMS']}.aid={$CONFIG['TABLE_PICTURES']}.aid
ORDER BY {$CONFIG['TABLE_ALBUMS']}.title"
);


I don't know if this will cause the plugin to work because I have never used it before and I'm not really sure what it will do.  So BE CAREFUL - you should probably be testing this on a test site or at least a backed-up site. 

mrandall131

BUMP

Has anyone tested this out?  I have been looking for something like this for a while.

jokera

Does this plugin still continue test and modify?  ???
I've test 0.1 in plugin pack and try to modify it.
Why not change target file directory to /albums/[user id]/[album name] ? ???

ge-flopt

Well, it doesn't get modified, because i didn't get really any bugs. What Paver said, i didn't modify because, everything worked. I didn't get any new features to add. I'll have a look at it.

jokera

I got the same error message in CPG 1.4.10 with file2albummover-v0.3Beta 2

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/testcpg/plugins/file2albummover/codebase.php on line 24


After modified by Paver's solution,it's OK.
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fjokera.mrs3.com%2Fpg%2Falbums%2Fuserpics%2F0%2F%25E6%2595%2599%25E5%25AD%25B8%25E7%2594%25A8%2File2albummover_001_%25E5%25A4%25A7%25E5%25B0%258F_.jpg&hash=3eeb8916ac1f707669b9fc20a9ce64ab52c56d4f)

Can I modify your 0.3Beta 2 for changing target directory?
The plugin seems work very well in my Fedora Core 5 Unicode system
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fjokera.mrs3.com%2Fpg%2Falbums%2Fuserpics%2F0%2F%25E6%2595%2599%25E5%25AD%25B8%25E7%2594%25A8%2File2albummover_002_%25E5%25A4%25A7%25E5%25B0%258F_.jpg&hash=d3826a12027b435bf090281be41aaf1ab72babde)

ge-flopt

jokera, i will make an update, so the paver update will be included.

Hope i will get the time to modify it to include user id, but then i need to get the time.

jokera

a little suggestion
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fjokera.mrs3.com%2Fpg%2Falbums%2Fuserpics%2F0%2F%25E6%2595%2599%25E5%25AD%25B8%25E7%2594%25A8%2File2albummover_003.jpg&hash=73e9d2601a0fa1677ae2b9f5914b4a73e9d087ba)
Directory name -> Userid can be replaced by categery in table albums
I modify your 0.1 to suite my mind,like first picture's [old directory]  ;D
Take it easy.You can modify it when you have really enough time  ;)