Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

move is not updating xml files
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=3523
Page 1 of 1

Author:  georgelotus [ 31. Mar 2013, 20:05 ]
Post subject:  move is not updating xml files

Nice message: "If you copy/move/rename a folder with pictures the xml files in the xml folder are not copied or renamed. You have to do this manually!"
From readne:
So what needs to be done to the xml files?

From readme: "version 1.0 rename copy of xml files if folders are renamed/moved"

Have you already worked on this, as I'm willing to do some programming there.

George

[edit: replaced rant by readme]

Author:  TinyWebGallery [ 31. Mar 2013, 22:09 ]
Post subject:  Re: move is not updating xml files

Hi,

I don't have done anything here.

If you copy/move/rename a folder in the TWGExplorer or in the Flash Uploader the xml files has to be renamed.

But you already have the option
1. to have the xml files in the folder
2. set $autocreate_folder_id=true; // (true/false) Since 1.7.7 you can use a folder.id file which is the prefix for all xml files - You can now create this file automatically with the current directory in it. This enables you to move folders without loosing any xml data like comments or tags.

So you actually only have to set $autocreate_folder_id=true; and if php is allowed to create the folder.id then everything is fine.

This is why I naver implemeneted a real rename because the folder.id solution works really good ;). So actually it is time to update the howto...

Best, Michael

Author:  TinyWebGallery [ 31. Mar 2013, 23:32 ]
Post subject:  Re: move is not updating xml files

But there is still no solution if you copy a folder. Even when you set $autocreate_folder_id=true;
there you have to do stuff manually!
But who copies folders...? ;).

Best, Michael

Author:  georgelotus [ 1. Apr 2013, 18:19 ]
Post subject:  Re: move is not updating xml files

> But who copies folders...?

I wrote once a gallery withc copy function.
It was done using linux hardlinks, but today one rather uses tags to do classifications.

I was using $store_xml_in_picfolders=true
but it didn't do what I expected (i.e. all xml is still in the xml folder)

About $autocreate_folder_id=true I did not understand how that works so never tried. I will check if it's doing what I need.

Author:  georgelotus [ 1. Apr 2013, 18:29 ]
Post subject:  Re: move is not updating xml files

so I moved the folder using folder.id
So far worked fine.
The thumbnails do not use folder.id (yet?) so were regenerated.
That's just a mmv to do, but still better include it into the file manager.

Author:  georgelotus [ 1. Apr 2013, 18:37 ]
Post subject:  Re: move is not updating xml files

also the creation of the folder.id file changed the date of all my folders to today.
So now everthing is shown as "new".

I suggest to create a special file in each directory which is only touched when a new picture is added.
That's faster than to list every time in each folder all pictures to find the most recent one.
Any other modifications in the directory should not change the NEW flags.
Also, if the timestamp is changed, do it also on the parent folders so that a NEW tag is displayed even if a picture is added some levels deep.

Author:  TinyWebGallery [ 2. Apr 2013, 09:47 ]
Post subject:  Re: move is not updating xml files

Hi,

the "New" flag is not triggered by the folder.id file but by the change of the date of the folder. And this is done if a change in the folder happens. So there is no scan every time for new files.

Thumbnails have of course to be generated because the copied folder could have different settings.

$store_xml_in_picfolders=true; should store the xml files in the pictures folder. I don't know why this should not work for you. The should even be a migration.

Best, Michael

Author:  georgelotus [ 3. Apr 2013, 00:25 ]
Post subject:  Re: move is not updating xml files

I still think not using the directory timestamp for the NEW flags would be a goog idea.
Why? Well I did a little gallery script 10 years ago... and it's sorting was based on timestamps of dedicated files in each folder instead of the folder itself. so copying, moving or creating files (e.g. folder.txt in my case) won't affect sorting.

Author:  TinyWebGallery [ 3. Apr 2013, 09:36 ]
Post subject:  Re: move is not updating xml files

But TWG does also work if you upload files by FTP. So if you add new files this way only the directory time gets updated or you scan the whole directory each time.
You could of course extend this functionality by checking the folder only if the directory time changes. So this would be a 2nd step.

Best, Michael

Author:  georgelotus [ 3. Apr 2013, 18:53 ]
Post subject:  Re: move is not updating xml files

ha, yeah. The ftp upload. I just never implemented that possibility to not have the issue.
Maybe like this: directory stamp is newer than lastfile.stamp? then scan directory and set same stamp on lastfile.stamp and on the directory.
that should work. Even no need to update lastfile.stamp on every upload.

Author:  TinyWebGallery [ 3. Apr 2013, 21:01 ]
Post subject:  Re: move is not updating xml files

As i have written. A 2 step solution would work. I have now folder.id as default file which is created to identify a folder even when it is renamed.

Best, Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/