PDA

View Full Version : Profile Enhancements - Userlog on profile - Display namechanges,bans and email changes


zappsan
19 Apr 2008, 23:43
What does this do?

This hack will display changes which have been made to the user's account (currently bans, username changes and email changes) in an additional tab in the user profile. It should make it easier for users to keep track of changes applied to someone's account (especially name changes).

Instructions

Simply import the userlogs_on_profile product and you should be done.

Notes


The hack will add one new template (memberinfo_block_userlog)
For displaying the bans of someone, the hack will assume the usergroup for banned members is usergroup number 8 (default banned group on a fresh vB installation). If your banned group has a different ID, you can change it in the adminCP (Userlog on Profile Settings).
All changes made using vB 3.6 or any lower version won't be displayed, since the userlog feature was first introduced in 3.7
If there are no entries for someone, the tab won't be displayed on their profile.


Updates

[21/6/2008] Version 1.2:
-The hack now also displays email changes (can be turned off)
-The hack now uses only one query instead of 3
-Applied some of the suggestions from Kentauros in this post (http://www.vbulletin.org/forum/showpost.php?p=1537461&postcount=26)

[22/4/2008] Version 1.1:
Added AdminCP settings:
-Option to turn the namechangelog or banlog on/off
-Option to only allow certain usergroup to see the banlogs/namechangelogs
-Option to set the ID of the banned group

[20/4/2008] Version 1.0:
First release

Jasem
20 Apr 2008, 05:28
Thank you very much

bxbigt
20 Apr 2008, 05:49
sweet thanks!!

Magnumutz
20 Apr 2008, 08:36
Sweet, i was actually looking for a mod like this :)

M-Tuning
20 Apr 2008, 09:49
Very Nice!

I made a dutch version, hope you don't mint:

Hornstar
20 Apr 2008, 10:25
Thanks, just wondering who will have permission to view the ban logs tho? can you set that for only staff?

DubaiHost
20 Apr 2008, 11:11
Just what we need ..
thanks ,, Installed ..

M-Tuning
20 Apr 2008, 11:54
Thanks, just wondering who will have permission to view the ban logs tho? can you set that for only staff?

Yes, i need that too.

Have been editing the plugin but I don't get it to work properly.

zappsan
21 Apr 2008, 00:52
Very Nice!

I made a dutch version, hope you don't mint:
It's ok, I'm planning to phrase this hack and I'll make use of your Dutch version then :)
Thanks, just wondering who will have permission to view the ban logs tho? can you set that for only staff?

Yes, i need that too.

Have been editing the plugin but I don't get it to work properly.
There is no control to do this, but I'm probably going to add one.
Currently, you need to edit the templates.

You need to edit the memberinfo_block_userlog template.

Find this:


<if condition="$block_data[baninfo]!=''">
<fieldset class="statistics_group">

<legend>Bans</legend>

<ul class="list_no_decoration">
$block_data[baninfo]
</ul>
</fieldset>
</if>

and change it to


<if condition="is_member_of($bbuserinfo, X, Y, Z)"><if condition="$block_data[baninfo]!=''">
<fieldset class="statistics_group">

<legend>Bans</legend>

<ul class="list_no_decoration">
$block_data[baninfo]
</ul>
</fieldset>
</if>
<else />
Ban Logs are only visible for staff members.
</if>

This will display the message "Ban Logs are only visible for staff members." to all usergroups which can't see the logs, you can change it to whatever you want.
Be sure to replace the X.Y,Z in<if condition="is_member_of($bbuserinfo, X, Y, Z)">with the usergroup numbers which are allowed to see the logs.

M-Tuning
21 Apr 2008, 08:07
I Already did that, but I want to totally hide the tab if the usergroup is wrong and not the content of the tab.

Hornstar
21 Apr 2008, 08:32
I Already did that, but I want to totally hide the tab if the usergroup is wrong and not the content of the tab.

I'd prefer it to just show the username changes and not the ban log if the user is not a staff member.

M-Tuning
21 Apr 2008, 10:54
That's what Zappsan did.

bilgicc
22 Apr 2008, 06:06
Thanks a lot.

