Version: 1.00, by N9ne
Developer Last Online: Jul 2019
Version: 2.2.x
Rating:
Released: 02-10-2003
Last Update: Never
Installs: 14
No support by the author.
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.
--------------------------------------------------------------------
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
For those who've been having problems with the unban link not showing up, I've found the problem.
In /mod/user.php Find:
PHP Code:
$users=$DB_site->query("SELECT userid,username FROM user WHERE username LIKE '%".addslashes(htmlspecialchars($findname))."%' ORDER BY username");
Replace that with:
PHP Code:
$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!
First of all, this was actually originally found HERE 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