Difference between revisions of "OnCommunityStreamRender"

(Created page with "{{alert|<center>'''Since JomSocial 2.8'''</center>|alert-danger}}")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{alert|<center>'''Since JomSocial 2.8'''</center>|alert-danger}}
 
{{alert|<center>'''Since JomSocial 2.8'''</center>|alert-danger}}
 +
{{alert|<center>'''Note:''' This article is still work in progress</center>|alert}}
 +
 +
Used in the standard community plugin to gather data for creating activity stream item<br/>
 +
More information and full guide can be [[Stream API v2|seen here]]
 +
 +
====Example====
 +
<syntaxhighlight lang="php">
 +
    class plgCommunityExample extends CApplications
 +
    {
 +
    public function onCommunityStreamRender($act)
 +
    {
 +
    $actor = CFactory::getUser($act->actor);
 +
   
 +
    $stream = new stdClass();
 +
    $stream->actor = $actor;
 +
    $stream->headline = 'Headline';
 +
    $stream->message = 'Message';
 +
    return $stream;
 +
    }
 +
    }
 +
</syntaxhighlight>
 +
<br />

Latest revision as of 22:27, 24 April 2013

Since JomSocial 2.8
Note: This article is still work in progress

Used in the standard community plugin to gather data for creating activity stream item
More information and full guide can be seen here

Example

    class plgCommunityExample extends CApplications
    {
    public function onCommunityStreamRender($act)
    {
    $actor = CFactory::getUser($act->actor);
 
    $stream = new stdClass();
    $stream->actor = $actor;
    $stream->headline = 'Headline';
    $stream->message = 'Message';
    return $stream;
    }
    }