zappsan
22 Apr 2008, 15:20
I just updated the hack to version 1.1
The template edits I posted before aren't necessary anymore.
You can now change the settings in the adminCP (see screenshot).

Version 1.1:
Added AdminCP settings:
-Option to turn the namechange log or banlog on/off
-Option to only allow certain usergroups to see the banlogs/namechange logs
-Option to set the ID of the banned group

M-Tuning
22 Apr 2008, 16:00
Nice!

Hornstar
23 Apr 2008, 09:41
yeah great update! Thanks alot.

Noonster
29 Apr 2008, 20:57
Does not seem to be showing on 3.7.0 Gold??

zappsan
29 Apr 2008, 21:47
Really? I didn't try it out on gold yet. I'm gonna do tomorrow.
Be aware that the tab won't be displayed, if the user hasn't been banned or didn't have any name changes before. Also make sure you allowed the right usergroups to view it.

Boofo
29 Apr 2008, 22:31
Can the email change with date and time be added to this? Currently I use the Save User's Email Address hack that I made, but it would be great to incorporate that into this.

ecihanuysal
30 Apr 2008, 00:16
well, i installed this but how can i remove or delete the logs from the user's profile page??

Bounce
30 Apr 2008, 00:54
Very nice , thanks :up:

Bounce
30 Apr 2008, 00:55
Does not seem to be showing on 3.7.0 Gold??

I found it at the end of someone's profile you will see >> and a drop down appears on mine with the info in there :up:

It only show's if a username has been altered so will not show on all profiles

nexialys
30 Apr 2008, 02:11
good idea for a block ... i was to write my own this week-end, so you make me a gift here.. lol

though, i will suggest that instead of multiple queries you simply use one that read the whole table for that user, and cache the results sorted by fieldname AND dateline, so you just have to use the fieldname you want...

you could even add the same elements listed when you read the editlog in the admincp... i'm going to do that myself, because most of my staff prefer to read these infos in the profile because they can't read the editlog...

zappsan
19 May 2008, 00:11
Can the email change with date and time be added to this? Currently I use the Save User's Email Address hack that I made, but it would be great to incorporate that into this.
Email changes get lgged too? I'll take a look at it.
well, i installed this but how can i remove or delete the logs from the user's profile page??
Well, it's same info which is displayed in the adminCP, I didn't see an option to delete logs there though.
good idea for a block ... i was to write my own this week-end, so you make me a gift here.. lol

though, i will suggest that instead of multiple queries you simply use one that read the whole table for that user, and cache the results sorted by fieldname AND dateline, so you just have to use the fieldname you want...

you could even add the same elements listed when you read the editlog in the admincp... i'm going to do that myself, because most of my staff prefer to read these infos in the profile because they can't read the editlog...
I'll try to work out the query thing, I still need to gain more experience at this kind of stuff :)

Majest
21 May 2008, 11:04
Makes life much easier, thank you very much.

Kentaurus
01 Jun 2008, 03:17
Thanks. Nice hack.

Some comments:

Instead of
$userid=intval($_GET[u]);
You should use:
$userid = $this->profile->userinfo['userid'];

========

