PDA

View Full Version : Selct Group when Moderating Registration


AkiraLite
02-27-2002, 10:00 PM
This was a major time saver for me. My board uses custom user group to control access to different forum. All registrations are moderated and being able to set the group from the 'en masse' activation page is what I needed.

Edit user.php:
Changes under "Start Moderate + coppa" about line 1180
1.) add usergroupid to the 1st $users query

$users=$DB_site->query("SELECT userid,username,email,usergroupid FROM user WHERE usergroupid=4 ORDER BY username");

2.)Add makechoosercode to the end of 1st 'if' statement

if ($DB_site->num_rows($users)==0) {.....
makechoosercode("User Group","usergroupid[$user[userid]]","usergroup",$user[usergroupid]);


Under the next section "# Start do moderate and coppa #
1.) Add the new data to the 'while' statement's $DB_site query

while (list($key,$val)=each($validate)) {......
$DB_site->query("UPDATE user SET usergroupid=$usergroupid[$key] WHERE userid=$key");


So far it's worked perfectly for me.

Lionel
03-01-2002, 12:08 AM
I am not moderating registrations, but I would like at registration time to insert group according to location.

AkiraLite
03-01-2002, 11:43 AM
You would have to create a query or array with the possible locations.
Then add the forumla to hash what the user's enter on the registration page and add this result to the post, replacing the default (2) with your value.

Correct?
You want group to be assigned dynamiclly and automaticlly from the external registration page. Not from the Admin CP.
Which is where my hack takes effect.

Lionel
03-01-2002, 11:48 AM
yes this is what I am looking for. I'd like to get a second copy of vb to create an alumni site. The way it would work, once people select their school (or city since it is a small country), they automatically exchange within that limit. But I would not know how to start what you are saying.