Advertisement:

Author Topic: Access via Time-Based & Post-Count Based Membergroup  (Read 2331 times)

MadTogger

  • Guest
Access via Time-Based & Post-Count Based Membergroup
« on: January 27, 2012, 02:42:17 PM »
Hi all,

I am in the process of setting up my new SWF forum and need a little help.

On my forum I have a board called 'For Sale'.

I have set the 'Jr. Member' required post-count option to 15 posts.

All the above I understand, upon registration a member's rank is 'Newbie' until they have posted 15 posts, then they upgrade to 'Jr. Member'

What I am trying to acheive is as well as the post-count restriction for 'Newbie' members, I also want it to be time-based.

For example, the minimum time limit after registration before being able to post to my 'For Sale' board would be 1 month.

I do not want to restrict anyone from viewing the above board, just that they have to meet the minimum required criteria.

Like I have said, the minimum criteria to be able to post to the board is:

15 or more posts and not or 1 month or longer from date of registration.

Any help with this would be greatly appreciated.

I do understand that I can restrict the view of this board but I in no way wish to do this.

Kind regards..,

MT

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: Access via Time-Based & Post-Count Based Membergroup
« Reply #1 on: January 27, 2012, 04:31:06 PM »
MT to me it looks more like a mod request.

We already have a time based post group mod. To my understanding you need a mod mix of both, default and mod permissions.

If you like can we move this topic to mod request board as you are going to get more responses in there.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

MadTogger

  • Guest
Re: Access via Time-Based & Post-Count Based Membergroup
« Reply #2 on: January 28, 2012, 12:43:10 AM »
MT to me it looks more like a mod request.

We already have a time based post group mod. To my understanding you need a mod mix of both, default and mod permissions.

If you like can we move this topic to mod request board as you are going to get more responses in there.

Sorry Joker, I guess the Mod Request board is the best place for my post.

I did see the Time-Based mod already and did try to have a go myself at combining both but I am lacking the knowledge.

Regards..,

MT

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: Access via Time-Based & Post-Count Based Membergroup
« Reply #3 on: January 28, 2012, 05:46:25 AM »
No issues, lets see if someone can pick this up and create a mod for whole community.

Topic moved.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

MadTogger

  • Guest
Re: Access via Time-Based & Post-Count Based Membergroup
« Reply #4 on: January 28, 2012, 05:58:51 AM »
No issues, lets see if someone can pick this up and create a mod for whole community.

Topic moved.

Cheers for that Joker.

I have been taking a long good look at the already listed Time Based Rank mod and may continue to have a play around with it.

I noticed that in the Subs.php file on line 497 there is a mention of 'date_registered' in the Array of $knownInts.

I am thinking along the lines of manually editing my files as per the Time Based mod but instead of replacing the Post-Count code just adding the 'date_registered' bit therefore allowing both to be used.

Basically for my purposes the 'Time Since Registered' would only have to be used for the 'Jr. Member' rank, see below:

Newbie     - 0 to 14 posts - able to view board but not post, reply etc...
Jr. Member - 15 to 99 posts - able to view board but not post, reply etc until they have been a registered member for 30 days.

All higher ranks would automatically meet this criteria anyway.

Regards..,

MT

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: Access via Time-Based & Post-Count Based Membergroup
« Reply #5 on: January 28, 2012, 06:01:33 AM »
Ummm I haven't seen any concerning code for now, but as far as my knowledge goes one can achieve this by applying some or conditions.

For now I've 2 mods on hand which I might try to complete by today. If I get a chance I'll try to look into this too ;).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

MadTogger

  • Guest
Re: Access via Time-Based & Post-Count Based Membergroup
« Reply #6 on: January 28, 2012, 06:13:46 AM »
What an idiot, I just walked away from my PC and realized my glaring mistake, the higher ranks would not automatically meet the criteria.

In theory a member could post away quite happily and get their post-count up and progress through the ranks before acheiving the 30 day minimum.

Hmm, I'll have to go away and think again.

Regards..,

MT

MadTogger

  • Guest
Re: Access via Time-Based & Post-Count Based Membergroup
« Reply #7 on: January 28, 2012, 10:15:26 AM »
Okie dokie, doing a little more research and have found that the 'date_registered' is stored in the DB in 'int(10)' format.

So it would seem quite simple I guess to convert this in php:

echo date('D, d M Y H:i:s', UNIX_TIME + 2592000);

UNIX_TIME is the int(10) variable from the DB

2592000 is 30 Days expressed as seconds

So this would produce a date exactly 30 Days in the future from the members 'date_registered'.

Now I have to think of how to implement this firstly by connecting to the DB upon registration, making the conversion above and storing it, plus then having to make a daily check to see if the current date is equal to or greater than this stored figure.

It will probably be more wise to use the date as 'D, d M Y' and not 'D, d M Y H:i:s' as the latter is too precise and would mean that the checking would need to be on a per second basis i.e.

Someone registers at 12pm during a day and leaving the date format as 'D, d M Y H:i:s' would mean they will not have access until 12pm 30 days later, how can I possibly allow for all possible times other than doing a per second check, far too much server load. So, the easiest option is to cut the time part off and maybe setup a cron job at midnight each day when the actual date changes or have it to update when a member logs on.

Lots to think about.

Regards..,

MT