Instead of
mysql_fetch_array(
you should use
$db->fetch_array(


========


Instead of
$vbulletin->db->
you should use
$this->registry->db->

anything $vbulletin-> could be accomplished with $this->registry
and you eliminate the use of a global variable and instead use the encapsulated class reference

========

The template is not cached. That is an additional query in all profiles. Add a pluging for 'cache_templates' with this code:


if (THIS_SCRIPT == 'member')
{
$globaltemplates[] = 'memberinfo_block_userlog';
}

Boofo
01 Jun 2008, 04:21
Is this hack even still being supported?

zappsan
02 Jun 2008, 10:01
I'm sorry I've currently got too many problems so I can't work on this for a while. I'll try to add Kentauros suggestions as soon as possible (thanks for the tips).

Boofo
02 Jun 2008, 10:19
Just an update on the progress once in a while is all that is needed. ;)

J105C
02 Jun 2008, 13:01
This does not work or appear just recently. It wont' show up on my froums anymore.

I am running vb 3.7.1 here and added all my usergroups to view namechanges/bans :O

edit: Nevermind it is working now. It just didn't show all the previous information from my db before I imported it.

Is there any way to restore the ban/name change info from a pervious db of vB w/ the same users?

zappsan
21 Jun 2008, 14:11
I just uploaded version 1.2 and hope everything is working fine.

[21/6/2008] Version 1.2:
-The hack now also displays email changes (can be turned off)
-The hack now uses only one query instead of 3
-Applied some of the suggestions from Kentauros in this post (http://www.vbulletin.org/forum/showpost.php?p=1537461&postcount=26)

Kentaurus, I didn't add all of your suggestions, since some of them seemed to cause problems for me and I didn't have time to troubleshoot them. The templates are now being cached, thanks for the tip!
This does not work or appear just recently. It wont' show up on my froums anymore.

I am running vb 3.7.1 here and added all my usergroups to view namechanges/bans :O

edit: Nevermind it is working now. It just didn't show all the previous information from my db before I imported it.

Is there any way to restore the ban/name change info from a pervious db of vB w/ the same users?
If it's a DB from a 3.6 version, there is no way, since there was no log like this in this version. If it's from a 3.7 version it should be working fine.

Boofo
21 Jun 2008, 15:39
Does this add the date and time of the email changes also? And can it be set to be viewed by admins only?

zappsan
21 Jun 2008, 17:33
Does this add the date and time of the email changes also? And can it be set to be viewed by admins only?
It shows the date. And yes you can only allow admins to see it in the hack options (vBulletin Options -> Usergroup on Profile Settings)

Boofo
21 Jun 2008, 18:07
OK, thanks. I'll add the code on my end for the time then.

neto614
22 Jun 2008, 07:37
Nice Thank You:d

rolfw1
22 Jun 2008, 17:50
Nice mod, thank you, clicked installed. :)

hubix
21 Jul 2008, 10:15
Hello!

This Hack is what we need! *thumbup*

Hm, is it possible to make the userlog searchable?

Mrdby
21 Jul 2008, 11:51
that block didn't show up for me.

Mrdby
21 Jul 2008, 11:55
uninstalled

BucWiLd
21 Jul 2008, 11:58
nice feature. thank you

zappsan
21 Jul 2008, 15:39
Hello!

This Hack is what we need! *thumbup*

Hm, is it possible to make the userlog searchable?
What would you want to search it for?
that block didn't show up for me.
The block won't show up if there is nothing to display (the user never changed their email, their username or never got banned before). If you've got too many tabs you might also find it when clicking the >>, also shown in the screenshot posted here: http://www.vbulletin.org/forum/showpost.php?p=1502799&postcount=22

Charlie98902
21 Jul 2008, 16:08
So now this is updated to allow only staff to see email changes/banned info etc.....?

zappsan
21 Jul 2008, 16:22
Yeah as you can see in this screenshot, there are options for it now.
http://www.vbulletin.org/forum/attachment.php?attachmentid=82731&d=1214053204

Charlie98902
21 Jul 2008, 16:33
Yeah as you can see in this screenshot, there are options for it now.
http://www.vbulletin.org/forum/attachment.php?attachmentid=82731&d=1214053204

Thank you and marked as installed. :D

Mrdby
21 Jul 2008, 21:08
What would you want to search it for?

The block won't show up if there is nothing to display (the user never changed their email, their username or never got banned before). If you've got too many tabs you might also find it when clicking the >>, also shown in the screenshot posted here: http://www.vbulletin.org/forum/showpost.php?p=1502799&postcount=22

they had a name change. Let me try it again

Mrdby
21 Jul 2008, 21:11
ok ok..GREAT! thanks!

WishLine
17 Aug 2008, 11:03
You don't know whether there is a product that does something similar for 3.6, is there?

ssslippy
24 Aug 2008, 04:18
Can you also show usergroup changes on this, shouldn't be to hard to expand on this as its already being tracked the same as all the other date u are pulling.

Also this fails to display on the profile.

kirkmkiv
22 Sep 2008, 18:20
I am getting a blank page on profiles when I installed this on 3.7.2 when I have "iTrader Stats in Profile Tabs" plugin also installed.

Hannan
09 Jan 2009, 07:39
Hi there,
It's showing this error on top up of the users profile, when the config file configured in "mysqli" mode:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [path]\member.php(462) : eval()'d code on line 40

any suggestion for fixing?
thanks

zappsan
12 Jan 2009, 15:44
From what I know, using vB's functions should help.

Look for this:
while ($userlogs=mysql_fetch_array($userlogentries))
and replace it with
while ($userlogs=$this->registry->db->fetch_array($userlogentries))

Unfortuneately I couldn't test it.

Sorry for the lack of updates, I actually started working on a newer version a long time ago but ran into a problem which I couldn't solve. I'm gonna ask for help on this so there will hopefully be an update soon.

Megatr0n
12 Jan 2009, 21:32
From what I know, using vB's functions should help.

Look for this:
while ($userlogs=mysql_fetch_array($userlogentries))
and replace it with
while ($userlogs=$this->registry->db->fetch_array($userlogentries))

Unfortuneately I couldn't test it.

Sorry for the lack of updates, I actually started working on a newer version a long time ago but ran into a problem which I couldn't solve. I'm gonna ask for help on this so there will hopefully be an update soon.

Will the original version work with 3.8?

Hannan
12 Jan 2009, 21:45
From what I know, using vB's functions should help.

Look for this:
while ($userlogs=mysql_fetch_array($userlogentries))
and replace it with
while ($userlogs=$this->registry->db->fetch_array($userlogentries))

Unfortuneately I couldn't test it.

Sorry for the lack of updates, I actually started working on a newer version a long time ago but ran into a problem which I couldn't solve. I'm gonna ask for help on this so there will hopefully be an update soon.

Thanks, I've waiting for the new version!

HaS€R
12 Jan 2009, 23:29
Thanks.

gtcompscientist
04 Feb 2009, 18:27
That last bit fixed it for me!

INSTALLED!

gtcompscientist
04 Feb 2009, 18:43
I did make one quick change. On our site, banning is kind of an honor... unless it's permanent. As such, the pages get BIG, but all people want to know is how many times somebody has been banned.

This code does that.

Find:
$match=count(array_intersect($membergroup, $banlogpermissions));
Add below:
$banCount=0;

Find:
$banlog.='<li><span class="shade">'.$changetime.':</span> Banned</li>';
Add below:
$banCount=$banCount+1;

Find:
$this->block_data['baninfo'] ="$banlog";
Replace with:
$this->block_data['baninfo']="Banned a total of: $banCount Times<br/><br/>$banlog";

Works great on mine... first user I tested had been banned 41 times! :up::up:

Sadie Frost
17 Feb 2009, 00:55
You don't know whether there is a product that does something similar for 3.6, is there?
Hi :) This hack might work for you http://www.vbulletin.org/forum/showthread.php?t=101326&highlight=username+change

It's 3.5 but I *think* I was running it on 3.6. There's an addon that displays results on the profile.


In a corollary to that...does anyone know of a way to show the previous usernames in a tooltip on the postbit (when you hovered on the username) like the above linked hack did?

:) Thanks!

MonkYZ
28 Dec 2009, 23:56
Excelent mod ! 10 out of 10 !

By the way, is there a chance for the old username to be showed in user postbit ? Or somewhere more visible than User Public Profile - User Log ? It would be great if that would be possible.

Thank you in advance and keep up the good work !

MonkYZ
15 Jun 2011, 16:58
Can this be updated for vB 4.x? :)

TAIFUN_T
26 Jul 2011, 14:43
Why two identical phrases?

<phrase name="setting_ulog_namechanelogpermissions_title" date="1208816052" username="Virtual Headache" version="1.1"><![CDATA[Namechangelog Usergroup Permissions]]></phrase>

phrase name="setting_ulog_namechangelogpermissions_title" date="1208871522" username="Virtual Headache" version="1.1"><![CDATA[Namechangelog Usergroup Permissions]]></phrase>

Konstantinos
02 Sep 2011, 16:00
ban reason needed too