Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 14, 201014 yr I have over 3Gb monthly uploads, original IPB storage system isn't convenient! I make my own storage system, but each updating of the forum version it's necessary to waste time on modification of a large quantity of files. Please, make universal storage! My idea (it's work on my forum): All uploads in uploads/monthly*/ , no other special dirs Under monthly* dirs - system & component dirs: (based on $type from class_attach) /monthly/post (image, thumb) /monthly/msg .. /monthly/profile (avatars, photos, bg's) /monthly/gallery (image, med, thumb) Under every components dir - subdirs for images, thumb, screenshots.. Directory setup - in ACP for all components in one settings group. Only two functions in core: One returns array of dirs based on file upload time (or time()) and type ( i use IPSLib::getAppUploadPath($time, $type); ). One for creating new monthly directory structure (with check for installed components, i call it from scheduler in the end of month). Readable code $app_path = IPSLib::getAppUploadPath( $image['idate'], 'gallery' ); @unlink( $app_path['image'] . $image['masked_file_name'] ); @unlink( $app_path['thumb'] . $image['masked_file_name'] ); No tn_, _med and other addition to file name, all file store as is. No superfluous records in db, one filename for all, thumb (med) saved as tinyint, not as filename, no dirname store. Easy search, easy backup, easy administration..
Archived
This topic is now archived and is closed to further replies.