PDA

View Full Version : Profile Enhancements - Ban Info on User Profile


zappsan
29 Sep 2006, 02:18
3.7 version can be found here: http://www.vbulletin.org/forum/showthread.php?t=188670

What does this hack do?
If a user has been banned it will display information about the ban (ban date, reason and the person who has banned the user) on the user's profile.

Demo: http://piforums.info/member.php?u=44

This is my first hack and I hope everything will work correctly :)

Don't redistribute it without my permission.

Updates:
[30/9/2006] Version 1.0.2: Added improvements posted by flash7 here (http://www.vbulletin.org/forum/showpost.php?p=1086845&postcount=21)
[30/9/2006] Version 1.0.1: Fixed the HTML bugs found by flash7 here (http://www.vbulletin.org/forum/showpost.php?p=1086473&postcount=16)
You need to reupload the baninfo.php if you want to apply the changes.
[29/9/2006] Version 1.0.0: First public release

zappsan
29 Sep 2006, 02:19
Reserved.

Enigm@tic
29 Sep 2006, 03:08
Thanks, i m installing...

Keyser Söze
29 Sep 2006, 03:55
man tthat is great! this needs to be motm ;p

Yorixz
29 Sep 2006, 06:48
Thanks a lot, it's a shame vB doesn't have this by default.

Masiello
29 Sep 2006, 07:28
That's great

Kuimera
29 Sep 2006, 09:25
Tks for this m8.

TMM-TT
29 Sep 2006, 10:33
I changed the code a bit to use vbphrases instead of static text.

Nice one! Thanks! :)

ecansel
29 Sep 2006, 11:40
Thanks.. Working good..

Yorixz
29 Sep 2006, 13:59
Doesn't seem to work here at all sadly, I'm receiving just this warning and no other data; "Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/ftpusers/otfans/html/baninfo.php on line 5"
Anyone has a clue on how to fix that? I'm using MySQL version 4.1.15.

lanc3lot
29 Sep 2006, 14:13
Hello its worked like a charm. My only prob is that it doesnt do the line on the nickname as it shown on the demo page. Is there any way i can do this also?

Ty in advance, nice plugin :)

Snake
29 Sep 2006, 16:00
Wow! Just want I needed. :) Thanks!

Neal-UK
29 Sep 2006, 16:34
Hello its worked like a charm. My only prob is that it doesnt do the line on the nickname as it shown on the demo page. Is there any way i can do this also?

Ty in advance, nice plugin :)

You need to use the html markup box in the banned usergroup via admincp for that effect ;)

lanc3lot
29 Sep 2006, 17:00
Oh, can u please tell me what to write there?:)

zappsan
29 Sep 2006, 23:53
Thanks to everyone who has installed this, I didn't expect to get that many installs^^

Doesn't seem to work here at all sadly, I'm receiving just this warning and no other data; "Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/ftpusers/otfans/html/baninfo.php on line 5"
Anyone has a clue on how to fix that? I'm using MySQL version 4.1.15.
Have you got any other hacks installed which could cause a problem?
Oh, can u please tell me what to write there?:)
Use <s> to strike out usernames.

flash7
30 Sep 2006, 00:25
Hi, nice plugin :)

I found a small bag:
search:
echo 'Forever';

replace
echo 'Forever</td>';

search:
echo $bannedby['username'].'</dd></tr></table><br />';

replace:
echo $bannedby['username'].'</td></tr></table><br />';

zappsan
30 Sep 2006, 01:36
Thanks, I just fixed it and re-uploaded it.

bada_bing
30 Sep 2006, 03:06
Will this work for the vb 3.5.x versions

Keyser Söze
30 Sep 2006, 10:08
might want to update the mod info in the release, and i would think putting the ver. number in the zip title would be nice i always like that, so ppl know the zip has been updated

Yorixz
30 Sep 2006, 10:18
Thanks to everyone who has installed this, I didn't expect to get that many installs^^
You're welcome :p


Have you got any other hacks installed which could cause a problem?

Such as? I haven't got a single hack that should do anything with the userprofile, so I'm afraid I wouldn't know what could possibly be causing this.

Edit;
flash7, you're my hero ;) That code indeed seems to fix my trouble (and the trouble of others, as this should be happening to everyone with 3.6.1 if I read your post), thanks a lot.

flash7
30 Sep 2006, 13:26
Hello zappsan,
I've set a improvement of baninfo.php because $db->query is deprecated on vb 3.6.1

