I have a use case regarding CB activity and CB auto action which I'm currently not able to solve.
Assuming I'm a Super user and I edit the profile of another user, I want to show in the CB activity tab that I - the super user - performed the change. Is this possible? I know how to access the other user's (the one who is edited by me) - e.g. via [user_id] or [username]. But even when I as super user edit the profile, the modified user is the owner (due to the 'wrong' user).
How can I retrieve my user id or name in order show the proper thumbnail on the activity wall?
Editing a users profile data as a moderator is editing them on the users behalf. CB behaves as if the user themselves made the change. The only way to change CB Activity behavior in this case is to edit plugin.cbactivity.php and change the user id stored with the activity, but I don't recommend doing this as it will mess with privacy usage.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
in the plugin.cbactivity.php, I adapted the code as follows:
Code:
public function onAfterUserUpdate( $user, $userDuplicate, $oldUser ) {
// [...]
$me =& JFactory::getUser();
$uid= $me->get('id');
// [...]
$activity->set( 'user_id', (int) $uid);
// I also tried this in addition:
// $activity->set( 'user', (int) $uid);
// [...]
$activity->store();
}
Upon debugging, I see, that my (i.e. the super user's ID) is there, but it has no effect on the activity tab. There's still the other user shown. In both cases (setting user_id / setting user_id + user), on the activity wall the thumbnail and name of the other user are shown, in the Activity Plugin, this other user is listed as Owner. Did I miss anything?
That change does nothing for existing activity. That change will only affect new activity and it's not going to output correctly like that. It's going to say the admins profile changed instead of the users profile changed. Sorry, but we do not help with core edits so I can not advise you on code changes.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.