Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 31 Dec 2015, 19:10
bradthor bradthor is offline
 
Join Date: Nov 2015
Real name: Brad
how to make an activity list with php

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
Reply With Quote
  #2  
Old 31 Dec 2015, 19:25
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
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.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #3  
Old 31 Dec 2015, 20:08
bradthor bradthor is offline
 
Join Date: Nov 2015
Real name: Brad
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
Reply With Quote
  #4  
Old 31 Dec 2015, 20:21
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Your "activitystreamtype" table should look like this:



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.
Attached Images
File Type: png activitystreamtype.png (19.0 KB, 26 views)
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #5  
Old 31 Dec 2015, 20:41
bradthor bradthor is offline
 
Join Date: Nov 2015
Real name: Brad
Thanks for the reply Mark
Additionally : How would I add an event to activity?
Thanks

Last edited by bradthor; 31 Dec 2015 at 21:08.
Reply With Quote
  #6  
Old 31 Dec 2015, 23:09
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by bradthor View Post
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?
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #7  
Old 31 Dec 2015, 23:15
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Real name: Eric
Originally Posted by MarkFL View Post
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
Reply With Quote
  #8  
Old 02 Jan 2016, 06:23
bradthor bradthor is offline
 
Join Date: Nov 2015
Real name: Brad
Originally Posted by MarkFL View Post
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.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Top Activity List for Activity Modification WetWired vBulletin 3.5 Add-ons 5 31 Oct 2007 21:00



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 07:21.

Layout Options | Width: Wide Color: