Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 177
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 183
Total: 183

Author Topic: $folderid = floor  (Read 1213 times)

0 Members and 1 Guest are viewing this topic.

Offline davejo

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 185
    • View Profile
    • Quizland
$folderid = floor
« on: December 25, 2020, 04:50:43 am »
Hi and Merry Christmas.

I am a little confused. A couple of weeks ago I changed the
Code: [Select]
$folderid = floor from 1000 to 380. The properties of the folder now show the folder is 383MB but it hasn't created a new folder yet.

Should I have put a '0' in front of the 380? Also where in the database is the info stored showing which folder is currently used?

The reason I ask is because I want to eliminate the folder from the regular backup file (this runs 3 times a week) so as to reduce the size of the backup. I have XCloner installed and in the config you can opt out of certain folders, which I have already done with the 'Attachments' folder and the others in the downloads folder.

[ Guests cannot view attachments ]
« Last Edit: December 25, 2020, 04:55:19 am by davejo »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: $folderid = floor
« Reply #1 on: December 25, 2020, 07:50:43 am »
Can you attach the file you changed. I want to see the line of code you changed plus the code around it.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline davejo

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 185
    • View Profile
    • Quizland
Re: $folderid = floor
« Reply #2 on: December 25, 2020, 09:19:20 am »
Thanks for the reply.

Here's the file.

I would be grateful if you can modify that one, if you need to, as I have modified it to allow 8 previews rather than the default 4

Thank you
« Last Edit: December 25, 2020, 09:21:25 am by davejo »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: $folderid = floor
« Reply #3 on: December 25, 2020, 10:44:10 am »
the 1000 or 380 is the number of files before it creates another folder. So in your case requires 380 files before making the next folder
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline davejo

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 185
    • View Profile
    • Quizland
Re: $folderid = floor
« Reply #4 on: December 25, 2020, 11:04:24 am »
Ah ok, I thought it was MB....that's where I was going wrong.

Checking the folder and it says there are 6125 files in the folder.

So even if I left it too 1000 it should have changed it a long time ago.

Thanks again for the reply, especially on Chritsmas day.
« Last Edit: December 25, 2020, 11:23:25 am by davejo »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: $folderid = floor
« Reply #5 on: December 25, 2020, 08:33:35 pm »
Did you have the setting "Enable multiple folders for downloads storage" enabled?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline davejo

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 185
    • View Profile
    • Quizland
Re: $folderid = floor
« Reply #6 on: December 26, 2020, 01:39:42 am »
Hi yes it is enabled and has been enabled all the time. You might see from the first image posted that there are other folders, so it has worked in the past just don't know why it isn't now.

I know this is a stretch but is it possible that the folder size could be included in the 'Settings' page of the mod?


Offline davejo

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 185
    • View Profile
    • Quizland
Re: $folderid = floor
« Reply #7 on: December 26, 2020, 05:52:28 am »
OK I have found out what the issue is. After creating a test site and installing the mod I changed the folder limit to 5 then added 6 'Upload File' posts which did change the folder from 0 to 1.

After that I added 6 'Upload Url:' posts which did not change the folder to 2 which is what I expected to happen because of the image files that are added with it.

Therefore if you predominantly only post url links with photos then the 'Downloads' does not add the images to the download count.

This means that if you only add links to your downloads you will never change the storage folder which, as I have shown can total up to over 6k of photos which can add up to a lot of MBs in storage space.

So now I have to think again about how to resolve this.

Is it possible to manually change the folder via the database, although as I mentioned in my first post I can't see where the data for the folder is stored...maybe I didn't look hard enough.

Any ideas are welcome  ;D

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: $folderid = floor
« Reply #8 on: December 26, 2020, 12:45:52 pm »
Changing it in the database does not affect much since it is caculated each time.

You could modify
Code: [Select]
function Downloads_ComputeNextFolderID($ID_FILE)
{
global $modSettings;

$folderid = floor($ID_FILE / 380);

// If the current folder ID does not match the new folder ID update the settings
if ($modSettings['down_folder_id'] != $folderid)
updateSettings(array('down_folder_id' => $folderid));

}
To hard code a specific folder.
 And maybe do the folder size calc with a little bit of work https://gist.github.com/eusonlito/5099936
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline davejo

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 185
    • View Profile
    • Quizland
Re: $folderid = floor
« Reply #9 on: December 26, 2020, 04:22:00 pm »
Thanks for the help.

What I did is to make folder limit 2 and then make 3 posts to create the new folder.

The limit can stay as 2 as no one ever uploads files to the site anyway only links photos.

That way when the size of the folder gets too big again all I have to do is post another 3 files to get a new folder.

 

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal