View Full Version : Banned by moderator...
Glock
07-06-2002, 01:37 AM
I want it to be so that when the moderators click the ban button, it moves them to usergroup Banned, a group I have custom created, and wish to have all banned users in.
Thanks
Admin
07-06-2002, 05:28 AM
Does it not do this already?
Glock
07-06-2002, 05:42 AM
It puts them in usergroup "Banend by Moderator" which is kind of annoying, since I am active in taking care of trolls too, and just want them all in one group, the one that I custom created.
Logician
07-06-2002, 07:56 AM
edit MOD\user.php (Notice this is the file under MOD dir)
find:
$DB_site->query("UPDATE user SET usergroupid=$bangroup[usergroupid] WHERE userid=$banuser[userid]");
Replace it AS:
$DB_site->query("UPDATE user SET usergroupid=X WHERE userid=$banuser[userid]");
Change X with any user group id you want.
Be careful about writing the correct usergroup id here! We dont want them become Site Admins accidently, do we? :p
Enjoy..
Logician
Glock
07-06-2002, 08:07 AM
It puts them in the correct usergroup, but still automatically adds Banned by Moderator, and it also doesn't update their Status to Banned, like it would automatically do if an admin switched their group.
Xenon
07-06-2002, 10:02 AM
"and it also doesn't update their Status to Banned, like it would automatically do if an admin switched their group."
Thats a known bug, a fix is somewhere in the releasforum as i know
Glock
07-06-2002, 04:51 PM
Have any idea of what it is called? And what about it still adding the other usergroup?
Xenon
07-06-2002, 05:04 PM
you have to delete/outcomment this passege in mod/user.php:
if (!$bangroup) {
$DB_site->query("INSERT INTO usergroup
(usergroupid, title, usertitle, cancontrolpanel, canmodifyprofile, canviewmembers,
canview, cansearch, canemail, canpostnew, canmove, canopenclose, candeletethread, canreplyown,
canreplyothers, canviewothers, caneditpost, candeletepost, canusepm, canpostpoll, canvote,
canpostattachment, ismoderator, canpublicevent, canpublicedit, canthreadrate, cantrackpm,
candenypmreceipts)
VALUES
(NULL, 'Banned by Moderators', 'Banned', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')");
$bangroup['usergroupid'] = $DB_site->insert_id();
$bangroup['title'] = 'Banned by Moderators';
}
so no new group would be created..
this is the link to the hack update user title:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=33711
Chris M
07-06-2002, 05:27 PM
Thanks for that:)
Satan
Glock
07-06-2002, 08:48 PM
Outcomment? I'm new at this...
Glock
07-06-2002, 09:39 PM
$DB_site->query("UPDATE user SET usergroupid=$bangroup[usergroupid] WHERE userid=$banuser[userid]");
For that hack...this isn't in my file at ALL...and how exactly do I integrate these two?
Xenon
07-06-2002, 09:44 PM
outcomment means to make a /* at the beginning of the passage and a */ at the end :)
i hope this phrase exists in english ^^
this line must be in your mod/user.php, if not, you should take the standart file from vb and not a hacked one ;)
Glock
07-06-2002, 09:47 PM
So put a slash and then an asterik right before and right after that passage?
Xenon
07-06-2002, 09:49 PM
yes, so php will handle it as a comment and wont parse it anymore..:
it should look so:
/*if (!$bangroup) {
$DB_site->query("INSERT INTO usergroup
(usergroupid, title, usertitle, cancontrolpanel, canmodifyprofile, canviewmembers,
canview, cansearch, canemail, canpostnew, canmove, canopenclose, candeletethread, canreplyown,
canreplyothers, canviewothers, caneditpost, candeletepost, canusepm, canpostpoll, canvote,
canpostattachment, ismoderator, canpublicevent, canpublicedit, canthreadrate, cantrackpm,
candenypmreceipts)
VALUES
(NULL, 'Banned by Moderators', 'Banned', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')");
$bangroup['usergroupid'] = $DB_site->insert_id();
$bangroup['title'] = 'Banned by Moderators';
}*/
Glock
07-06-2002, 09:56 PM
I'm getting An unknown error occured while attempting to ban eigthlegion (32). The group the user was supposed to be moved to was "" after outcommenting it...
Xenon
07-06-2002, 09:58 PM
yes, you have to apply logicians modifications too
just outcommenting would always produce an error
Glock
07-06-2002, 10:02 PM
I did...it's only error when I outcomment it.
Xenon
07-06-2002, 10:03 PM
oh, i see, instead of doing all this changes in this thread, you can do a very small change to get what ya want.
take your original user.php
find$bangroup=$DB_site->query_first("SELECT usergroupid,title FROM usergroup WHERE title='Banned by Moderators'");
and replace it with this:
$bangroup=$DB_site->query_first("SELECT usergroupid,title FROM usergroup WHERE usergroupid=X");
replace th x with the usergroupid of your bangroup ;)
Glock
07-06-2002, 10:09 PM
Should I still do the outcomment then?
Xenon
07-06-2002, 10:10 PM
no, don't use any of the changes here in the thread, wether logicians nor mine, just make the last change i post, this should be enough
Glock
07-06-2002, 10:11 PM
And will just doing this instead of outcommenting if I don't need to make the database or anything hinky?
Xenon
07-06-2002, 10:12 PM
this small change is all what ya need, you don't have to do anything more
Glock
07-06-2002, 10:15 PM
Yep, I tried it and it works...I was just wondering if it will still try and add that usergroup and just get denied, or will it really even matter? Also for the user title, I think it edits the same line of code that I had to change for the current hack, what do I do about that to make it update the title?
Xenon
07-06-2002, 10:21 PM
it would just try to create another usergoup if your usergroup x won't exist.
you can implement the hack as it is said in the txt-file, just instead of changing the line to $bangroup=$DB_site->query_first("SELECT usergroupid,title,usertitle FROM usergroup WHERE title='Banned by Moderators'");
you have to change it to$bangroup=$DB_site->query_first("SELECT usergroupid,title,usertitle FROM usergroup WHERE usergroupid=x");
Glock
07-06-2002, 10:27 PM
It exists, so will it still try to create Banned by Moderator, or just ignore that completely?
Xenon
07-06-2002, 10:31 PM
it will ignore that passage
Glock
07-06-2002, 10:33 PM
Now I'm getting "You may not ban someone who is not a normal registered user!"
Glock
07-06-2002, 10:34 PM
After adding the update title hack at least, not from yours...
Xenon
07-06-2002, 10:36 PM
are you sure you haven't banned this person before?
if this person isn't in usergroup 2, you cannot ban it with the mod cp
Glock
07-06-2002, 10:41 PM
Yeah, they're listed as a member and it's doing it. Do you want to to post a copy of my current user.php so you can confirm I have the coding right?
Glock
07-06-2002, 10:47 PM
Also, should I have:
$bangroup=$DB_site->query_first("SELECT usergroupid,title FROM usergroup WHERE usergroupid=X");
or
$bangroup=$DB_site->query_first("SELECT usergroupid,title,usertitle FROM usergroup WHERE usergroupid=x");
Since you have said both, but I'm assuming the second and using that...
Glock
07-06-2002, 10:50 PM
They are in usergroup 2, If you know at all...why do I have usergroups up to 8, when I only have 6 too?
Xenon
07-07-2002, 08:05 AM
the usergroupid of your banned group must be higher than 6:
if ($bangroup['usergroupid']>6) {
it's just a security issue, you can change the if-clause if ya want.
this is the line which produces your error:if ($banuser['usergroupid']!=2 or $ismod) {
echo "<p>You may not ban someone who is not a normal registered user!</p>";
} else {
as you can see, if the user isn't in usergroup2 or the user is a mod, then it'll occure, no other possibilities to occur, so you have to recheck your user...
Glock
07-07-2002, 08:12 AM
For the usergroup, is there a way to allow them to ban other usergroups also, such as going 2,3? For some reason, I redid the file and everything is working normally before, so that's setup fine, thanks fo rhte help. One thing though, I turned on moderate new users, and now all users are autlmatically being set to Administrator, could this hack have had anything to do with it?
Xenon
07-07-2002, 09:04 AM
no, this hack hasn't anything to do with this problem.
perhaps you have made the moderated gruop as a secound admingroup?
you shouldn't change the rights of usergroups < 7, because often vb puts automatically users in one of this groups...
to ban also other usergroups, just add a clause to this:if ($banuser['usergroupid']!=2 or $ismod) {
echo "<p>You may not ban someone who is not a normal registered user!</p>";
} else {
for example banning also usergroup3:
if ($banuser['usergroupid']!=2 or $banuser['usergroupid']!=3 or $ismod) {
echo "<p>You may not ban someone who is not a normal registered user!</p>";
} else {
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.