-
Hi All,
I think the Activity Stream is one of the most powerful features of userpro, and really like how it shows information from various sources. (for example, when I create a new page, post, bbpress comment, etc)
But how would I add activity to this stream if it’s not being found by default? I’m using SabaiDirectory, and want the published listings to show up in the activity stream. I assume it is easy to do, even though these front end listings do not create custom post types.
Any suggestions on which files/where to edit? Thanks very much.
Are there any suggestions here? Just looking how or add user activity from another plugin to the activity stream. Thx.
It kinda depends on what you are trying to do and how comfortable you are with PHP. The feed itself is filterable…
userpro_public_activity_filter
for the public feed, anduserpro_private_activity_filter
for the private. The aforementioned filters allow you to modify the feed itself before it is displayed. However, this requires processing the additions each time the feed is displayed, and as such is more memory intensive than you may like, depending on use case. The activity feed itself is processed from a stored activity log. Ideally, you would want to add log entries to this log, but this method is much more complicated. Adding log entries of types which are unsupported is easier said than done, but it is possible.Thank you very much for your reply. We have a developer who is very good with php, so if a bit complex that wouldn’t scare us off.
So seems not as much about filtering for us as we want to add a non standard wp items. Sabai directory the above mentioned plugins keeps listings in it’s own db table. From what you say here, it looks like we need to add the log entries.
Are you able to give a brief summary of how or where this is found for us to pass onto our developer?
Thank you
I think you’re misunderstanding the word ‘filter’. In WordPress, a filter isn’t necessarily ‘removing’ something like it’s seen in the traditional sense. Rather, it’s a type of hook that allows modification of a given variable.
Yes, this is a VERY simplistic example, but running this function will append a single status item displaying nothing but ‘Hi there!’ to the activity stream for the user with ID 1. Hopefully that makes sense, and I apologize for the ridiculous way of displaying it, but the bbPress code formatting kinda sucks…
Thank you. I’ll get our developer to check this out and get back to you. Very appreciative for your assistance 🙂
Hi,
I’d like to add the response from our developer verbatim here. Wondering if you could help shine some light as to why our activity isn’t displaying? Thanks again:
“I’ve read this thread thoroughly. They are correct in saying we need to add the activity log to the DB table where it is stored.
And, this is exactly what I’ve done. If you read my emails, I clearly state that the codes are all in place for this. The Sabai listings create an activity log and it is already being added to the db table where the other activities are stored.
There is nothing else to do to get this to happen. I have done the hard work here.
The problem is, the sabai activity is not displaying. I don’t know why.All that other stuff they are explaining is a workaround hack that stuffs our listings into the the output.
It is not efficient at all.So, update them that we are getting the logs in the activity table. The system is just not displaying it.”
Hehe… I did say that the filter wasn’t the efficient way. As for why it’s not displaying, I couldn’t tell you. Is the data being stored in the correct format? I ran a quick test on my local copy and it worked fine, but the logging system isn’t really intended to be used externally, so documentation is a bit scarce. I’d also like to point out that I’m not a UserPro developer, just another user who happens to be a professional WordPress developer who likes to help out with plugins that are worthwhile… getting feedback from the official UserPro staff on this might be beneficial.
Hi there,
Really appreciate your assistance. Especially as you aren’t a User Pro developer.
Totally agree that it would be awesome to get assistance from a User Pro developer, but they just don’t seem to want to answer this query.
Any tips or anything to show us what the correct format to store the data in?
Try
$activity[$user_id][$timestamp] = array( 'user_id' => $user_id, 'status' => $status );
Our developer said he has the right format. Racking our brains to what else it could be
Hello All,
I’m the developer trying to resolve this issue. What I’ve done is followed the format of previous activities and created new entries once a new listing has been added to the system.
The problem is, the new activity shows up in the database, but not on the site. Here is a visual:
and here is what’s in the userpro_activity field. Can someone please help us resolve this. I’ve tried character encoding and didnt help. Not sure what else could be wrong.
PHP1234567891011121314151617181920212223242526272829303132333435363738394041a:1:{i:256;a:2:{i:1397590671;a:3:{s:7:"user_id";s:3:"256";s:6:"status";s:876:"<divclass="userpro-sc-img" data-key="profilepicture"><ahref="http://test.massmosaic.com/profile/DemoAdmin/"><imgsrc="http://test.massmosaic.com/wp-content/plugins/userpro/img/default_avatar_male.jpg"width="50" height="50" alt="" class="default avatar"/></a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><ahref="http://test.massmosaic.com/profile/DemoAdmin/"title="View Profile">DemoAdmin</a><span class="userpro-badges"><img class="userpro-profile-badge userpro-profile-badge-online userpro-hide-from-list"src="http://test.massmosaic.com/wp-content/plugins/userpro/img/badges/online.png" alt=""title="User is online :)" /></span><span class="userpro-sc-i-info">has started following <ahref="http://test.massmosaic.com/profile/eric/">EricDoriean</a></span></div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>";s:9:"timestamp";i:1397590671;}i:1397591282;a:2:{s:6:"userid";s:3:"256";s:6:"status";s:908:"<divclass="userpro-sc-img" data-key="profilepicture"><ahref="http://test.massmosaic.com/profile/DemoAdmin/"><imgsrc="http://test.massmosaic.com/wp-content/plugins/userpro/img/default_avatar_male.jpg"width="50" height="50" alt="" class="default avatar"/></a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><ahref="http://test.massmosaic.com/profile/DemoAdmin/"title="View Profile">DemoAdmin</a><span class="userpro-badges"><img class="userpro-profile-badge userpro-hide-from-list" src="http://test.massmosaic.com/wp-content/plugins/userpro/img/badges/online.png" alt=""title="User is online :)" /></span><span class="userpro-sc-i-info">has just added a new <ahref="http://test.massmosaic.com/profile/DemoAdmin/needs">need</a> for exchange by Barter. This is a listing byAnwar</span></div><div class="userpro-sc-i-time">15 Apr 201407:48:02</div></div><div class="userpro-clear"></div>";}}}
You must be logged in to reply to this topic.