// Ban Info on User Profile Hack © 2006 by zappsan (http://piforums.paulhq.com)

$baninfo = $db->query_first_slave("SELECT * FROM " . TABLE_PREFIX . "userban WHERE userid=" .$userinfo['userid']);
if ($baninfo['userid'])
{
echo '<table class="tborder" cellspacing="1" cellpadding="3" width="100%">
<tr>
<td class="tcat" colspan="3">Ban Information</td>
</tr>
<tr>
<td class="alt1"><b>Time banned: </b>';
if ($baninfo['liftdate'] == '0')
{
echo 'Forever</td>';
}
else
{
$bandate = vbdate($vbulletin->options['dateformat'], $baninfo['bandate'], false);
$liftdate = vbdate($vbulletin->options['dateformat'], $baninfo['liftdate'], false);
echo 'From '.$bandate.' to '.$liftdate.'</td>';
}
if (empty($baninfo['reason']))
{
echo '<td class="alt1"><b>Reason:</b> None</td>';
}
else
{
echo '<td class="alt1"><b>Reason:</b> '.$baninfo['reason'].'</td>';
}
echo '<td class="alt1"><b>Banned by: </b>';
$bannedby = $db->query_first("SELECT username FROM " . TABLE_PREFIX . "user WHERE userid=" .$baninfo['adminid']);
echo $bannedby['username'].'</td></tr></table><br />';
}


let me know if all right :)

zappsan
30 Sep 2006, 21:21
Will this work for the vb 3.5.x versions
I didn't test it with 3.5.x yet.
I might try it later.
might want to update the mod info in the release, and i would think putting the ver. number in the zip title would be nice i always like that, so ppl know the zip has been updated
I updated the info and added the version number to the zip file now :)
Edit;
flash7, you're my hero ;) That code indeed seems to fix my trouble (and the trouble of others, as this should be happening to everyone with 3.6.1 if I read your post), thanks a lot.
It worked fine for me with 3.6.1, strange.
But good to see you haven't got problems anymore :)
Hello zappsan,
I've set a improvement of baninfo.php because $db->query is deprecated on vb 3.6.1

....let me know if all right :)
I added it, thanks :)

Keyser Söze
01 Oct 2006, 04:38
can this be made into a product?

SportsZone
01 Oct 2006, 12:28
Nice hack, thanks :)

Medina
05 Oct 2006, 13:57
How to change the English text to your own language? I'v tried the Language manager by searching for "Time Banned:" But with no results.

Can you help me please.

zappsan
05 Oct 2006, 21:43
can this be made into a product?
Why would you want it to be a product?
Well, I'm probably going to do some changes/updates and I'll look into it.
I can't promise anything though.
How to change the English text to your own language? I'v tried the Language manager by searching for "Time Banned:" But with no results.

Can you help me please.
I didn't add any phrases to this hack, so you won't find them.
If you want different words to be displayed, edit the "baninfo.php" and replace the bold words with your own ones.
I'm planing to add phrases though.
if ($baninfo['userid'])
{
echo '<table class="tborder" cellspacing="1" cellpadding="3" width="100%">
<tr>
<td class="tcat" colspan="3">Ban Information</td>
</tr>
<tr>
<td class="alt1"><b>Time banned: </b>';
if ($baninfo['liftdate'] == '0')
{
echo 'Forever</td>';
}
else
{
$bandate = vbdate($vbulletin->options['dateformat'], $baninfo['bandate'], false);
$liftdate = vbdate($vbulletin->options['dateformat'], $baninfo['liftdate'], false);
echo 'From '.$bandate.' to '.$liftdate.'</td>';
}
if (empty($baninfo['reason']))
{
echo '<td class="alt1"><b>Reason:</b> None</td>';
}
else
{
echo '<td class="alt1"><b>Reason:</b> '.$baninfo['reason'].'</td>';
}
echo '<td class="alt1"><b>Banned by: </b>';
$bannedby = $db->query_first("SELECT username FROM " . TABLE_PREFIX . "user WHERE userid=" .$baninfo['adminid']);
echo $bannedby['username'].'</td></tr></table><br />';
}

bonjurkes
14 Oct 2006, 18:46
when i try to visit baninfo.php

domainname.com/forum/baninfo.php i am getting an error like

Fatal error: Call to a member function on a non-object in /home/bonjurke/public_html/forum/baninfo.php on line 4

zappsan
14 Oct 2006, 19:59
when i try to visit baninfo.php

domainname.com/forum/baninfo.php i am getting an error like
Well, the ban info will only work when you view the profile of a banned user, trying to visit the file alone wont work.
That's how it's meant to be.

Wild-Wing
04 Nov 2006, 23:06
this is a cool idea.

Bounce
31 Dec 2006, 17:45
how do you take the info off ....for instance if you reinstate someone..

it still shows them as banned :tired:

ajschamps
02 Jan 2007, 17:05
Is the info able to be shown to all members? Or just mod/admins?

zappsan
02 Jan 2007, 18:53
how do you take the info off ....for instance if you reinstate someone..

it still shows them as banned :tired:
It shouldn't.
The ban info is only dispölayed when someone is banned.
If you still see it, them person must still be banned.
Is the info able to be shown to all members? Or just mod/admins?
Everyone can see it, but you could hide/display it for certain usergroups using conditionals in the templates.

Bounce
04 Jan 2007, 21:35
It shouldn't.
The ban info is only dispölayed when someone is banned.
If you still see it, them person must still be banned.


Well there posting lol, I banned someone then reinstated them and the info was still there :confused:

Had to uninstall as they complained that they could see they were banned when they were not

dc pringle
11 Jan 2007, 13:22
Is this meant to work on 3.6.0?

I dont think it is working for me :(

Excellent plugin my friend


Just checked and it only works on people banned after the plugin was installed :(


Still a great plugin tho, excellent :D


Just a suggestion.. An option for showing a record of the banning even if they have been unbanned? I reckon this'd be useful for other mods to see how many times someone has been banned & what for

zappsan
11 Jan 2007, 13:41
Well there posting lol, I banned someone then reinstated them and the info was still there :confused:

Had to uninstall as they complained that they could see they were banned when they were not
Strange...
The file actually looks for an entry in the banned users table and only displays the banned info when an entry is found.
Are you sure you there isn't any ban info in the table anymore?

I just tried out banning someone and then unbanning them and everything is working fine.

Is this meant to work on 3.6.0?

I dont think it is working for me :(

Excellent plugin my friend


Just checked and it only works on people banned after the plugin was installed :(


Still a great plugin tho, excellent :D


Just a suggestion.. An option for showing a record of the banning even if they have been unbanned? I reckon this'd be useful for other mods to see how many times someone has been banned & what for
You mean that it's only showing up when you banned someone after you installed the plugin and not for people who have been banned before (and are still banned)?
That's strange, if they are still banned it should be showing up...

And concerning your idea: I actually already thought about adding something like that.
I actually plan to as well, I hope I'll have the time to make an update to this soon since there are also other things the hack needs (using phrases and templates for example...).

Mr_Snob
13 Jan 2007, 18:19
That's great idea Thank You Man

Terminatoronly
03 Feb 2007, 18:27
Nice Mod Installed :D

BobbyBig
04 Feb 2007, 16:34
This Mod is full of bugs.
Users which got banned through the Warningsystem are not shown.
Also Users which got removed from Ban list still get shown the Ban Info.

Deinstalled.

Keyser Söze
05 Mar 2007, 12:39
ya this hack is in major need of an update, i would suggest seting it in the admincp to defined user groups, like if usergroup 15 then it shows up, let there be an option or something

is good hack tho

flash7
07 Jun 2007, 16:45
tested on vb 3.6.4 work like a charm :)

cristinag
20 Aug 2008, 14:36
Is this going to be updated for use with 3.7.xx? I just upgraded and now this mod doesn't work. Thanks!

zappsan
21 Aug 2008, 00:00
I just finished the 3.7 version.
http://www.vbulletin.org/forum/showthread.php?t=188670

Mateusz0307zk
09 Mar 2011, 18:23
Does anyone learns this in vB4 ?

Baja
19 May 2011, 03:34
Good question. I'm still looking for a vb4 equivalent as well. Any suggestions?

zappsan
30 May 2011, 21:19
I would make a version for vB4, but the problem is that I don't own a vB4 license so I have no way to work on it.

Baja
25 Jun 2011, 09:20
Zappsan, I might be able to help. I've got an expired vb3 license with access up to vb4.1.2 PL1 (forum). I wouldn't mind giving you that license if you can update this mod. Does anyone know if vb allows expired vb3 licenses to be transferred?

I also have a spare vb4 Publishing license. It's already been transferred once, so I can't give you that license permanently, but I don't have any plans to use it for the next 6 months. I'd be happy to let you use it temporarily.

Which would you prefer?