View Full Version : Automatically create thread when a member profile changes?
David LeBow
01-07-2009, 07:50 AM
I expect it's possible, I expect I could find it eventually, but I expect that 30 people have long since solved it, so I thought I'd ask first:
Is there code around which creates a thread each time a member profile changes?
We have a relatively small forum where people are relatively interested in the profile information in particular. It'd be useful to have a post appear in a forum: "Bill Bloggs has uploaded his CV", "Janet Jackson has updated her medical history"... that kind of thing.
David LeBow
01-08-2009, 12:49 PM
Youch. Impossible question, or wrong way to ask?
Cover me, I'm going in...
Lynne
01-08-2009, 01:55 PM
I don't recall having seen anything like what you are talking about. Have you tried searching the mods area?
David LeBow
01-08-2009, 02:07 PM
Yes... but it's the proverbial needle/haystack thing, I'm afraid. I'll have a look through the code looking for hooks and use an educated guess.
Is there a documented list of vB hooks around?
As always: thanks for the help.
(I hope that you've got a really lucrative contract with vBulletin and that it's not all just for the Karma...)
Rene Kriest
01-08-2009, 02:56 PM
We have a relatively small forum where people are relatively interested in the profile information in particular. It'd be useful to have a post appear in a forum: "Bill Bloggs has uploaded his CV", "Janet Jackson has updated her medical history"... that kind of thing.
There are addons around that record the profile changes with more detail but only in adminCP.
However I would like to see vb record any changes at least for the forum admin(s).
Lynne
01-08-2009, 03:00 PM
Here's one of the 3.7.x hook lists - https://vborg.vbsupport.ru/showthread.php?t=188874&highlight=hook* But, the best thing to do is find the code/script called when a user hits Save on the Profile Page. Take a look at that page and find a hook to use and write a plugin to create a thread.
Karma is a wonderful thing. :)
David LeBow
01-08-2009, 03:04 PM
Ha - there's a post in the hooks thread you reference which asks the same question:
"Are there any hooks that fire off after a user updates their profile?
I need to write a plugin that reflects profile changes in a secondary application and rather than do a batch job every hour, it makes sense to use a hook if there is one available.
".
Oddly enough... unanswered since September. I'm guessing that I have my work cut out for me...
Lynne
01-08-2009, 03:14 PM
Taking a quick look at the Edit Options page on my profile (3.8 RC1), I see that the form calls profile.php?do=updateoptions . So, look in there are at the do=updateoptions and I'm sure you will find what you need.
David LeBow
01-08-2009, 03:28 PM
Edit Options is the wrong place, I believe.
I'm looking for profile fields as found, for example at profile.php?do=editprofile. I haven't gotten there yet as I'm currently plowing through the (clasically undocumented) Member.php, where one can ALSO edit one's own profile information. I'm guessing that I'll again end up at the point where there's a hook in one place but not the other, making the functionality seem buggy to the poor user... In Member.php I didn't really see the place to insert the magic - looking at the template next. Will look at profile.php next.
Thanks.
--------------- Added 1231436652 at 1231436652 ---------------
Yes... reaching that conclusion. I don't see the way to cover the functionality in Member.php, but in Profile.php, there's hope. There's a hook pair which seems promising: 'profile_edit_start' and a hook 'profile_updateprofile'.
I've been in Software engineering for mumbledymumbledy years but up until now have had no experience in PHP and its execution environment. Can I copy away the $userdata in the first hook into a variable I can call my own (e.g.: $myuserdata) at the first hook and have it be available at the second...? I'm guessing that the answer is no as it would have to be maintained across subsequent calls to the web server. Is that something one could *somehow* copy into the session and retrieve?
Woe is me...
Lynne
01-08-2009, 04:08 PM
Whoops, you are right, I should have looked at the edit profile page instead of the edit options page.
David LeBow
01-08-2009, 04:20 PM
Can I copy away the $userdata in the first hook into a variable I can call my own (e.g.: $myuserdata) at the first hook and have it be available at the second...? I'm guessing that the answer is no as it would have to be maintained across subsequent calls to the web server. Is that something one could *somehow* copy into the session and retrieve?
Any hint on that?
Whoops, you are right, I should have looked at the edit profile page instead of the edit options page.
When *I* grow up, I'm going to be a moderator, too! ;)
(...is something going on with the forum? I'm suddenly getting a lot of broken link messages - for the e-mail notification to the post, when trying to "preview post", etc.).
Lynne
01-08-2009, 04:30 PM
I am having problems on this forum also. I think they share a server with vb.com and my guess is vb.com is getting hit with everyone trying to download 3.8 gold right now.
The userdata should be available to use in the plugins. I'm guessing your would access it with $userinfo[userid] for the userid, etc. Do you have a test site? I'd play with this on there.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.