Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1.     function streamPost($act, $params, $options = array())
  2.     {
  3.         $stream = Foundry::stream();
  4.  
  5.         $tmpl  = $stream->getTemplate();
  6.  
  7.         $title = Sanitize::getString($act,'title');
  8.  
  9.         $content = Sanitize::getString($act,'content');
  10.  
  11.         $tmpl->setTitle($title);
  12.  
  13.         $tmpl->setContent($content);
  14.  
  15.         // $tmpl->setParams($params);
  16.  
  17.         $tmpl->setActor($act['actor'] , SOCIAL_TYPE_USER);
  18.  
  19.         $tmpl->setContext($act['context_id'], $act['context'], $params);
  20.  
  21.         $tmpl->setType($act['type']); // full | mini
  22.  
  23.         if(Sanitize::getInt($act,'target')) {
  24.  
  25.             $tmpl->setTarget($act['target']);
  26.         }
  27.  
  28.         $tmpl->setVerb($act['verb']);
  29.  
  30.         // Process options
  31.         if(Sanitize::getInt($options,'aggregate')) {
  32.  
  33.             $tmpl->setAggregate(true, true);
  34.         }
  35.  
  36.         $tmpl->setPublicStream( 'story.view' );
  37.  
  38.         $stream->add($tmpl);
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement