UBB.Dev
Posted By: Gardener [6.2] Auto Group Change 1.1 beta - 08/16/2002 12:18 AM
Mod Name / Version Auto Group Change 1.1 beta
Description Automatically upgrades a user from one group to another when reaching a set number of posts.
Working under UBB.threads 6.2.2
Any pre-requisites None
Author(s) Gardener
Credits Conrad who suggested it
Demo Not really necessary
Files Altered addpost.php
Database Altered No
New Files None
Any other info Updated the instructions for 6.2.2, added the possibility to have several levels.

[:"red"]
This mod automatically adds users to groups based on how many posts they have made, much like the user titles.
[/]

Attached File
Posted By: AllenAyres Re: Auto Group Change 1.0beta (for 6.0.2) - 08/16/2002 7:24 AM
Nice, I can see where it would be useful for admission into forums for higher groups
Is it compatible with 6.1.1 and 6.2 ??
Posted By: Gardener Re: Auto Group Change 1.0beta (for 6.0.2) - 01/17/2003 10:24 PM
Not quite, but it should be easy to fix. The mod uses Username which should be changed to user number. I'll have a look at it when I get the time, but it will probably not be this weekend, so if someone else could take a look it would be great.
Posted By: Storm_dup1 Re: Auto Group Change 1.0beta (for 6.0.2) - 01/19/2003 9:33 AM
This is definitely one I wish we had for 6.2.....
Posted By: Gardener Re: Auto Group Change 1.0beta (for 6.0.2) - 01/19/2003 6:37 PM
I'll take a look at it soon, but I've got some programming to do for a C++ course I'm taking, so it won't be today.
Posted By: Storm_dup1 Re: Auto Group Change 1.0beta (for 6.0.2) - 01/19/2003 6:44 PM
Cooool! Thanks!
Posted By: jluerken Re: Auto Group Change 1.0beta (for 6.0.2) - 02/16/2003 3:29 AM
Hi Gardener,

this is now nearly a month ago. Did you find time or do you have forgotten it?
Posted By: Gardener Re: [6.2] Auto Group Change 1.1 beta - 02/19/2003 2:44 AM
I've just updated this mod for 6.2.2 and made it a bit more flexible when I was at it. It's now possible to have as many levels of group upgrades as you want, just edit the file filters/usergroups and add the post levels and what group they should be upgraded to. It works just like the user titles.

The new version is attached to the first post of this thread.
Posted By: JoshPet Re: [6.2] Auto Group Change 1.1 beta - 02/19/2003 3:18 AM
Ah.. this questions came up today. Good work.

Thanks.
Posted By: Gardener Re: [6.2] Auto Group Change 1.1 beta - 02/19/2003 11:14 AM
Yeah, that's how I remembered I had promised to update this hack so I decided to do it right away. =]

I like the idea of multiple user levels, it seems almost like the good ole BBS days. =] But I don't think we'll be using it on our own site, we don't really have anything we don't want to show to everyone.
Posted By: Storm_dup1 Re: [6.2] Auto Group Change 1.1 beta - 04/15/2003 1:36 AM
For some reason this isn't updating my users. I do have the code correct and the usergroups file created. Does the usergroup file need to have any particular permissions?
Posted By: Storm_dup1 Re: [6.2] Auto Group Change 1.1 beta - 04/15/2003 4:41 AM
ummmmm Never mind..... Got it working........
Posted By: AKD96 Re: [6.2] Auto Group Change 1.1 beta - 05/30/2003 5:34 AM
If someone has over a set amount of posts, will it automatically assign them to their groups on their next post? I'm asking because I have around 1800 posts. I have it set to add users to group 6 once they reach 50 posts. I posted, but I wasn't added to the group.
Posted By: Gardener Re: [6.2] Auto Group Change 1.1 beta - 06/01/2003 3:51 PM
No, it only updates when a user reaches _exactly_ the given amount of posts. I believe I had two reasons for this, firstly it is the way threads handles title upgrades and I thought it would be a good idea to keep it consistent. The other reason was that it would mean that you could also move users out of the given group when they upgrade to the next level etc.

If you want to add the user to the group if they have as many as or more posts than the given number, you could make the following changes in the addpost.php code after you've added the hack:

Find this row:
Code
if ( ($Totalposts == $posts) && !strstr($CurrGroups, $thegroup) ) {


Change it into this:
Code
<br />if ( ($Totalposts >= $posts) && !strstr($CurrGroups, $thegroup) ) {


This should add the users to all groups they have enough posts for (although it is untested).

If you only want the highest group, you would probably have to do something like this instead:

Find these lines:
Code
<br />	if ( ($Totalposts == $posts) && !strstr($CurrGroups, $thegroup) ) {<br />	  $NewGroups .= "$thegroup-";<br />	  break;<br />	}<br />


Change them into this:
Code
<br />	if ( ($Totalposts >= $posts) && !strstr($CurrGroups, $thegroup) ) {<br />	  $NewGroups = "$thegroup-";<br />	  break;<br />	}<br />


This is also untested, but I think it should work.
Posted By: AKD96 Re: [6.2] Auto Group Change 1.1 beta - 06/01/2003 7:26 PM
Thanks! I'll give it a whirl!
Posted By: Deejay_dup1 Re: [6.2] Auto Group Change 1.1 beta - 06/18/2003 7:23 AM
Im looking for a hack/mod -sort of- like this one...

Would it be possible to mod this hack so that you can specify a DATE and TIME instead of the amount of posts, and then the group changes??

So if I get a user that makes a donation, I change them to a group i specify (could be any one of a number groups), and enter in a date they expire... then when that date comes, they are moved back to the default "user" group?

Deejay
Posted By: Gardener Re: [6.2] Auto Group Change 1.1 beta - 06/18/2003 3:06 PM
Well, I guess the post number could be exchanged with a date and the check is made against todays date instead of the post number. The problem is that this is only run in addpost.php, so it wouldn't update until they write a post. Don't know where a better place for it would be though, maybe the login page, at least something that's not run very often since you don't want to have to do lots of extra file accesses and stuff.
Posted By: Gardener Seems to work in 6.3.2 - 09/25/2003 2:56 PM
This has been reported to work in UBB.threads 6.3.2 as well.
Posted By: AllenAyres Re: Seems to work in 6.3.2 - 09/25/2003 3:40 PM
danke
Posted By: AllenAyres Re: Seems to work in 6.3.2 - 10/22/2003 3:59 PM
hmmm.. how can we set this to remove them from the old group when it updates them to the new one? It's still leaving them as members of the old one and pm's aren't working

Posted By: Gardener Re: Seems to work in 6.3.2 - 10/24/2003 5:57 PM
Uhmm. It was quite some time since I looked at this but I seem to recall that this can be done by changing a line or two in the code. I think that was the original behaviour but it was changed.

If you want I can look in to it next week, after my exams.
Posted By: AllenAyres Re: Seems to work in 6.3.2 - 10/27/2003 5:14 AM
thank you gardener
Posted By: AllenAyres Re: [6.2] Auto Group Change 1.1 beta - 11/05/2003 7:50 AM
I wonder if the below changes would fix it for me?

[]Gardener said:
No, it only updates when a user reaches _exactly_ the given amount of posts. I believe I had two reasons for this, firstly it is the way threads handles title upgrades and I thought it would be a good idea to keep it consistent. The other reason was that it would mean that you could also move users out of the given group when they upgrade to the next level etc.

If you want to add the user to the group if they have as many as or more posts than the given number, you could make the following changes in the addpost.php code after you've added the hack:

Find this row:
Code
if ( ($Totalposts == $posts) && !strstr($CurrGroups, $thegroup) ) {


Change it into this:
Code
<br />if ( ($Totalposts >= $posts) && !strstr($CurrGroups, $thegroup) ) {


This should add the users to all groups they have enough posts for (although it is untested).

If you only want the highest group, you would probably have to do something like this instead:

Find these lines:
Code
<br />	if ( ($Totalposts == $posts) && !strstr($CurrGroups, $thegroup) ) {<br />	  $NewGroups .= "$thegroup-";<br />	  break;<br />	}<br />


Change them into this:
Code
<br />	if ( ($Totalposts >= $posts) && !strstr($CurrGroups, $thegroup) ) {<br />	  $NewGroups = "$thegroup-";<br />	  break;<br />	}<br />


This is also untested, but I think it should work. [/]
Posted By: Gardener Re: [6.2] Auto Group Change 1.1 beta - 11/05/2003 6:01 PM
Yeah... That should work. They will always only be in the highest group they are allowed to.
Posted By: donJulio Re: [6.2] Auto Group Change 1.1 beta - 11/26/2003 5:08 AM
Has anyone tried this on 6.4?
Posted By: AllenAyres Re: [6.2] Auto Group Change 1.1 beta - 01/06/2004 8:07 PM
hmm... did this one get updated for 6.4 too?
Posted By: BWilliams_dup1 Re: [6.2] Auto Group Change 1.1 beta - 02/25/2004 1:21 AM
So, anyone try this with 6.4.1 yet?
Posted By: donJulio Re: [6.2] Auto Group Change 1.1 beta - 05/16/2004 10:04 PM
I had it going on 6.4. I'm upgrading to 6.4.2 shortly.
© UBB.Developers