vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   how to make an activity list with php (https://vborg.vbsupport.ru/showthread.php?t=321278)

bradthor 12-31-2015 06:10 PM

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

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

1 Attachment(s)
Your "activitystreamtype" table should look like this:

https://vborg.vbsupport.ru/attachmen...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

Quote:

Originally Posted by bradthor (Post 2561529)
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

Quote:

Originally Posted by MarkFL (Post 2561534)
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

Quote:

Originally Posted by MarkFL (Post 2561534)
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.


All times are GMT. The time now is 02:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01001 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete