Helpful Information
 
 
Category: vBulletin 2.x Beta Releases
Change UserGroupID automaticaly after specified time

This hack checks every hour (-using a cronjob) the user db and checks every user to see if the user is regged for over a week (can be changed), if over a week - given a certain usergroupid, if not, also a certain usergroupid.

this helps me gives new users on the board limited access to forums.

Here is the code for the main and only file behind this hack:
<?
#!/usr/local/bin/php -q

## MySQL Vars: ##
$mysql_host = "localhost";
$mysql_user = "";
$mysql_pass = "";
$mysql_db = "";
## MySQL Vars End ##

mysql_connect($mysql_host,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);

// EDIT //
$nuser = 15; // User Group ID for newbie user
$tuser = 2; // User Group ID for normal users
$timepass = 60*60*24*7; // Requires u to be regged for one week
// ---- //

$x=0;
$y=0;
$query = mysql_query("select * from user where usergroupid=$nuser") or die(mysql_error());
while($r = mysql_fetch_array($query)) {
echo $r["username"] . " ";
$updatedate = $r[joindate] + ($timepass);
if(($updatedate >= time()) || ($r[posts] < 15)) {
$disalow = mysql_query("update user set usergroupid=$nuser where userid=" . $r["userid"]) or die(mysql_error());
if($disalow) {
echo ".... <b><font color=red>Failed.</font></b>";
$x++;
}
} else {
$alow = mysql_query("update user set usergroupid=$tuser where userid=" . $r["userid"]) or die(mysql_error());
if($alow) {
echo ".... <b><font color=green>Passed.</font></b>";
$y++;
}
}
echo "<br>";
}
echo "Passed: $y | Failed: $x";
?>

This hack can work with no connection to vbb and will work nomatter where u put it on your server.

Now just create the cronjob and make it call the php and execute it as a CGI every couple of minds u decide of.

Requirements: Crontab
(you must have axx to crontab on your server)

thanks a lot for this

kreftt










privacy (GDPR)