• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SocialAppItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中SocialAppItem的典型用法代码示例。如果您正苦于以下问题:PHP SocialAppItem类的具体用法?PHP SocialAppItem怎么用?PHP SocialAppItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SocialAppItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: onPrepareStream

 public function onPrepareStream(SocialStreamItem &$stream, $includePrivacy = true)
 {
     if ($stream->context != 'relationship') {
         return;
     }
     $params = $this->getParams();
     if (!$params->get('stream_approve', true)) {
         return;
     }
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($includePrivacy && !$privacy->validate('core.view', $stream->contextId, 'relationship', $stream->actor->id)) {
         return;
     }
     $stream->color = '#DC554F';
     $stream->fonticon = 'ies-heart';
     $stream->label = JText::_('APP_USER_RELATIONSHIP_STREAM_TOOLTIP');
     $stream->display = SOCIAL_STREAM_DISPLAY_FULL;
     $registry = FD::registry($stream->params);
     $this->set('type', $registry->get('type'));
     $this->set('actor', $stream->actor);
     $this->set('target', $stream->targets[0]);
     $stream->title = parent::display('streams/' . $stream->verb . '.title');
     if ($includePrivacy) {
         $stream->privacy = $privacy->form($stream->contextId, 'relationship', $stream->actor->id, 'core.view', false, $stream->uid);
     }
     return true;
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:28,代码来源:relationship.php


示例2: __construct

 /**
  * Class constructor.
  *
  * @since 1.0
  * @access public
  */
 public function __construct()
 {
     // Load language file for plugin
     $lang = JFactory::getLanguage();
     $lang->load('plg_app_user_q2c_boughtproducts', JPATH_ADMINISTRATOR);
     parent::__construct();
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:13,代码来源:q2c_boughtproducts.php


示例3: __construct

 /**
  * Class constructor.
  *
  * @since  1.0
  * @access  public
  * @param   array  return all html code of layout.
  */
 public function __construct($options = array())
 {
     // Load language file for plugin
     $lang = JFactory::getLanguage();
     $lang->load('plg_app_user_q2cMyProducts', JPATH_ADMINISTRATOR);
     require_once JPATH_SITE . '/components/com_quick2cart/helper.php';
     parent::__construct($options);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:15,代码来源:q2cMyProducts.php


示例4: onPrepareStream

 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     // We only want to process related items
     if ($item->cluster_type !== SOCIAL_TYPE_EVENT || empty($item->cluster_id)) {
         return;
     }
     // Context are split into events and nodes
     // "events" context are stream items that are related to event item
     // "guests" context are stream items that are related to guests of the event
     // Only process "events" context here
     // "guests" context are processed in the app/event/guests app
     if ($item->context !== 'events') {
         return;
     }
     $event = FD::event($item->cluster_id);
     // Only show Social sharing in public group
     if (!$event->isOpen()) {
         $item->sharing = false;
     }
     if (!$event->canViewItem()) {
         return;
     }
     if (!$this->getParams()->get('stream_' . $item->verb, true)) {
         return;
     }
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#f06050';
     $item->fonticon = 'ies-calendar';
     $item->label = FD::_('APP_EVENT_EVENTS_STREAM_TOOLTIP', true);
     $actor = $item->actor;
     $this->set('event', $event);
     $this->set('actor', $actor);
     // streams/create.title
     // streams/feature.title
     // streams/update.title
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = '';
     if ($event->isGroupEvent()) {
         $this->set('group', $event->getGroup());
         $item->content = parent::display('streams/content');
     }
     // APP_EVENT_EVENTS_STREAM_OPENGRAPH_UPDATE
     // APP_EVENT_EVENTS_STREAM_OPENGRAPH_CREATE
     // APP_EVENT_EVENTS_STREAM_OPENGRAPH_FEATURE
     $item->opengraph->addDescription(JText::sprintf('APP_EVENT_EVENTS_STREAM_OPENGRAPH_' . strtoupper($item->verb), $actor->getName(), $event->getName()));
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:46,代码来源:events.php


示例5: onPrepareStream

 /**
  * Prepares the stream items for mosets tree
  *
  * @since   1.3
  * @access  public
  * @param   string
  * @return  
  */
 public function onPrepareStream(SocialStreamItem &$stream, $includePrivacy = true)
 {
     if (!$this->exists() || $stream->context != 'mtree') {
         return;
     }
     // Decorate the stream
     $stream->display = SOCIAL_STREAM_DISPLAY_FULL;
     $stream->color = '#6f90b5';
     $stream->fonticon = 'ies-comments-2';
     $stream->label = JText::_('APP_USER_MTREE_STREAM_LABEL');
     // Get the link object
     $db = JFactory::getDbo();
     $link = new mtLinks($db);
     $link->load($stream->contextId);
     $this->decorate($link);
     $this->set('actor', $stream->actor);
     $this->set('link', $link);
     $stream->title = parent::display('streams/title');
     $stream->content = parent::display('streams/content');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:28,代码来源:mtree.php


示例6: onPrepareActivityLog

 /**
  * Responsible to generate the activity logs.
  *
  * @since    1.0
  * @access    public
  * @param    object    $params        A standard object with key / value binding.
  *
  * @return    none
  */
 public function onPrepareActivityLog(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'links') {
         return;
     }
     //get story object, in this case, is the stream_item
     $tbl = FD::table('StreamItem');
     $tbl->load($item->uid);
     // item->uid is now streamitem.id
     $uid = $tbl->uid;
     //get story object, in this case, is the stream_item
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     $actor = $item->actor;
     $target = count($item->targets) > 0 ? $item->targets[0] : '';
     $assets = $item->getAssets($uid);
     if (empty($assets)) {
         return;
     }
     $assets = $assets[0];
     $this->set('assets', $assets);
     $this->set('actor', $actor);
     $this->set('target', $target);
     $this->set('stream', $item);
     $item->display = SOCIAL_STREAM_DISPLAY_MINI;
     $item->title = parent::display('logs/' . $item->verb);
     return true;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:37,代码来源:links.php


示例7: prepareCreateMilestoneStream

 public function prepareCreateMilestoneStream(SocialStreamItem $streamItem, $includePrivacy = true)
 {
     $params = FD::registry($streamItem->params);
     $milestone = FD::table('Milestone');
     $milestone->bind($params->get('milestone'));
     // Get the group data
     FD::load('event');
     $event = new SocialEvent();
     $event->bind($params->get('event'));
     // Get the actor
     $actor = $streamItem->actor;
     $app = $this->getApp();
     $permalink = FRoute::apps(array('layout' => 'canvas', 'customView' => 'item', 'uid' => $event->getAlias(), 'type' => SOCIAL_TYPE_EVENT, 'id' => $app->getAlias(), 'milestoneId' => $milestone->id));
     $this->set('permalink', $permalink);
     $this->set('milestone', $milestone);
     $this->set('actor', $actor);
     $this->set('event', $event);
     $streamItem->title = parent::display('streams/create.milestone.title');
     $streamItem->content = parent::display('streams/create.milestone.content');
     $streamItem->opengraph->addDescription(JText::sprintf('APP_EVENT_TASKS_STREAM_OPENGRAPH_CREATE_MILESTONE', $streamItem->actor->getName(), $event->getName()));
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:21,代码来源:tasks.php


示例8: onPrepareStream

 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context !== 'feeds') {
         return;
     }
     // Get app params
     $params = $this->getParams();
     if (!$params->get('stream_create', true)) {
         return;
     }
     // Get the feed table
     $obj = FD::makeObject($item->params);
     $feed = $this->getTable('Feed');
     $feed->bind($obj);
     $actor = $item->actor;
     $app = $this->getApp();
     $this->set('app', $app);
     $this->set('feed', $feed);
     $this->set('actor', $actor);
     $item->color = '#e67e22';
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->fonticon = 'ies-feed';
     $item->label = FD::_('APP_USER_FEED_STREAM_TOOLTIP', true);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = parent::display('streams/' . $item->verb . '.content');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:34,代码来源:feeds.php


示例9: onPrepareStream

 /**
  * Triggered to prepare the stream item
  *
  * @since   1.0
  * @access  public
  * @param   string
  * @return
  */
 public function onPrepareStream(SocialStreamItem &$item)
 {
     // If this is not it's context, we don't want to do anything here.
     if ($item->context != 'story') {
         return;
     }
     // Get the event object
     $group = $item->getCluster();
     if (!$group) {
         return;
     }
     if (!$group->canViewItem()) {
         return;
     }
     // Allow editing of the stream item
     $item->editable = $this->my->isSiteAdmin() || $group->isAdmin() || $item->actor->id == $this->my->id;
     // Get the actor
     $actor = $item->getActor();
     // Decorate the stream
     $item->fonticon = 'ies-pencil-2';
     $item->color = '#6E9545';
     $item->label = FD::_('APP_GROUP_STORY_STREAM_TOOLTIP', true);
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $this->set('group', $group);
     $this->set('actor', $actor);
     $this->set('stream', $item);
     $item->title = parent::display('streams/title.' . $item->verb);
     $item->content = parent::display('streams/content.' . $item->verb);
     // Apply likes on the stream
     $likes = FD::likes();
     $likes->get($item->uid, $item->context, $item->verb, SOCIAL_APPS_GROUP_GROUP, $item->uid);
     $item->likes = $likes;
     // If this update is posted in a group, the comments should be linked to the group item
     $comments = FD::comments($item->uid, $item->context, $item->verb, SOCIAL_APPS_GROUP_GROUP, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $item->uid))), $item->uid);
     $item->comments = $comments;
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:45,代码来源:story.php


示例10: onPrepareStream

 /**
  * Responsible to generate the stream contents.
  *
  * @since	1.0
  * @access	public
  * @param	object	$params		A standard object with key / value binding.
  *
  * @return	none
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'friends') {
         return;
     }
     // Determines if the stream should be generated
     $params = $this->getParams();
     if (!$params->get('stream_friends', true)) {
         return;
     }
     // Get the actor
     $actor = $item->actor;
     // check if the actor is ESAD profile or not, if yes, we skip the rendering.
     if (!$actor->hasCommunityAccess()) {
         $item->title = '';
         return;
     }
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($includePrivacy) {
         if (!$privacy->validate('core.view', $item->contextId, 'friends', $item->actor->id)) {
             return;
         }
     }
     // Get the context id.
     $id = $item->contextId;
     // no target. this could be data error. ignore this item.
     if (!$item->targets) {
         return;
     }
     // Receiving actor.
     $target = $item->targets[0];
     // Get the current id.
     $id = JRequest::getInt('id');
     // Decorate the stream
     $item->display = SOCIAL_STREAM_DISPLAY_MINI;
     $item->color = '#7AD7EE';
     $item->fonticon = 'ies-user';
     $item->label = FD::_('APP_USER_FRIENDS_STREAM_TOOLTIP', true);
     // Apply likes on the stream
     $likes = FD::likes();
     $likes->get($item->contextId, $item->context, $item->verb, SOCIAL_APPS_GROUP_USER, $item->uid);
     $item->likes = $likes;
     $this->set('actor', $actor);
     $this->set('target', $target);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     if ($includePrivacy) {
         $item->privacy = $privacy->form($item->contextId, 'friends', $item->actor->id, 'core.view', false, $item->uid);
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:60,代码来源:friends.php


示例11: prepareReadArticleStream

 /**
  * Prepares the stream item when an article is being read
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream item.
  * @return
  */
 private function prepareReadArticleStream(&$item)
 {
     // Load up the article dataset
     $article = JTable::getInstance('Content');
     $article->load($item->contextId);
     // Load up the category dataset
     $category = JTable::getInstance('Category');
     $category->load($article->catid);
     // Get the actor
     $actor = $item->actor;
     // Get the permalink
     $permalink = ContentHelperRoute::getArticleRoute($article->id . ':' . $article->alias, $article->catid . ':' . $category->alias);
     // Get the creation date
     $date = FD::date($article->created);
     // Get the category permalink
     $categoryPermalink = ContentHelperRoute::getCategoryRoute($category->id . ':' . $category->alias);
     // Get the content
     $content = $article->introtext;
     if (empty($content)) {
         $content = $article->fulltext;
     }
     $this->set('content', $content);
     $this->set('categoryPermalink', $categoryPermalink);
     $this->set('date', $date);
     $this->set('permalink', $permalink);
     $this->set('article', $article);
     $this->set('category', $category);
     $this->set('actor', $actor);
     // Load up the contents now.
     $item->title = parent::display('streams/read.title');
     $item->content = parent::display('streams/read.content');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:40,代码来源:ajax.php


示例12: onPrepareStream

 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context !== 'feeds') {
         return;
     }
     // Get app params
     $params = $this->getParams();
     if (!$params->get('stream_create', true)) {
         return;
     }
     // Get the feed table
     $rss = FD::table('Rss');
     $rss->load($item->contextId);
     if (!$rss->id || !$item->contextId) {
         return;
     }
     $group = FD::group($item->cluster_id);
     $actor = $item->actor;
     $app = $this->getApp();
     $this->set('app', $app);
     $this->set('rss', $rss);
     $this->set('actor', $actor);
     $this->set('group', $group);
     $item->color = '#e67e22';
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->fonticon = 'ies-feed';
     $item->label = JText::_('APP_USER_FEED_STREAM_TOOLTIP');
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = parent::display('streams/' . $item->verb . '.content');
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:38,代码来源:feeds.php


示例13: prepareCreateMilestoneStream

 public function prepareCreateMilestoneStream(SocialStreamItem $item, $includePrivacy = true)
 {
     $params = FD::registry($item->params);
     $milestone = FD::table('Milestone');
     $milestone->bind($params->get('milestone'));
     // Get the group data
     FD::load('group');
     $group = new SocialGroup();
     $group->bind($params->get('group'));
     // Get the actor
     $actor = $item->actor;
     $app = $this->getApp();
     $permalink = FRoute::apps(array('layout' => 'canvas', 'customView' => 'item', 'uid' => $group->getAlias(), 'type' => SOCIAL_TYPE_GROUP, 'id' => $app->getAlias(), 'milestoneId' => $milestone->id));
     $this->set('permalink', $permalink);
     $this->set('milestone', $milestone);
     $this->set('actor', $actor);
     $this->set('group', $group);
     $item->title = parent::display('streams/create.milestone.title');
     $item->content = parent::display('streams/create.milestone.content');
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:20,代码来源:tasks.php


示例14: onPrepareStream

 /**
  * Responsible to generate the stream contents.
  *
  * @since	1.0
  * @access	public
  * @param	object	$params		A standard object with key / value binding.
  *
  * @return	none
  */
 public function onPrepareStream(SocialStreamItem &$item)
 {
     // Load up the config object
     $config = FD::config();
     if ($item->context != 'badges' || !$config->get('badges.enabled')) {
         return;
     }
     // Check if the app should be able to generate the stream.
     $params = $this->getParams();
     if (!$params->get('stream_achieved', true)) {
         return;
     }
     // Get the actor
     $actor = $item->actor;
     // check if the actor is ESAD profile or not, if yes, we skip the rendering.
     if (!$actor->hasCommunityAccess()) {
         $item->title = '';
         return;
     }
     // Test if stream item is allowed
     if (!$this->onStreamValidatePrivacy($item)) {
         return;
     }
     // Try to get the badge object from the params
     $raw = $item->params;
     $badge = FD::table('Badge');
     $badge->load($item->contextId);
     // lets load 3rd party component's language file if this is not a core badge
     if ($badge->extension && $badge->extension != 'com_easysocial') {
         Foundry::language()->load($badge->extension, JPATH_ROOT);
     }
     // Set the display mode to be full.
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#FEBC9D';
     $item->fonticon = 'ies-crown';
     $item->label = FD::_('APP_USER_BADGES_STREAM_TOOLTIP', true);
     // Format the likes for the stream
     $likes = FD::likes();
     $likes->get($item->contextId, $item->context, $item->verb . '.' . $item->actor->id, SOCIAL_APPS_GROUP_USER, $item->uid);
     $item->likes = $likes;
     // Apply comments on the stream
     $comments = FD::comments($item->contextId, $item->context, $item->verb . '.' . $item->actor->id, SOCIAL_APPS_GROUP_USER, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $item->uid))), $item->uid);
     $item->comments = $comments;
     $this->set('badge', $badge);
     $this->set('actor', $actor);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = parent::display('streams/' . $item->verb . '.content');
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:58,代码来源:badges.php


示例15: prepareCreateStream

 private function prepareCreateStream(SocialStreamItem &$item, SocialGroup $group)
 {
     // We want a full display for group creation.
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     // Get the actor.
     $actor = $item->actor;
     $this->set('group', $group);
     $this->set('actor', $actor);
     $item->title = parent::display('streams/create.title');
     $item->content = parent::display('streams/content');
     $item->opengraph->addDescription(JText::sprintf('APP_USER_GROUPS_STREAM_CREATED_GROUP', $actor->getName(), $group->getName()));
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:12,代码来源:groups.php


示例16: onPrepareStream

 /**
  * Responsible to generate the stream contents.
  *
  * @since	1.0
  * @access	public
  * @param	object	$params		A standard object with key / value binding.
  *
  * @return	none
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != SOCIAL_TYPE_FOLLOWERS) {
         return;
     }
     // Check if the app should be able to generate the stream.
     $params = $this->getParams();
     if (!$params->get('stream_follow', true)) {
         return;
     }
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($includePrivacy) {
         if (!$privacy->validate('followers.view', $item->contextId, SOCIAL_TYPE_FOLLOWERS, $item->actor->id)) {
             return;
         }
     }
     $item->display = SOCIAL_STREAM_DISPLAY_MINI;
     $item->color = '#415457';
     $item->fonticon = 'ies-tree-view';
     $item->label = JText::_('APP_USER_FOLLOWERS_STREAM_TOOLTIP');
     // Get the context id.
     $id = $item->contextId;
     // Get the target.
     $table = FD::table('Subscription');
     $table->load($id);
     // Get the actor
     $actor = $item->actor;
     // Receiving actor.
     $target = FD::user($table->uid);
     // Get the current id.
     $id = JRequest::getInt('id');
     $this->set('actor', $actor);
     $this->set('target', $target);
     // User A following user B
     if ($item->verb == 'follow') {
         $item->title = parent::display('streams/' . $item->verb . '.title');
     }
     $item->opengraph->addDescription($item->title);
     if ($includePrivacy) {
         $item->privacy = $privacy->form($id, SOCIAL_TYPE_FOLLOWERS, $item->actor->id, 'followers.view', false, $item->uid);
     }
     return true;
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:53,代码来源:followers.php


示例17: processTaskStream

 private function processTaskStream(SocialStreamItem &$item, $includePrivacy)
 {
     $app = FD::table('App');
     $app->load(array('group' => SOCIAL_TYPE_EVENT, 'type' => SOCIAL_TYPE_APPS, 'element' => 'tasks'));
     $event = FD::event($item->cluster_id);
     $params = FD::registry($item->params);
     // Get the milestone
     $milestone = FD::table('Milestone');
     $milestone->bind($params->get('milestone'));
     $permalink = FRoute::apps(array('layout' => 'canvas', 'customView' => 'item', 'uid' => $event->getAlias(), 'type' => SOCIAL_TYPE_EVENT, 'id' => $app->getAlias(), 'milestoneId' => $milestone->id));
     // Do not allow reposting on milestone items
     $item->repost = false;
     if ($item->verb == 'createTask') {
         $items = $params->get('tasks');
         $tasks = array();
         foreach ($items as $i) {
             $task = FD::table('Task');
             // We don't do bind here because we need to latest state from the database
             // THe cached params might be an old data.
             $task->load($i->id);
             $tasks[] = $task;
         }
         $this->set('tasks', $tasks);
         $this->set('total', count($tasks));
     }
     $this->set('event', $event);
     $this->set('stream', $item);
     $this->set('milestone', $milestone);
     $this->set('permalink', $permalink);
     $this->set('actor', $item->actor);
     // streams/tasks/createTask.title
     // streams/tasks/createTask.content
     // streams/tasks/createMilestone.title
     // streams/tasks/createMilestone.content
     $item->title = parent::display('streams/tasks/' . $item->verb . '.title');
     $item->content = parent::display('streams/tasks/' . $item->verb . '.content');
     if ($item->verb === 'createMilestone') {
         $item->opengraph->addDescription(JText::sprintf('APP_USER_EVENTS_TASKS_STREAM_OPENGRAPH_CREATED_MILESTONE', $item->actor->getName(), $milestone->title, $event->getName()));
     }
     if ($item->verb === 'createTask') {
         $item->opengraph->addDescription(JText::sprintf(FD::string()->computeNoun('APP_USER_EVENTS_TASKS_STREAM_OPENGRAPH_ADDED_TASK', count($tasks)), $item->actor->getName(), count($tasks), $milestone->title, $event->getName()));
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:43,代码来源:events.php


示例18: prepareLoginStream

 private function prepareLoginStream(SocialStreamItem &$item)
 {
     $params = $this->getParams();
     // Check if the settings is enabled.
     if (!$params->get('stream_login', false)) {
         $item->title = '';
         return;
     }
     // Decorate the stream
     $item->color = '#EF9033';
     $item->fonticon = 'ies-locked';
     $item->label = FD::_('APP_USER_USERS_LOGIN_STREAM_TOOLTIP', true);
     $item->display = SOCIAL_STREAM_DISPLAY_MINI;
     // Set the actor
     $actor = $item->actor;
     // check if actor is an ESAD user, if yes, do not render the stream.
     if (!$actor->hasCommunityAccess()) {
         $item->title = '';
         return;
     }
     $this->set('actor', $actor);
     $item->title = parent::display('streams/login.title');
     if (isset($item->opengraph) && $item->opengraph instanceof SocialOpengraph) {
         $item->opengraph->addDescription($item->title);
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:26,代码来源:users.php


示例19: prepareUploadedStream

 /**
  * Prepares the stream item for new file uploads
  *
  * @since    1.0
  * @access    public
  * @param    SocialStreamItem    The stream item.
  * @return
  */
 private function prepareUploadedStream(&$item)
 {
     $params = FD::registry($item->params);
     // Load up the event object
     $event = FD::event($params->get('event')->id);
     // Do not allow user to repost files
     $item->repost = false;
     // Get the file object
     $file = FD::table('File');
     $file->load($params->get('file')->id);
     if (!$file->id) {
         return;
     }
     // Get the actor
     $actor = $item->actor;
     $this->set('actor', $actor);
     $this->set('file', $file);
     $this->set('event', $event);
     // Load up the contents now.
     $item->title = parent::display('streams/uploaded.title');
     $item->content = parent::display('streams/uploaded.content');
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:30,代码来源:files.php


示例20: onPrepareActivityLog

 /**
  * Prepares the activity log item
  *
  * @since	1.2
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareActivityLog(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'kunena') {
         return;
     }
     // Test if Kunena exists;
     if (!$this->exists()) {
         return;
     }
     // Get the context id.
     $actor = $item->actor;
     $topic = KunenaForumTopicHelper::get($item->contextId);
     if ($item->verb == 'thanked') {
         $message = KunenaForumMessageHelper::get($item->contextId);
         $topic = $message->getTopic();
         $target = $item->targets[0];
         $this->set('target', $target);
         $this->set('message', $message);
     } else {
         if ($item->verb == 'reply') {
             $message = KunenaForumMessageHelper::get($item->contextId);
             $topic = $message->getTopic();
             $this->set('message', $message);
         }
     }
     $this->set('topic', $topic);
     $this->set('actor', $actor);
     // Load up the contents now.
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = '';
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:39,代码来源:kunena.php



注:本文中的SocialAppItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SocialManager类代码示例发布时间:2022-05-23
下一篇:
PHP Social类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap