View Full Version : how to make an activity list with php
bradthor
12-31-2015, 06:10 PM
I am trying to make an activity list sidebar wth php and sql and I have been trying to find a solution for days now....
I would like for it to contain the same content as the activity stream(activity.php) could anyone advise me on how to structure a query to retrieve activity stream info with the respective format so that I can echo it dynamically in a while or foreach loop.
Thanks a ton in advance
MarkFL
12-31-2015, 06:25 PM
Are you wanting to create a new forum block to contain this information?
I would begin with a query of the "activitystream" table, sorting by dateline in descending order, so that the newest activity is listed first. You will likely want to limit the result to a maximum number of rows.
Then, within a while loop that retrieves each row from the returned array, I would use a switch statement on the typeid to determine which table needs to be queried to get the desired content and base the format of that activity accordingly.
bradthor
12-31-2015, 07:08 PM
Where is the serialized format of each activity type located....eg the text that goes with the values retrieved from the activity stream to make complete sentances?
Thanks
MarkFL
12-31-2015, 07:21 PM
Your "activitystreamtype" table should look like this:
https://vborg.vbsupport.ru/attachment.php?attachmentid=153924&stc=1&d=1451596547
So, when you are retrieving the rows returned by the query of the "activitystream" table, you can base your actions on the "typeid" column. This will indicate which table you need to query to get the content for that activity item.
bradthor
12-31-2015, 07:41 PM
Thanks for the reply Mark
Additionally : How would I add an event to activity?
Thanks
MarkFL
12-31-2015, 10:09 PM
Thanks for the reply Mark
Additionally : How would I add an event to activity?
Thanks
I'm not sure I follow...what kind of event is not showing up in the activity stream?
Dragonsys
12-31-2015, 10:15 PM
I'm not sure I follow...what kind of event is not showing up in the activity stream?
custom plugin data maybe?
I thought I had seen an article on this, but I couldn't find it right now
bradthor
01-02-2016, 05:23 AM
I'm not sure I follow...what kind of event is not showing up in the activity stream?
I wanted to add a custom event to the activity list for example "user has just changed their status", or "user has just changed their profile picture" or "userA has just become friends with userB"
etc.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.