By adrien on Saturday, 24 December 2016
Replies 4
Likes 0
Views 575
Votes 0
Hello dear StackIdeas Team,

Some Geommunity users requested that we integrate the located Stream to our EasySocial content Google Maps
I just had a look at the doc for retreiving streams
https://stackideas.com/docs/easysocial/developers/stream/retrieving-streams

I just wonder if there is a method for retriving one stream from its stream ID.
I would use it to poulate the stream marker infowindow.
If not, I'll query the tables. Just asking before reinventing the wheel

Thanks for the tip if any, and have a Merry Christmas !
Hello Adrien,

The ideal way to retrieve a single stream item is to utilize the following method,

[gist]
$stream = ES::stream();
$item = $stream->getItem($id, $cluster_id, $cluster_type, false, array('perspective' => 'dashboard'));

// Result will be false if the user has no permissions to view or stream doesn't exist
if ($item === false) {
return;
}

var_dump($item);
[/gist]
·
Saturday, 24 December 2016 15:46
·
0 Likes
·
0 Votes
·
0 Comments
·
By the way, Merry Christmas and Happy Holidays on behalf of the team!
·
Saturday, 24 December 2016 15:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Thanks for the light speed reply (again) and for the nice wishes

I must be doing something wrong.
I'm requiring the easysocial.php correctly (working to get avatar)

but for the $stream->getItem options , I'm at lost:
I have the stream item ID, but I don't have a cluster ID or type.
The stream is mostly a story and not part of a cluster, so I tryed setting both clusterid and type as null, but no luck.
Is there a file I could investigate to get the options uses ?
·
Saturday, 24 December 2016 19:31
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Adrien,

Cluster id and type are particularly used to only identify group / event / page and it's id. If you only have the stream id, then just calling this would do:

[gist]
$stream = ES::stream();
$item = $stream->getItem($id);
[/gist]
·
Saturday, 24 December 2016 19:49
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post