Looking at the Installation section of the
Social Stream docs, it looks like it assumes that you can put PHP code anywhere on your site and have it execute. In MODX, PHP code in a resource will not execute, so you'd have to convert all those separate PHP code examples to separate snippets and put a snippet tag on the page (or in the case of the first one, at the top of all Templates).
It does look like it should work, though. Notice that I've removed the PHP opening and closing tags.
Edit the Social Stream config file as described in the docs.
Put this as the very first line of all templates for pages that will display Social Stream stuff:
Create a snippet called IncludeSocialStream, with this single line of code (assumes that the social-stream.php file is at assets/components/social-stream/social-stream.php):
require_once MODX_ASSETS_PATH . 'components/social-stream/social-stream.php'; // Path to PHP Social Stream main file
Create another snippet called SocialStream with this code (notice that 'echo' has been replaced with 'return'):
return social_stream(
array(
'id' => '1',
'type' => 'wall',
'network' => array(
'facebook' => array(
'facebook_id_1' => array(
'624290390999239' // Replace with your Facebook page ID
),
'facebook_pagefeed' => 'posts'
),
'twitter' => array(
'twitter_id_1' => array(
'mashable' // Replace with your Twitter username
),
'twitter_images' => 'small',
'twitter_feeds' => 'retweets,replies'
),
'google' => array(
'google_id_1' => array(
'112592709425670873637' // Replace with your Google+ profile ID
)
),
'tumblr' => array(
'tumblr_id_1' => array(
'ghostphotographs' // Replace with your Tumblr username
)
),
'pinterest' => array(
'pinterest_id_1' => array(
'2013TopPins' // Replace with your Pinterest username
)
)
),
'theme' => 'sb-modern-light',
'itemwidth' => 250,
'results' => 30,
'debuglog' => 0,
'add_files' => true
)
);
Put this tag where you want the output:
[ed. note: BobRay last edited this post 6 years, 6 months ago.]