Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: emanuele on May 19, 2011, 10:20:51 PM

Title: Automanage attachments
Post by: emanuele on May 19, 2011, 10:20:51 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2851)

Automatically create and change active attachments directory depending on settings.

The mod can create a directory structure based on post date (subdividing attachments by year, or by year and month or by year, month and day) or simply adding a new directory when the space limit is reached.

Settings

Known issues

Change log
Title: Re: Automanage attachments
Post by: kokett on June 10, 2011, 04:48:13 AM
Hello,

great Mod! It would be nice having this Feature in SMF 1.1.13. Is it possible to backport this MOD?

Greetings
Title: Re: Automanage attachments
Post by: emanuele on June 10, 2011, 11:22:58 AM
"Unfortunately" it would be a "lot" of work. So the answer is: no.
Title: Re: Automanage attachments
Post by: kak2z on August 26, 2012, 11:06:02 AM
Great mod! Thank you!
But I get an error!

Quote
http://kak2z.ru/index.php?action=post2;start=0;board=18: Undefined index: temp_attachments_dir
Файл: /**************/Sources/Subs-AutoManageAttachments.php
Строка: 343


337: {
338: $already_uploaded = preg_match('~^post_tmp_' . $posterID . '_\d+$~', $attachID) != 0;
339:
340: if (!$already_uploaded)
341: return $current_attach_dir;
342:
==>343: foreach ($_SESSION['temp_attachments_dir'] as $dir)
344: if(file_exists($dir . '/' . $attachID))
345: return $dir;
346:
347: return $current_attach_dir;
348: }



help me please)))  :)
Title: Re: Automanage attachments
Post by: emanuele on August 26, 2012, 01:17:12 PM
yups...it's a while I don't touch this one...

Guessing a bit, I'd say in Subs-AutoManageAttachments.php, at the end you find:
foreach ($_SESSION['temp_attachments_dir'] as $dir)
if(file_exists($dir . '/' . $attachID))
return $dir;


try to replace it with:
if (!empty($_SESSION['temp_attachments_dir']))
foreach ($_SESSION['temp_attachments_dir'] as $dir)
if(file_exists($dir . '/' . $attachID))
return $dir;


Not sure though if it is the right thing to do...but should be safe.
Title: Re: Automanage attachments
Post by: tarantula901 on December 19, 2020, 12:32:04 PM

Can anyone update this mod?