Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


admin email if user profile has changed
Date: 2008/09/02 14:16 By: netchriss Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 2
graphgraph
Hi,

is it possible to activate a feature or install a plugin or other ideas to get a notify email (include the changed data) to the admin if a user profile has been changed?

I'm still using an older CB 1.0.2 installation, as well the CB 1.1.
Click here to see the profile of this user The administrator has disabled public write access.

Re:admin email if user profile has changed
Date: 2008/09/12 15:45 By: Samurai9 Status: CB Doc subscriber  
Karma: 5  
Junior Joomlapolitan

Posts: 40
graphgraph
Hi netchriss,

I recently had a similar requirement. I needed moderators to be sent an email after users changed their avatars as avatars were not moderated.

What i did was after the avatar was uploaded i used:

Code:

 $cbNotification = new cbNotification; $subject "I built my subject here"; $message "Build message here"; $cbNotification->sendToModerators($subject$message);



You could most probably use $row or $user to get what details have been changed depending on what objects are used in the update user profile method/s.
Click here to see the profile of this user The administrator has disabled public write access.

Re:admin email if user profile has changed
Date: 2008/09/12 16:00 By: netchriss Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 2
graphgraph
Hi Samurai9

fantastic that there is a solution, but I'm not very familiar how to use it.
Can you please give me some more hints or a short description "how to". Which version of CB do you use?

Thank you!!!!
Click here to see the profile of this user The administrator has disabled public write access.

Re:admin email if user profile has changed
Date: 2008/09/13 18:25 By: Rapunzl Status: CB Doc subscriber  
Karma: 50  
Moderator

Posts: 1046
graphgraph
That deserves some karma! Thanks for helping out Samurai9!
Jamie
Rapunzl Reminisces Owner and Website Administrator / Community Builder and Groupjive Team Member and Moderator
_______________________________________________________
Want to speed up the release of CB 1.2 and Plugins? Before posting, please read CB 1.1 Bugs stickies or CB 1.2 Identified Issues and the FAQs and Search the forum and the Web for your error. If not found, post Joomla, CB, PHP, Database and Browser versions, along with the exact error you are getting and results. Fewer posts for the developers to sift through will result in faster releases!

If you're looking for CB plugins, try the Downloads section, Directory (new) section or Joomla Community Builder-specific extensions.
Click here to see the profile of this user The administrator has disabled public write access.

Re:admin email if user profile has changed
Date: 2008/09/15 10:41 By: Samurai9 Status: CB Doc subscriber  
Karma: 5  
Junior Joomlapolitan

Posts: 40
graphgraph
Hi Rapunzl & netchriss,

No problem - i'll try help out where i can,

Ok netchriss,

I am using CB1.1: in components/com_comprofiler/comprofiler.php around line 847,

To get the data that was changed will be quite involved but to get all the data when an update takes place do the following:

1. First put in your code around line 847: var_dump($rowExtras); - just before the line that says: cbRedirectToProfile( $uid, _USER_DETAILS_SAVE );

2. Comment out line 849: cbRedirectToProfile($uid, _USER_DETAILS_SAVE);

3. Refresh your browser. (You will see a whole lot of data displayed on screen)

4. Get all the field values like ["company"], ["city"] etc. that you have in your user details now displaying on screen -> This data will look strange - don't worry just read carefully

You will need to add the following in your code on the line before cbRedirectToProfile($uid, _USER_DETAILS_SAVE); about line 847:
Code:

  $cbNotification = new cbNotification; $subject "Profile update for username: " .$my->username."user id: " .$my->id; $message "Company: ".$rowExtras->company." City: ".$rowExtras->city//etc, add all your fields to your message that you got earlier off the screen in the form  $rowExtras-><em>value</em> such as $rowExtras->city  $cbNotification->sendToModerators($subject$message);



Now take out the line of code: var_dump($rowExtras); that we added.

Also DON'T forget to uncomment the line cbRedirectToProfile($uid, _USER_DETAILS_SAVE);
otherwise your page won't redirect anymore.

Now when there is any change of details your moderators will get an email with all the details you add to $message.

Post edited by: Samurai9, at: 2008/09/15 10:44

Post edited by: Samurai9, at: 2008/09/15 10:48

Post edited by: Samurai9, at: 2008/09/15 10:51
Click here to see the profile of this user The administrator has disabled public write access.

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login