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. [/]
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.
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.
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.
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?
Some people read their stars..... I choose to write my own
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.
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) ) {
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?
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.
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
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.
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) ) {
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.