Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: jermo5 - elokuu 08, 2013, 02:27:46 IP

Otsikko: Hide all topics within a board started before a custom date
Kirjoitti: jermo5 - elokuu 08, 2013, 02:27:46 IP
This is my first post here so I'll try to give you everything you need.

Running SMF 2.02

We are looking to create a site running SMF that has the ability to turn this option on/off on a board-by-board basis. When a user is granted access to a new board we want to somehow store that date in the database. When that user logs in a views that board, if this option is enabled, they would ONLY see topics that were created/started ON or AFTER the date this user was granted access to this board.

We are essentially creating a subscription-based community where users can pay $x.xx/month to gain access to this specific SMF board, but they are only allowed to view topics that were started on or after the date they paid or started their subscription. So if a user paid and was given access on February 1, they wouldn't be able to see any topics created January 31 or before. In addition, if other users were to post a comment on a topic that was started January 31, the user who was granted access on February 1 would STILL not be able to see those posts/comments because they are part of a topic that started BEFORE their registration/access-granted date.

The other place this limiting/hiding would need to occur is in the forum search, so they couldn't search for and find topics started before their access/registration date.

We also have MANY boards running in our SMF installation, so this option would need to be able to be turned on/off for just certain boards. This would also mean we couldn't just use the user's "registration/creation date" in their user profile because they may have already registered months or years ago for use with our other boards. But I am hoping SMF maybe tracks the date a user is granted access to a specific board in order to make this work.

I know this sounds very bizarre, but let me know if this doesn't make sense. I looked high and low in the mods and couldn't find something that would help me out. If this request is entirely too complex or is not feasible I'd love to hear that as well!

Thanks!
Otsikko: Re: Hide all topics within a board started before a custom date
Kirjoitti: margarett - elokuu 08, 2013, 02:54:06 IP
Hi and welcome ;)

First of all -> update your forum. You should, really

As for your request, actually it makes sense.
The registration date already exists in your database as it is stored automagically :) To have a different field with a custom date is also possible but it would create problems of definition... Will you define a date for each user? Will you have an administrative, per user, option to use or not the registration date? This needs to be clarified.
But I think the remaining goes way out of my knowledge :) It would bring a very nice new MOD!

Good luck!
Otsikko: Re: Hide all topics within a board started before a custom date
Kirjoitti: Arantor - elokuu 10, 2013, 07:24:42 IP
Especially since there could potentially be many such dates (e.g. if a user subscribes, lets it lapse and resubscribes at a later date, they will lose access to even their own posts)

But just for fun there are more places this has to be dealt with, not just posts and searching. Unread posts, unread replies to posts, recent posts, RSS feeds, newsletters and any other mods you have that do this will all need to be modified (e.g. portal mods) and there's no way to do any of this without a significant performance hit.
Otsikko: Re: Hide all topics within a board started before a custom date
Kirjoitti: jermo5 - elokuu 16, 2013, 12:48:04 IP
Thanks so much everyone! This helped me to realize that it's not in our best interest to customize the SMF software for our needs. We will work on other ideas. Thanks!