[RC] Attachments in subfolders

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Suggested Hosts
pinoyboats
Registered User
Posts: 6
Joined: Tue Apr 17, 2012 4:24 pm

Re: [RC] Attachments in subfolders

Post by pinoyboats »

This mod just saved me from a whole lot of trouble of moving our board to new host. though my host still sucks... at least now I can move when I'm ready :P

Thanks!
ChrisV2
Registered User
Posts: 26
Joined: Fri May 28, 2010 1:37 am

Re: [RC] Attachments in subfolders

Post by ChrisV2 »

Hi, I have a couple of questions about this mod:

1. What is the current status? Is it safe to use on a production system?

2. I have a 3.0.7-PL1 board which I can't easily upgrade. I am perfectly comfortable to make the updates specified in the XML file myself, so I don't rely on AutoMod to do the work -- but will the utility move_attachments_in_subfolders.php work ok on my board, or do I have to make some changes to it?

Thanks!
I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 »

Hi ChrisV2,
the MOD is still in RC here, on phpbb.com, because I tried to submit it a couple of time and it was denied with, in my personal opinion, not so strong reasons, like:
move_attachments_in_subfolders.php should be called move_attachments_to_subfolders.php or something similar.
and similar...

I don't have so much time to spend in fixing all these kind of negligibles details, so I decided to quit and leave it as RC.

On the contrary, the italian phpbb support site has approved the MOD, and as far as I know, a lot of users used it with success, and is more than 1 year that I myself use it on my board, so I think it's quite stable.

You don't have to change anything on move_attachments_in_subfolder.php.

:)
jcocking
Registered User
Posts: 197
Joined: Wed Jun 08, 2005 6:47 pm

Re: [RC] Attachments in subfolders

Post by jcocking »

A couple of questions:
  1. Will it work in the most recent release, 3.0.11?
  2. My /files/ directory currently has 41,505 files. My guess is the php program to migrate all the files to the new subfolders will timeout during processing? Will I be able to restart the migration program? Any concerns?
thank you.

jeff
LotusElan.net is a fully responsive phpBB forum dedicated to the Lotus Elan Sportscars of the 1960s.
I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 »

Hi Jeff,

1) Yes, my forum is currently 3.0.11
2) The process refresh the PHP page every (if I remember well) 100 images, so no concern about timeout. We moved a 240k files image folder ;)

Ciao.
sti_22
Registered User
Posts: 6
Joined: Tue Feb 12, 2013 10:05 pm

Re: [RC] Attachments in subfolders

Post by sti_22 »

Great Job!

I did some test with our forum (14 000+ files) and it did great job. And it works fine with 3.0.11
Here are some issues I noticed:

1. there is no move_attachments_in_subfolder.html for subsilver2. After copying this file manually installation works fine.
2. I know there is a really simple algorithm to split files into subdirectories, but I got average 180 files per folder. It could be better.
3. It is possible to clean up orphan attachments (database is cleaned up) but file is not removed. But I am not sure if this works for normal bb.

Thanks anyway!
I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 »

Thank you.

1. The file is common for both styles... I have to check the installation instruction if is not included for subsilver2 installation. Sorry for that.

2. "It could be better" means that you prefer more file or less file per folder? Anyway it's feasible. It's enough to change the algorithm--- but onestly I don't see any advantage to having more or less file.

3. I wrote a separate php script to achieve the result that you need... if you want I can send it to you via PM.

:)
sti_22
Registered User
Posts: 6
Joined: Tue Feb 12, 2013 10:05 pm

Re: [RC] Attachments in subfolders

Post by sti_22 »

2. definitelly more. around 500-1000 by dir I think
3. yes. please :-)
I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 »

2. Just out of curiosity... why 500-1000 files per folder are better than 200?

Bear in mind that, when you have more then 1.000.000 files, the algorithm restart from the first folder and you have 400 file, and when you have more than 2.000.000 files, the file are 600 and so on...

3. The file is in Italian, since it has been done for my personal use... it's OK for you or I have to translate the comments, since there is a parameter inside to set up?

If it's ok i can send it immediately, if not you have to wait a bit...

:)
sti_22
Registered User
Posts: 6
Joined: Tue Feb 12, 2013 10:05 pm

Re: [RC] Attachments in subfolders

Post by sti_22 »

2. because it is eassier to handle a lot of files in several directories than otherwise.
e.g. make backup (by ftp) will take less time when there are less directories

3. let me check it. I will use google translator if neccessary. Thank you.

btw. here is translation to Polish (if you need it) :-)

'AIS_MESSAGE' => 'Ilość przetworzonych ID',
'AIS_ENDMESSAGE' => 'Migracja zakończona. Możesz teraz bezpiecznie skasować stary katalog z załącznikami (oznaczony _old).',
'AIS_TITLE' => 'Kopiuj/przenieś załączniki',
'AIS_NO_INDEX_HTML' => 'Plik index.htm nie istnieje w katalogu źródłowym. Proszę utwórz go.'
Last edited by sti_22 on Wed Feb 13, 2013 5:57 pm, edited 1 time in total.
I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 »

Hi sti_22, you have a PM.

Thank you for the translation.

:)
sti_22
Registered User
Posts: 6
Joined: Tue Feb 12, 2013 10:05 pm

Re: [RC] Attachments in subfolders

Post by sti_22 »

Works good! :-)

I noticed you aren't checking if user is loged in so I moved it to atc_attachments.php.
You can download it here: http://www.demo.ovh.pl/pl/2bd7f237f24fe ... b341a8ca9/ (link is valid for 10 days).
I changed function name "cleanuporphans" and you need to uncomment unlink. I also removed image check because I have other files too.
The rest is yours. :-)

Regards.

Btw. I can't respond by PM because I am new user here :-)
I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 »

Good work!!! ;)

Ciao.
wile
Registered User
Posts: 59
Joined: Mon Apr 30, 2007 4:21 pm

Re: [RC] Attachments in subfolders

Post by wile »

Hi I-FR70,

do you have any plans for re-submitting it as MOD again ?
I think it would be really good to have this as approved mod or much better as direct implementation in upcoming phpBB release.
Having many many files in one folder still is and still will be problem for hosting providers.

I was trying to find more information about this topic (many files in one folder of phpBB) and seems this is planned in version phpBB 3.2 what I am afraid may take ages.

Is there any list of fixes that should be done in order to approve this MOD ?
Do you mind someone's help with fixing ?
I-FR70
Registered User
Posts: 58
Joined: Wed Mar 17, 2010 2:13 pm
Name: Fabio Rambaudi

Re: [RC] Attachments in subfolders

Post by I-FR70 »

Hi wile,
as I wrote some posts ago, I don't have time to go after any approver's tantrum (in my opinion, of course... there are two sides to every story).

What I can state, from an objective point of view, is that this kind of behaviour results in discouragement... I wrote a lot of other MOD that I could share with the community, but after the first experience, I decided to let it be... :(

... but... since I've offered this work to the community, and it is fully available, if you want you can try by yourself to submit it again. You have my best wishes. ;)

:)

Return to “[3.0.x] MODs in Development”