PDA

View Full Version : Userprofile Changed Date in Member Profile & recent changed on forumhome


Marco van Herwaarden
11-23-2005, 10:00 PM
<font size="4">Userprofile Changed Date - Version 1.03</font>

Hack: Userprofile Changed Date
Version: v1.03
Author: MarcoH64

Last tested on vB3.5.3, but should work on any 3.5.x

Features
- Show the time a User Profile was last updated in the Public Member Profile
- Show a list of the most recent members who have changed their profile on the forumhome page. Hovering over the username will show the time the profile was changed
- Set timelimit between edits before a member show in the recent changed list on forumhome again, to prevent 'Recent Change Spammers'
- As an update are counted changes in: Profile, Avatar, Profile Picture & Signature
- You can turn off updating the timestamps for any of these locations from your vB Options
- The format of the Last Changed date-time can be set in your vB Options.
- Choose to cutoff the list of Recent Changed profiles by either a maximum number of profiles, a timelimit (ie. changed in the last 24 hours) or both.

Changelog
12-2-2006 v1.03
- Added option to cutoff the list of changed profiles on the forumhome page based on a timelimit.
- In previous versions you had to enable/disable plugins, to change if a specific area of the userprofile
(ie Avatar, signature, ..) would be counted as an update. Now added new settings in the vB Options to control this.
- Added a date/time format to the Options. Now you can control how the Last Changed date is shown. Before a change have
effect, someone needs to update their profile since the formatted date/time is already stored in the datastore.

5-12-2005 v1.02
- Fixed bug where only the last change would show on forumhome

25-11-2005 v1.01
- Moved the core logic to functions loaded inside new Plugin
- Removed core logic from the other Plugins, making it easier to maintain code
- Fixed the Profile Pic Plugin
- Added new Plugin for Signature changes
23-11-2005 v1.00
- Initial Release

Notes
Copyright ©2005 MarcoH64
This Modification may not be redistributed in whole or significant part or changed without prior agreement of author.
Please don't forget to click Install.
If you like this work and would like to support the author, donations are always welcome at Paypal: Marcoh64 AT gmail.com

Dan
11-24-2005, 01:10 PM
Nice one

/me clicks install

Xtrato
11-24-2005, 01:18 PM
I will try this!

nexialys
11-24-2005, 01:46 PM
.
/me thinks MarcoH64 tries to flood the forum with his releases... we will need a specific forum for him!

Marco van Herwaarden
11-24-2005, 01:50 PM
Is it that bad? :D :D

Vizionz
11-24-2005, 01:58 PM
thanks marco for doing this up i appreciate it so much :)

Happy thanksgiving

Marco van Herwaarden
11-24-2005, 01:59 PM
thanks marco for doing this up i appreciate it so much
Then please click install :D

Vizionz
11-24-2005, 02:00 PM
installing it now i will when i am done

Vizionz
11-24-2005, 02:05 PM
its perfect thanks again its exactly what was needed :)

Snake
11-24-2005, 04:06 PM
Thanks for filling up my request. :)

PennylessZ28
11-24-2005, 04:23 PM
Good work, I am linking this over in my MySpace Template Mod Hack.

PennylessZ28
11-24-2005, 04:26 PM
How does this work? I'm wanting to know if I could add an extension to allow you to search profiles by recently updated. Does this add anything to the DB?

Vizionz
11-24-2005, 04:38 PM
when you click the link it brings your to there profile thats about it

PennylessZ28
11-24-2005, 05:50 PM
I was just looking over the xml file and the tables it adds/alters and I think you might be able to add a new search to search for most recently updated profiles.

Or at least search and order by most recent.

Vizionz
11-24-2005, 05:56 PM
that would be pretty good for a vbadvanced module

cbr929rrerion
11-24-2005, 06:35 PM
anyway to get it to check changes to more user stuff, like avatar changes, signature and profile pics, etc..

If they change the signature or avatar it dont list it.. can you do it? I know I cant.. But I click *installed* anyway...

Marco van Herwaarden
11-24-2005, 08:50 PM
I was just looking over the xml file and the tables it adds/alters and I think you might be able to add a new search to search for most recently updated profiles.

Or at least search and order by most recent.
Yes this is easily possible.
There are 2 datestamps added to the user table:
- mh_upcd_lastprofilechange: The real last changed timestamp
- mh_upcd_lastprofilelist: The last timestamp this user was put on the list of recent changes. Only updated if the user change his profile after the wait limit has passed since the previous listing. This is done to avoid users changing their profile (or not even really changing) all the time, just to stay on the recent changed list (spamming).

For example, the limit is set to 60 minutes:
00:00 User updates profile. Both timestamps are updated, and he is put in the recent change list.
00:10 User updates his avatar, only mh_upcd_lastprofilechange is updated, and user is not put on the list again
00:55 User update profile again, same as 00:10
01:05 User update Avatar again, waittime has passed, so both are updated again and he is put on the list again.

You can choose yourself which timestamp you want to do a select on if you want to write your own recent changed query, depending if you want the real change time, or the 'anti-spam' time.

You can look up the logic in the plugin on either of the following locations (they are all identical, but didn't want to create an includes/functions_....php file):
- profile_updateavatar_complete
- profile_updateprofile
- profile_updateprofilepic_complete

PS:
On the Member Profile page you will see the real changed time.
For the Latest changes on forumhome, a datastore row is used that is filled whenever the recent list needs to be updated.

Marco van Herwaarden
11-24-2005, 08:55 PM
anyway to get it to check changes to more user stuff, like avatar changes, signature and profile pics, etc..
- As an update are counted changes in: Profile, Avatar & Profile Picture
All except signatures are already done. It didn't make much sense to me to do it for signatures since everyone will already see if it is changed.
But if you want you can create a new plugin at hook location 'profile_updatesignature_complete', copy and paste the code from the plugin at location 'profile_updateavatar_complete' in it.

cbr929rrerion
11-24-2005, 09:06 PM
All except signatures are already done. It didn't make much sense to me to do it for signatures since everyone will already see if it is changed.
But if you want you can create a new plugin at hook location 'profile_updatesignature_complete', copy and paste the code from the plugin at location 'profile_updateavatar_complete' in it.


Did it.. It works.. Thanks.... :banana:

Marco van Herwaarden
11-24-2005, 09:12 PM
Did it.. It works.. Thanks....
So you created a new plugin, you could feel a bit like a coder now. :D

.Tim
11-24-2005, 10:36 PM
Whenever I have this enabled and change the profile pic I get this error:

Fatal error: Call to undefined function: set() in profile.php(1838) : eval()'d code on line 4

It actually does upload the picture but afterwards it shows that error instead of taking me back to the page. I disable this feature and it works just fine, no error.

cbr929rrerion
11-25-2005, 01:36 AM
So you created a new plugin, you could feel a bit like a coder now. :D

I wish I knew enough to even think about it.. I still have a smilie problem I cant fix to save me.. I have spent days on it and tried almost everything and still cant fix it...

And not having any luck getting any help from the gallery peeps...

Marco van Herwaarden
11-25-2005, 07:31 AM
Whenever I have this enabled and change the profile pic I get this error:

Fatal error: Call to undefined function: set() in profile.php(1838) : eval()'d code on line 4

It actually does upload the picture but afterwards it shows that error instead of taking me back to the page. I disable this feature and it works just fine, no error.Oops not enough testing done, will fix this today. Just for now you could disable the plugin for the Profile Pictures to get rid of the error message.

.Tim
11-25-2005, 07:55 AM
Yeah I have, thanks. It's a great hack even with the bug! :D

Marco van Herwaarden
11-25-2005, 01:22 PM
Version 1.01 Released.

25-11-2005 v1.01
- Moved the core logic to functions loaded inside new Plugin
- Removed core logic from the other Plugins, making it easier to maintain code
- Fixed the Profile Pic Plugin
- Added new Plugin for Signature changes

23-11-2005 v1.00
- Initial Release

PennylessZ28
11-26-2005, 01:19 AM
I uninstalled the old one, and installed the new one. Now it doesn't show up in the profile anymore? Any suggestions or thoughts?

Marco van Herwaarden
11-26-2005, 05:51 AM
Why uninstall the old one? You should have just done an overwrite install.

On the uninstall the data that was added to the database will have been removed, so all dates are 0 again. Please make a change to your profile and see if it show up again.

PennylessZ28
11-26-2005, 05:58 AM
Why uninstall the old one? You should have just done an overwrite install.

On the uninstall the data that was added to the database will have been removed, so all dates are 0 again. Please make a change to your profile and see if it show up again.

Yeah I figured that one out shortly after when I thought about it. :nervous:

Wordplay
11-27-2005, 12:54 AM
no matter what i set the number of profiles displayed in the latest profiles edited... it just shows the last one. is there a fix?

Marco van Herwaarden
11-27-2005, 05:48 AM
Did actually more then 1 member change their pofile?

If yes, please provide a screenshot of your setting, your plugins and preferably a link to your board (with test user if needed).

Wordplay
11-27-2005, 11:15 AM
actually since i installed it over 30 members have edited theirs. 5 alone within 20 minutes. when i reported this. exactly what settings are you talking about?

Waittime in Minutes before a Profile is listed again=60 (now i just changed it to that before that it was 1440)
List Limit=10 (tried changing that number but it made no difference)

a screen shot of my plugins? this should be about it plugins and products.

Marco van Herwaarden
11-27-2005, 04:23 PM
Nope that page where all the plugins are listed.

bold
12-01-2005, 05:11 PM
no matter what i set the number of profiles displayed in the latest profiles edited... it just shows the last one. is there a fix?

same problem

Marco van Herwaarden
12-01-2005, 05:20 PM
Please answer the same questions as i asked wordplay. Since he never replied anymore, i guess he got it solved.

jaks
12-02-2005, 06:50 AM
Jaks *Installs* Sweet little hack thanks :)

Will this work in postbits?

Marco van Herwaarden
12-02-2005, 06:52 AM
No but you could easily do this.

jaks
12-03-2005, 10:05 PM
I have the same problem as the other guys. Only showing one. My settings in VB Opt. are (Time 1440 and Show 10) I even resaved it to make sure it was input.

Thanks

bold
12-04-2005, 12:32 AM
Checking other people's sites, I think we all have that problem.

Marco van Herwaarden
12-04-2005, 06:43 AM
Someone with this problem please PM me a temporary admin login, and i will have a look.

jaks
12-04-2005, 09:39 PM
PM sent :)

Jaks

Marco van Herwaarden
12-05-2005, 09:59 AM
Version 1.02 released:

5-12-20005 v1.02
- Fixed bug where only the last change would show on forumhome


Was a stupid bug where i removed too much code when i cleaned the previous version from debug statements before releasing.

To upgrade, simply choose an Overwrite install of the productfile.

Thanks to Jaks for letting me have a look and be able to find the cause of this problem.

Marco van Herwaarden
12-06-2005, 08:55 AM
Nobody got feedback if the issues are resolved in the new version?

Marco van Herwaarden
12-23-2005, 08:32 AM
Will give my feedback request one more bump.

lazyseller
12-23-2005, 04:12 PM
Thanks for the hack i just installed it no problems...

is there a way to remove the time ?

Marco van Herwaarden
12-23-2005, 09:29 PM
You want it removed everywhere? Will have a look at that.

swa
12-23-2005, 10:19 PM
got it working on my site! nice hack!

CodeRed
01-06-2006, 01:04 AM
<thinking out loud>
what would be really cool as well is to show what members updated their profiles that day kinda like the "members visited today" hack

i know id be interested in that so i can always check out peoples profiles say at night before i log off etc. that way ill be able to see all of the profiles edited.
</thinking out loud>

Marco van Herwaarden
01-19-2006, 06:31 PM
Well you can have the list of most recently changed. I will think about implementing a Changed Today.

Marco van Herwaarden
02-12-2006, 11:38 AM
Version 1.0.3 released:

12-2-2006 v1.03
- Added option to cutoff the list of changed profiles on the forumhome page based on a timelimit.
- In previous versions you had to enable/disable plugins, to change if a specific area of the userprofile
(ie Avatar, signature, ..) would be counted as an update. Now added new settings in the vB Options to control this.
- Added a date/time format to the Options. Now you can control how the Last Changed date is shown. Before a change have
effect, someone needs to update their profile since the formatted date/time is already stored in the datastore.

Marco van Herwaarden
02-12-2006, 11:41 AM
is there a way to remove the time ?You can now format the datetime in version 1.0.3
what would be really cool as well is to show what members updated their profiles that day kinda like the "members visited today" hack
With the timebased cutoff introduced in version 1.0.3 you can now show the changes in the last 24 hours (or any other time).

The Chief
02-13-2006, 01:48 PM
installed and works great, thanks!!

/me clicks install

Snake
02-13-2006, 02:01 PM
Whoa I guess I've missed the lil update. Thanks! :)

Marco van Herwaarden
02-13-2006, 02:07 PM
Whoa I guess I've missed the lil update. Thanks!
Then you should click Install ;)

hiiped
02-13-2006, 04:06 PM
great work ......

< clicks install >

Smiry Kin's
02-16-2006, 12:10 AM
/me Installs Thanks

influence
03-26-2006, 01:54 PM
how about a vba module for this?

futuredood
06-29-2006, 04:12 AM
how would you go about counting an additoin to say vbgallery as a profile update?

futuredood
07-11-2006, 02:28 PM
Hi Marco,

For the list of updated profiles in the memberinfo, is their any way to put an if condition to show friends only? So instead of seeing 1,000 updated profiles, members would only see maybe a list of 50 updated profiles of their friends.

Sidewindr
08-13-2006, 12:28 PM
It seems to break in vb3.6 ... I cannot save profiles with the adon installed and enabled .. disable it and I can save profiles .. the error is below ..


Database error in vBulletin 3.6.0:

Invalid SQL:
REPLACE INTO datastore
VALUES
( 'mh_upcd'
, 'a:1:{i:0;a:4:{s:6:\"userid\";i:3;s:8:\"username\";s:9:\"Sidewindr\";s:23:\"mh_upcd_lastprofilelist\";i:1155475705;s:13:\"dateformatted\";s:20:\"08-13-2006, 11:28 PM\";}}'
);

MySQL Error : Column count doesn't match value count at row 1
Error Number : 1136
Date : Sunday, August 13th 2006 @ 11:28:26 PM
Script : http://www.ls1.com.au/forum/profile.php?do=updatesignature
Referrer : http://www.ls1.com.au/forum/profile.php?do=editsignature
IP Address : 210.0.102.45
Username : Sidewindr
Classname : vB_Database_MySQLi

Sidewindr
08-20-2006, 09:35 PM
Beuller... Beuller...???

Anyone reading this thread ?

Bhuwan
08-23-2006, 03:03 PM
Beuller... Beuller...???

Anyone reading this thread ?

Load up the XML code
search for:


, '" . $vbulletin->db->escape_string(serialize($latest_list)) . "'


REPLACE IT WITH:


, '" . $vbulletin->db->escape_string(serialize($latest_list)) . "','1'

moonclamp
09-21-2006, 03:36 AM
Installed and working well. Thank You :)

One question (or request) I'm using the Extra Profile Fields Page Hack (https://vborg.vbsupport.ru/showthread.php?t=98282) by Wired1 (https://vborg.vbsupport.ru/member.php?u=44907) ... Is there an easy way to log updates for this too as I have most of the profile information on there?

rolandogomez
09-21-2006, 05:36 PM
I've installed this, changed my profile signature to activate it, and as the validation screen passed from one page to another after the update, this briefly was in the header part of the scree, "Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of mh_upcd_set_changed(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /var/www/vhosts/glamour1.com/htdocs/forums/profile.php(1282) : eval()'d code on line "

Though it went back to the my home profile page after I changed it my signature, all seems to work well. I'm just curious if I get this errror message with a change, everyone else will too. Any ideas? Thanks, forum is at www.glamour1.com Thanks, rg.

mikeclarke
09-24-2006, 03:02 PM
Load up the XML code
search for:


, '" . $vbulletin->db->escape_string(serialize($latest_list)) . "'


REPLACE IT WITH:


, '" . $vbulletin->db->escape_string(serialize($latest_list)) . "','1'



This fix worked for me on 3.6.1. Thanks very much

criscokid
01-12-2007, 09:22 AM
I've loaded this mod on a vb3.6.4 board and made the change that Bhuwan suggested (https://vborg.vbsupport.ru/showpost.php?p=1058765&postcount=61) and is working ok. It didn't appear to be at first... after waiting about an hour 'changed usernames' are now starting to appear on forumhome.

criscokid
09-03-2007, 05:28 PM
I've just upgraded a site to vB3.6.8 and when someone tries to update their profile photo the following error message is generated:

Database error in vBulletin 3.6.8:

Invalid SQL:
REPLACE INTO datastore
VALUES
( 'mh_upcd'
, 'a:50:{i:0;a:4:{s:6:\"userid\";s:1:\"1\";s:8:\"username\";s:4:\"Bart\";s:23:\"mh_upcd_lastprofilelist\";i:1188841274;s:13:\"dateformatted\";s:21:\"Mon 03 Sep 2007 18:41\";}i:1;a:4:{s:6:\"userid\";s:5:\"11446\";s:8:\"username\";s:7:\"Opensky\";s:23:\"mh_upcd_lastprofilelist\";s:10:\"1188672172\";s:13:\"dateformatted\";s:21:\"Sat 01 Sep 2007 19:42\";}i:2;a:4:{s:6:\"userid\";s:5:\"11445\";s:8:\"username\";s:15:\"seasonedclubber\";s:23:\"mh_upcd_lastprofilelist\";s:10:\"1188659831\";s:13:\"dateformatted\";s:21:\"Sat 01 Sep 2007 16:17\"; (rest of data snipped) }}'
);

MySQL Error : Column count doesn't match value count at row 1
Error Number : 1136
Date : Monday, September 3rd 2007 @ 06:41:15 PM
Script : http://xxx.com/forums/profile.php?do=updateprofilepic
Referrer : http://xxx.com/forums/profile.php?do=editprofilepic
Classname : vb_database

Does anyone know a fix for this?

rayphua
09-04-2007, 02:43 AM
Nice work Marco, and nice fix Bhuwan. Working on 3.6.7 PL1

Am now worried if the problem Crisco posted will surface as well... Didn't try it yet though.

criscokid
09-05-2007, 11:00 AM
I've just upgraded a site to vB3.6.8 and when someone tries to update their profile photo the following error message is generated:

Database error in vBulletin 3.6.8:
I couldn't find anything wrong... the plugin was identical to the one I used on another site that I'm an admin of, I even downloaded a fresh copy. Still no joy. Then I thought 'weel it's working on the other site...' so I logged on to that site, exported the plugin, and imported it on my newly upgraded site... and bingo! It's working. :) :)

Marco van Herwaarden
09-05-2007, 03:48 PM
I've just upgraded a site to vB3.6.8 and when someone tries to update their profile photo the following error message is generated:

Database error in vBulletin 3.6.8:

Invalid SQL:
REPLACE INTO datastore
VALUES
( 'mh_upcd'
, 'a:50:{i:0;a:4:{s:6:\"userid\";s:1:\"1\";s:8:\"username\";s:4:\"Bart\";s:23:\"mh_upcd_lastprofilelist\";i:1188841274;s:13:\"dateformatted\";s:21:\"Mon 03 Sep 2007 18:41\";}i:1;a:4:{s:6:\"userid\";s:5:\"11446\";s:8:\"username\";s:7:\"Opensky\";s:23:\"mh_upcd_lastprofilelist\";s:10:\"1188672172\";s:13:\"dateformatted\";s:21:\"Sat 01 Sep 2007 19:42\";}i:2;a:4:{s:6:\"userid\";s:5:\"11445\";s:8:\"username\";s:15:\"seasonedclubber\";s:23:\"mh_upcd_lastprofilelist\";s:10:\"1188659831\";s:13:\"dateformatted\";s:21:\"Sat 01 Sep 2007 16:17\"; (rest of data snipped) }}'
&nbsp;);

MySQL Error : Column count doesn't match value count at row 1
Error Number : 1136
Date : Monday, September 3rd 2007 @ 06:41:15 PM
Script : http://xxx.com/forums/profile.php?do=updateprofilepic
Referrer : http://xxx.com/forums/profile.php?do=editprofilepic
Classname : vb_database

Does anyone know a fix for this?See https://vborg.vbsupport.ru/showpost.php?p=1058765&postcount=61

2impulsiv
03-18-2008, 11:37 PM
Installed and working well with 3.6.8

Cheers.

Taragon
04-01-2008, 06:34 PM
any chance something like this would be available for 3.7.0?

Edit:

Currently it is working on forumhome :p

Another edit:

Marco, currently it only works at the MEMBERINFO template. Would it be possible to add this to ie. the memberinfo_block_ministats template perhaps?

<div class="alt1 block_row">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td width="100%">
<dl class="smallfont list_no_decoration profilefield_list">
<if condition="$prepared['birthday']">
<dt class="shade">$vbphrase[birth_date]</dt>
<dd>$prepared[birthday] <if condition="$prepared['age']">($prepared[age])</if></dd>
<else /><if condition="$prepared['age']">
<dt class="shade">$vbphrase[age]</dt>
<dd>$prepared[age]</dd>
</if></if>
<dt class="shade">$vbphrase[join_date]</dt>
<dd>$prepared[joindate]</dd>
<if condition="$mh_upcd_last_changed">
<dt class="shade">$vbphrase[mh_upcd_last_change_date]</dt>
<dd>$mh_upcd_last_changed</dd>
</if>
<dt class="shade">$vbphrase[total_posts]</dt>
<dd>$prepared[posts]</dd>
$template_hook[profile_ministats_list]
</dl>
</td>
<if condition="$prepared['avatarurl']">
<td><img src="$prepared[avatarurl]" alt="<phrase 1="$prepared[username]">$vbphrase[xs_avatar]</phrase>" $prepared[avatarsize] class="alt2" id="user_avatar" /></td>
</if>
</tr>
</table>
</div>
<div class="alt2 smallfont block_row block_footer"><a href="#stats" onclick="return vB_TabCtrls['profile_tabs'].switch_tab('stats')">$vbphrase[show_all_statistics]</a></div>