Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.
[/]
Attachments
54218-AutoGroupChange-1_1beta.txt (0 Bytes, 302 downloads)

Last edited by Gardener; 02/18/2003 7:42 PM.
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Nice, I can see where it would be useful for admission into forums for higher groups


- Allen wavey
- What Drives You?
Joined: Aug 2002
Posts: 45
User
User
Offline
Joined: Aug 2002
Posts: 45
Is it compatible with 6.1.1 and 6.2 ??

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Aug 2002
Posts: 239
Member
Member
Joined: Aug 2002
Posts: 239
This is definitely one I wish we had for 6.2.....


Some people read their stars..... I choose to write my own
Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Aug 2002
Posts: 239
Member
Member
Joined: Aug 2002
Posts: 239
Cooool! Thanks!


Some people read their stars..... I choose to write my own
Joined: Aug 2002
Posts: 218
Member
Member
Offline
Joined: Aug 2002
Posts: 218
Hi Gardener,

this is now nearly a month ago. Did you find time or do you have forgotten it?

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Ah.. this questions came up today. Good work.

Thanks.

Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Aug 2002
Posts: 239
Member
Member
Joined: Aug 2002
Posts: 239
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
Joined: Aug 2002
Posts: 239
Member
Member
Joined: Aug 2002
Posts: 239
ummmmm Never mind..... Got it working........


Some people read their stars..... I choose to write my own
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Thanks! I'll give it a whirl!

Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
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

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

c0bra #222468 09/25/2003 7:56 AM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
This has been reported to work in UBB.threads 6.3.2 as well.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
danke


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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



- Allen wavey
- What Drives You?
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
thank you gardener


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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. [/]


- Allen wavey
- What Drives You?
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Yeah... That should work. They will always only be in the highest group they are allowed to.

Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
Has anyone tried this on 6.4?

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
hmm... did this one get updated for 6.4 too?


- Allen wavey
- What Drives You?
Joined: Mar 2003
Posts: 159
Member
Member
Joined: Mar 2003
Posts: 159
So, anyone try this with 6.4.1 yet?

Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
I had it going on 6.4. I'm upgrading to 6.4.2 shortly.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)