Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Mar 8, 2018 13:35:56 GMT -8
Hi,
Does the community/admins know of a way to store likes and make it possible to display this as 'Users with the most likes this week' and so on?
Thanks,
Sam
Reason Being: Unlimited Storage
That should help a plugin of this scale thrive. That combined with a super forum key that tracks posts and saves data as a post is liked would solve your issue. This would also require a one time setup by your forum admin to generate the initial data.
Any sorting would be done client side as the data is available. As far as removing old data, It could probably be done at a certain threshold (being timestamp/date related) at the same time data is added.
Would this be possible right now? Yeah I guess. Too many users would end up breaking the darned thing though.
My example of how it would run: Admin installs, sets at what point to remove old data in manage section.
First time setup requires admin to go through the members pages and click done when finished.
Data is saved to super forum key through "set".
This data contains current values of likes for each user.
This would not be retroactive to the point of recording dates related to those likes but would have a total only.
(That information would be optional based on if you are wanting to display a leaderboard of total likes from forum creation)
The like button would need to remove all data except the first key (with the user total likes) in the array using "pop".
Then it would sort out all needed data and remove all expired/not current data
Then it would "push" all not expired data as well as the new data (userID who liked (detect cheating), user who was liked, userID of who was liked, timestamp, anything else)
Then Wherever you want it viewable It would load the key, sort array by date, count up the posts by userID etc.
Then you have the problem of "HOW DO I KNOW WHO WON?" so then you would make a second key that would store history that would be written to every time the specified time allotment was over with that kept history of who won and blah.
And then your key would start throwing errors because it's too fat. (UNTIL V6 Supposedly)
So you could try to condense the data every time it gets full. But that would mean when two users make a "like" around the same time the data would no longer be accurate and somebodies posts didn't get counted and boo hoo.