MyBB Community Forums

Full Version: Video upload, there is a limit :P
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Didn't read that thoroughly enough I see..

Couldn't you count from the existing posts and then compare to the ones in the post being checked?

Basically like this:

New thread scenario:
- Obviously, check how many there are in the current post and compare to the maximum.

Replying:
- Check how many exist by doing something like 'find [video where tid = 12232' or something
- Check how many are in the current post
- Now determine whether or not the user's post will go above the set limit

These queries would only need to be run if the post being added actually contained the {video} mycode.

Is this plausible or no?
Yes, but if a post has 3000 replies then searching through them all for a single phrase would put a lot of strain on the mysql server Smile
(2010-07-30, 10:08 PM)Tommyk Wrote: [ -> ]Yes, but if a post has 3000 replies then searching through them all for a single phrase would put a lot of strain on the mysql server Smile

This. We have a 7,000 post thread here, so counting on-the-go against every single post is a no-go.
Unless, when posting a reply we have an extra db field in the Threads table with the numbe rof videos posted. The system could check against that. Every time a post is edited, they system checks if the video has been rmeoved/added and adds/minuses the difference of the total.

SO:

Threads table: new field "video_number".
Posts table: new field "videos".
Thread is posted with 3 videos in, and a reply is posted with 3 videos in. The Posts both get "3" in the "videos" field where PID is the OP and reply. The Thread table gets "3" to begin with, then adds "3" when the 3 video reply is posted. To a total of "6".
The reply is edited to only 2 videos. MyBB SQL's the PID and checks how many videos there was origionally, then how many instances of "[video=" there are now. Adds/minuses the differences form the Threads table.
If the max is set to "20", and someone tries to post the 21st video, MyBB asks them to remove 1 instance of "[video=". Toungue
Smile

Reduces server load, and solves the problem.
A new table column at this late of the stage is unacceptable. Considering the release ETA is tomorrow.
:p I suppose XD
I do think it should be limited to one video per post, That means if there are 50 post on one page (why would you have that in the first place) that's 50 videos and that should be OK, but if people have 50 post on one page that is just not right as it is.
Pages: 1 2 3