View Full Version : Mods can moderate new users
inetd
06-06-2002, 05:02 PM
Hi!
I need subj. Who can help me?
Please!
Xenon
06-06-2002, 05:20 PM
haven't tested:
copy this code from admin/user.php
into mod/user.php
// ###################### Start moderate + coppa #######################
if ($action=="moderate") {
/*
// delete coppa entries older than 30 days
$datecut=time()-(30*60*60*24);
$DB_site->query("DELETE FROM user WHERE joindate<$datecut AND usergroupid=4");
*/
$users=$DB_site->query("SELECT userid,username,email FROM user WHERE usergroupid=4 ORDER BY username");
if ($DB_site->num_rows($users)==0) {
echo "<p>None awaiting validation</p>";
} else {
doformheader("user","domoderate");
echo "<tr class='tblhead'><td><p><b><span class='tblhead'>Validate?</span></b></p></td><td><p><b><span class='tblhead'>Name</span></b></p></td><td><p><b><span class='tblhead'>Email</span></b></p></td><td><p><b><span class='tblhead'>Options</span></b></p></td></tr>\n";
while ($user=$DB_site->fetch_array($users)) {
echo "<tr class='".getrowbg()."'><td><p> Yes<input type=\"radio\" checked name=\"validate[$user[userid]]\" value=\"1\"> No <input type=\"radio\" name=\"validate[$user[userid]]\" value=\"0\"></p></td>";
echo "<td><p>$user[username]</p></td><td><p><a href=\"mailto:$user[email]\">$user[email]</a></p></td><td><p><a href=\"user.php?s=$session[sessionhash]&action=edit&userid=$user[userid]\" target=_blank>View profile</a></p></td></tr>\n";
}
maketableheader("Send this email to validated users:","",1,4);
echo "<tr class='".getrowbg()."'><td>Subject:</td><td colspan='3'><input type=text name=subject size=50 value=\"Your account at $bbtitle has been activated\"></td></tr>\n";
$gettemp=$DB_site->query_first("SELECT template FROM template WHERE title='email_validated' AND (templatesetid=-1 OR templatesetid=1) ORDER BY templatesetid DESC"); //kludgy!!
$template=$gettemp[template];
echo "<tr class='".getrowbg()."'><td>Body:</td><td colspan='3'><textarea rows=10 cols=50 name=email>".htmlspecialchars($template)."</textarea></td></tr>\n";
doformfooter("Process Users","Reset",4);
}
}
// ###################### Start do moderate and coppa #######################
if ($HTTP_POST_VARS['action']=="domoderate") {
while (list($key,$val)=each($validate)) {
if ($val==1) {
$user=$DB_site->query_first("SELECT username,email FROM user WHERE userid=$key");
$username=unhtmlspecialchars($user[username]);
eval("\$message = \"".ereg_replace("\"","\\\"",$email)."\";");
eval("\$subject = \"".ereg_replace("\"","\\\"",$subject)."\";");
mail ($user[email],$subject,$message,"From: $webmasteremail");
$DB_site->query("UPDATE user SET usergroupid=2 WHERE userid=$key");
}
}
echo "<p>Accounts validated and users notified</p>";
}
then just add a link to the mod-cp user.php?action=moderate
no responsibility :)
Zelda-King
03-24-2003, 03:37 PM
I've tested it. It works fine, but the screen briefly looks like the attached before it resolves to the 'proper' formatting.
Xenon
03-24-2003, 03:46 PM
well it's the code from the acp.
i don't know why they've coded it too look like that ;)
Zelda-King
03-24-2003, 05:03 PM
That's just it. It doesn't. I don't know why the screen goes funny like that. It looks quite normal afterwards. It just goes like this for about a second.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.