View Full Version : SuperMods can Unban from ModCP!
NOTE: Download the attached file and open in txt editor to see instructions!
---------------------------------------------------------------------
Supermods can unban users: by N9ne on 11th Feb 2003, Copyright 2003
---------------------------------------------------------------------
Files to modify:
mod/user.php
---------------------------------------------------------------------
For: 2.2.x
---------------------------------------------------------------------
Description: This hack will add a link next to "View User" in the modCP
after searching for a member. The link will read "Unban" and will only show
if the user is banned. If the user isn't banned, the link will not show.
---------------------------------------------------------------------
Modification: You probably have a usergroup created from the AdminCP
in which you put banned users as an admin. You can modify this hack so
supermods can unban users in that group too. You may even have more
than 2 usergroups for banned users, this hack is fully customizable, just
request any customizations you would like in the support thread at vb.org.
The instructions in this file will only show you how to make it so supermods
can unban users who were banned from the modCP.
--------------------------------------------------------------------
Note: In screenshot 1, you see Stealth Ban and Parse Error Ban, they're part of other hacks ;). Parse error ban is something I made from my Blank page ban hack ;).
Ignore them, I forgot to take them out of the screen shot ;).
JHSoundZ
02-12-2003, 01:01 AM
Wow since DrShark didn't reply to this thread like he always does, I thought I would. Nice work, I may install it...
init
Darth Cow
02-12-2003, 02:55 AM
Nifty :). I created a hack like this for my own forum, actually, since it didn't make sense super mods could ban but not unban if there were a mistake. But I was too lazy to realize it :D.
Xenon
02-12-2003, 04:48 PM
nice work n9ne :)
ok with my mods can edit users this is possible also (indirekt) so i don't need it, but nice :)
Originally posted by Xenon
nice work n9ne :)
ok with my mods can edit users this is possible also (indirekt) so i don't need it, but nice :)
Oops, didn't know you could do that. But I think in your hack, they can just change the usergroup? This will only display an unban link if the user is banned by mods, and the smods can only unban those who were banned by smods :).
Xenon
02-12-2003, 05:21 PM
that's why i said indirect ;)
just move users out of banned group is like unbanning ^^
Dr Shark
02-12-2003, 06:30 PM
Originally posted by JHSoundZ
Wow since DrShark didn't reply to this thread like he always does, I thought I would. Nice work, I may install it...
init
Didn't have time to.:p
__
Anyways, i like this hack the most i don't know why this wasn't in the default vbulletin but now people can easyly add it so good job.
I did find it odd when I realised that if a supermod accidentally bans someone, they must wait until an admin can fix their silly mistake. Also, what if a user is to be unbanned! Only the admins could do it...what's the point of supermods if they're not going to do all the work hey :D
Zelda-King
02-15-2003, 11:48 AM
The script isn't working for me. I get parse errors around lines 69-72 or something like that. For a start, are those 'if's supposed to be spelt 'iif'?
Originally posted by Zelda-King
The script isn't working for me. I get parse errors around lines 69-72 or something like that. For a start, are those 'if's supposed to be spelt 'iif'?
What is the exact error you receive? What do you have on lines 69-72?
Zelda-King
02-15-2003, 08:09 PM
It's OK. I made a mistake. Sorry about that (it was first thing in the morning)!
However, I'm not getting the link for 'unban'. Also, if I type in the URL to unban from the mod cp it leads me nowhere (and yes I did check that the usergroup ID matched the hack).
For the record, I'm using vB 2.2.9.
You shouldn't be typing in a URL to unban users. That wouldn't work. As for the link to unban, you can only get the unban link in the modCP, regardless of usergroup, if the user was banned by moderators.
Zelda-King
02-16-2003, 09:37 AM
Yes, I tried it in the mod cp. No 'unban' link came up (which is why I tried to type in that 'action=unban&userid=xx').
Well, here's how I have the script (with those 'parse ban/stealth ban' links removed).
EDIT: OK, I can now type in the url to unban and it will unban. I could make the 'unban' link a regular one and that would work but the 'conditional link' in this hack still doesn't. Also, after unbanning I am not redirected anywhere after the unban. I get the '[userid] has been unbanned' but I don't get taken off the 'unban confirm' screen.
That aside, this is good. I've long wanted a mod-unban hack to be released.
That's correct, the confirmation screen should stay, and a message appear below it stating they're unbanned.
I'll look into your problem.
Ok, I've updated the instructions file. Please clear your temp internet files and download it again and repeat step 1.
Zelda-King
02-16-2003, 03:51 PM
The conditional link thing still isn't working for me. At the moment I've made it a permanent one seeing as I can't locate the problem. The code looks sound to me. Speaking of which, it's apparant that there's no error message when one attempts to unban someone not 'banned by moderators' even though I see such a message in your code. Of course, that wouldn't really matter considering the link is only supposed to show with users that fit the criteria for unbanning. For the record, the 'unban confirmation' table DOES only appear if the usergroupid is 8. Just not the unban link.
My 'banned by moderators' usergroup ID is actually 10. I don't know if that goes for everyone else or whether it depends what version of vBulletin you're using (I doubt it). This isn't the cause of any problems though. I suppose it's because my usergroup 8 is actually an admin ban which I created before moderators had banned anyone.
Personally I reckon the hack would be better if the 'unban confirmation' table didn't remain after an unban but rather you got a blank screen with the 'unbanned' message, just like you get the 'banned' one when banning. The 'confirm ban' table doesn't remain. I just noticed that if you then try to unban again (just after already unbanning a user) it gives the 'unbanned' message again and this time the 'confirm unban' table disappears (just how I think it should).
Nevertheless, the unban itself works fine.
Originally posted by Zelda-King
The conditional link thing still isn't working for me. At the moment I've made it a permanent one seeing as I can't locate the problem. The code looks sound to me. Speaking of which, it's apparant that there's no error message when one attempts to unban someone not 'banned by moderators' even though I see such a message in your code. Of course, that wouldn't really matter considering the link is only supposed to show with users that fit the criteria for unbanning. For the record, the 'unban confirmation' table DOES only appear if the usergroupid is 8. Just not the unban link.
My 'banned by moderators' usergroup ID is actually 10. I don't know if that goes for everyone else or whether it depends what version of vBulletin you're using (I doubt it). This isn't the cause of any problems though. I suppose it's because my usergroup 8 is actually an admin ban which I created before moderators had banned anyone.
Personally I reckon the hack would be better if the 'unban confirmation' table didn't remain after an unban but rather you got a blank screen with the 'unbanned' message, just like you get the 'banned' one when banning. The 'confirm ban' table doesn't remain. I just noticed that if you then try to unban again (just after already unbanning a user) it gives the 'unbanned' message again and this time the 'confirm unban' table disappears (just how I think it should).
Nevertheless, the unban itself works fine.
There's your problem. Replace all 8s with 10s.
Zelda-King
02-16-2003, 04:47 PM
Yeah, I did that. I tried it both ways. I mean, even with the '8's I should then be able to see the link for users in the other 'banned' group seeing as my usergroup 8 is another ban-group.
All numbers should match though. That's the way it works. Make sure that in my instructions, you replace all the 8s with 10. If you already did that though, that's fine, but i don't understand why it's not working...
MetroSports82
02-28-2003, 07:37 PM
Zelda-King-
I too had the same exact problem, that you had been expirencing, but when I tried this, it worked. unfortunately, i don't know enough yet, to figure out how to get the original code to work for just super mods. so instead, this will also work for any moderators, that have the "banning" permission enabled. anyway, here goes. :)
Open mod/user.php
FIND:
echo "<tr><td nowrap><p>$user[username]</p></td>".iif($perms[ismoderator] or $ismod['canbanusers']==1, "<td nowrap><a href=\"user.php?action=ban&userid=$user[userid]\"><p>[ban]</p></a></td>", "").iif($perms[ismoderator] or $ismod['canviewprofile']==1, "<td nowrap><a href=\"user.php?action=viewuser&userid=$user[userid]\"><p>[view profile]</p></a></td>", "").iif($user['usergroupid'] == 8, "<td nowrap><a href=\"user.php?action=unban&userid=$user[userid]\"><p>[<b>unban</b>]</p></a></td>", "")."</tr>\n";
REPLACE WITH:
echo "<tr><td nowrap><p>$user[username]</p></td>".iif($perms[ismoderator] or $ismod['canbanusers']==1, "<td nowrap><a href=\"user.php?action=ban&userid=$user[userid]\"><p>[ban]</p></a></td>", "").iif($perms[ismoderator] or $ismod['canviewprofile']==1, "<td nowrap><a href=\"user.php?action=viewuser&userid=$user[userid]\"><p>[view profile]</p></a></td>", "").iif($perms[ismoderator] or $ismod['canviewprofile']==1, "<td nowrap><a href=\"user.php?action=unban&userid=$user[userid]\"><p>[unban]</p></a></td>", "")."</tr>\n";
also, whatever your "Banned by Moderators" usergroupid is, it should be replaced by that.
for ex. in the original hack it has written,
if ($banuser['usergroupid'] == 8) {
you should replace the #8 with whatever usergroupid you have, for your "Banned by Moderators" usergroupid.
Give that a try, and let me know if it works. :)
Oh and BTW nice hack. Got it working on v2.2.9
Thanks,
Metro.
Zelda-King
02-28-2003, 08:56 PM
Yeah, I'm using pretty much that very code. It just makes the unban thing appear regardless. Seeing as there's an adequate error message if you try to unban someone not fitting the criteria I have no problems so far. :)
Glad it's worked out for you :).
Robink
03-15-2003, 09:16 AM
When my SuperMods unBan someone, his/her user title remains as "Banned" ... Any idea how I can change that?
Jethro
03-15-2003, 05:05 PM
Er ... stoopid newbie question number 1.
ModCP ???? Is that a standard vBulletin feature ? Haven't notice one, and if it is standard wouldn't mind pointing it out to the mods :)
Cheers and thanks in advance (hey what does this big red button do :gg:)
MetroSports82
03-16-2003, 03:36 AM
Jethro. Not sure what your saying? Mod CP is just like an Admin CP, but for moderators. Your mods can access it through a link. Similar to how you would log into your Admin CP, but instead of typing in the text "admin" type in "mod". So, for example...
http://yousite.com/mod/
Any how, yes it is standard for vB. :)
gmarik
03-16-2003, 06:13 AM
This one would be good for Filburt, because he can't unban me from vbT ... :o)
vBt uses vB 3.0.0...and it doesn't allow them to unban users? I'm sure it does :confused:
TraceyPRO
03-25-2003, 07:22 PM
For those who've been having problems with the unban link not showing up, I've found the problem.
In /mod/user.php Find:
$users=$DB_site->query("SELECT userid,username FROM user WHERE username LIKE '%".addslashes(htmlspecialchars($findname))."%' ORDER BY username");
Replace that with:
$users=$DB_site->query("SELECT userid,username,usergroupid FROM user WHERE username LIKE '%".addslashes(htmlspecialchars($findname))."%' ORDER BY username");
The reason the unban link wasn't showing up was simply because the 'usergroupid' column wasn't selected from the database. Therefore when it tried to search for the usergroupid of the banned user (in this case '8') it couldn't find anything because the 'usergroupid' column wasn't selected to look in.
Hmm, that's odd how it didn't select the usergroupid, thanks for posting up the fix though, I was clueless as I had it working on my forum, I probably did modify that query as you've posted in your post, but just forgotten to add it into the instructions!
monstergamer
04-08-2003, 02:51 AM
i cant get this to work on 2.3.0
Darkwaltz4
11-23-2003, 12:49 AM
First of all, this was actually originally found HERE (https://vborg.vbsupport.ru/showthread.php?t=48814&highlight=mod+unban) by n9ne
However the code was erroring, and it also had excess code in it and proved to be insufficient.
I took the code and fiddled around with it, because i had been looking for something similar and didnt feel like writing my own hack, however i ended up doing it anyway ~_~ and also rewrote the instructions.
Now anyway, this will replace the [ban] link in the MOD control panel, with [unban] for users which are banned when searching for them. Then it unbans (i bet you werent expecting that), similarly to the way in which you ban users in the first place. The instructions include information for things like changing the usergroupid which the banned users are in, and also for multiple banned groups, and for changing the usergroup the unbanned users go into. changing things is simple enough however if you need specific coding done just post it and ill post back the fix.
Works for ALL 2.x.x boards, 4 edits to mod/user.php
have fun...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.