当前位置: 首页>>代码示例>>PHP>>正文


PHP CActivityStream::getHTML方法代码示例

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


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

示例1: _getActivityStream

 private function _getActivityStream()
 {
     $act = new CActivityStream();
     $html = $act->getHTML('', '', null, 0, '', '', true, COMMUNITY_SHOW_ACTIVITY_MORE);
     return $html;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:6,代码来源:activities.php

示例2: repost

 function repost($response, $actId, $from = 'frontpage')
 {
     JPlugin::loadLanguage('plg_activitycomment', JPATH_ADMINISTRATOR);
     $my = CFactory::getUser();
     if ($my->id == 0) {
         $response->addScriptCall('alert', 'NOT ALLOWED');
         return $response->sendResponse();
     }
     $db = JFactory::getDBO();
     $query = 'SELECT * FROM #__community_activities WHERE `id`=' . $db->Quote($actId);
     $db->setQuery($query);
     $activity = $db->loadObject();
     // Add activity logging
     CFactory::load('libraries', 'activities');
     $actor = CFactory::getUser($activity->actor);
     $act = new stdClass();
     $author = '<a href="' . CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id) . '">' . $my->getDisplayName() . '</a>';
     $act->cmd = 'activitycomment.repost';
     $act->actor = $my->id;
     $act->target = 0;
     $act->title = JText::sprintf('%1$s,', $author) . ' ' . $activity->title;
     $act->content = $activity->content;
     $act->app = $activity->app;
     $act->cid = $my->id;
     CActivityStream::add($act);
     $friendsModel =& CFactory::getModel('friends');
     CFactory::load('helpers', 'time');
     $memberSince = cGetDate($my->registerDate);
     $friendIds = $friendsModel->getFriendIds($my->id);
     include_once JPATH_COMPONENT . DS . 'libraries' . DS . 'activities.php';
     $act = new CActivityStream();
     $config = CFactory::getConfig();
     if ($from == 'frontpage') {
         $html = $act->getHTML('', '', null, $config->get('maxacitivities'));
     } else {
         $html = $act->getHTML($my->id, $friendIds, $memberSince, 10);
     }
     $response->addAssign('activity-stream-container', 'innerHTML', $html);
     return $response->sendResponse();
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:40,代码来源:activitycomment.php

示例3: _getActivityStream

 private function _getActivityStream()
 {
     CFactory::load('libraries', 'activities');
     $act = new CActivityStream();
     $html = $act->getHTML('', '', null, 0, '', '', true, COMMUNITY_SHOW_ACTIVITY_MORE);
     return $html;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:7,代码来源:activities.php

示例4: jimport

 /**
  * Return newsfeed html block
  */
 function _getNewsfeedHTML()
 {
     jimport('joomla.utilities.date');
     $mainframe =& JFactory::getApplication();
     $config = CFactory::getConfig();
     $my = CFactory::getUser();
     //$user 			= CFactory::getActiveProfile();
     $userid = JRequest::getVar('userid', $my->id);
     $user = CFactory::getUser($userid);
     $params =& $user->getParams();
     $activities = CFactory::getModel('activities');
     $appModel = CFactory::getModel('apps');
     $friendsModel = CFactory::getModel('friends');
     $html = '';
     $activityLimit = !empty($params) ? $params->get('activityLimit', '') : '';
     if (empty($activityLimit)) {
         $activityLimit = $config->get('maxactivities');
     }
     $memberSince = CTimeHelper::getDate($user->registerDate);
     $friendIds = $friendsModel->getFriendIds($user->id);
     include_once JPATH_COMPONENT . DS . 'libraries' . DS . 'activities.php';
     $act = new CActivityStream();
     return $act->getHTML($user->id, $friendIds, $memberSince, $activityLimit, '', '');
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:27,代码来源:view.html.php

示例5: getActivitiesByFilter

 /**
  *
  * @param type $filter
  * @param type $userId
  * @param type $view
  * @param type $showMore
  * @return type 
  */
 public function getActivitiesByFilter($filter = 'all', $userId = 0, $view = '', $showMore = true)
 {
     $config = CFactory::getConfig();
     $act = new CActivityStream();
     if ($userId == 0) {
         // Legacy code, some module might still use the old code
         $user = CFactory::getRequestUser();
     } else {
         $user = CFactory::getUser($userId);
     }
     jimport('joomla.utilities.date');
     $friendsModel = CFactory::getModel('friends');
     $memberSince = CTimeHelper::getDate($user->registerDate);
     //$friendIds = $friendsModel->getFriendIds($user->id);
     $friendIds = $user->getFriendIds();
     switch ($filter) {
         case "active-profile":
             $target = array($user->id);
             $params =& $user->getParams();
             $actLimit = $view == 'profile' ? $params->get('activityLimit', $config->get('maxactivities')) : $config->get('maxactivities');
             $html = $act->getHTML($user->id, $target, '', $actLimit, $view, '', true, $showMore, null, false, 'active-profile');
             break;
         case "me-and-friends":
             $user =& JFactory::getUser();
             $html = $act->getHTML($user->id, $friendIds, $memberSince, 0, $view, '', true, $showMore, null, false, 'me-and-friends');
             break;
         case "active-user-and-friends":
         case "active-profile-and-friends":
             $params =& $user->getParams();
             $actLimit = $view == 'profile' ? $params->get('activityLimit', $config->get('maxactivities')) : $config->get('maxactivities');
             $html = $act->getHTML($user->id, $friendIds, $memberSince, $actLimit, $view, '', true, $showMore, null, false, 'active-profile-and-friends');
             break;
         case "all":
         default:
             $html = $act->getHTML('', '', null, 0, $view, '', true, $showMore);
             break;
     }
     return $html;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:47,代码来源:activities.php

示例6: getActivitiesByFilter

 /**
  *
  * @param type $filter
  * @param type $userId
  * @param type $view
  * @param type $showMore
  * @return type
  */
 public static function getActivitiesByFilter($filter = 'all', $userId = 0, $view = '', $showMore = true, $filters = array())
 {
     jimport('joomla.utilities.date');
     $config = CFactory::getConfig();
     $act = new CActivityStream();
     if ($userId == 0) {
         // Legacy code, some module might still use the old code
         $user = CFactory::getRequestUser();
     } else {
         $user = CFactory::getUser($userId);
     }
     $memberSince = CTimeHelper::getDate($user->registerDate);
     $friendIds = $user->getFriendIds();
     /**
      * Filter
      * @todo This's applied into the old code we need improve it later
      */
     switch ($filter) {
         case 'photo':
         case 'group':
         case 'status':
         case 'video':
         case 'event':
             //$html = $act->getHTML('', '', null, 0, $view, '', true, $showMore, null, false, 'all', 0);
             break;
         case "active-profile":
             $target = array($user->id);
             $params = $user->getParams();
             $actLimit = $view == 'profile' ? $params->get('activityLimit', $config->get('maxactivities')) : $config->get('maxactivities');
             $html = $act->getHTML($user->id, $target, '', $actLimit, $view, '', true, $showMore, null, false, 'active-profile');
             break;
         case "me-and-friends":
             $user = JFactory::getUser();
             $html = $act->getHTML($user->id, $friendIds, $memberSince, 0, $view, '', true, $showMore, null, false, 'me-and-friends');
             break;
         case "active-user-and-friends":
         case "active-profile-and-friends":
             $params = $user->getParams();
             $actLimit = $view == 'profile' ? $params->get('activityLimit', $config->get('maxactivities')) : $config->get('maxactivities');
             $html = $act->getHTML($user->id, $friendIds, $memberSince, $actLimit, $view, '', true, $showMore, null, false, 'active-profile-and-friends');
             break;
         case "all":
         default:
             $html = $act->getHTML('', '', null, 0, $view, '', true, $showMore, null, false, 'all', 0, $filters);
             break;
     }
     return $html;
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:56,代码来源:activities.php

示例7: showActiveGroup

 /**
  * Show listing of group with the most recent activities
  */
 public function showActiveGroup()
 {
     $groupModel = CFactory::getModel('groups');
     $activityModel = CFactory::getModel('activities');
     $act = new CActivityStream();
     $html = $act->getHTML('', '', null, 10, 'groups');
     return $html;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:11,代码来源:view.html.php

示例8: ajaxUpdate

 /**
  * Update the status of current user
  */
 public function ajaxUpdate($message = '')
 {
     if (!COwnerHelper::isRegisteredUser()) {
         return $this->ajaxBlockUnregister();
     }
     $mainframe =& JFactory::getApplication();
     $objResponse = new JAXResponse();
     //@rule: In case someone bypasses the status in the html, we enforce the character limit.
     $config = CFactory::getConfig();
     if (JString::strlen($message) > $config->get('statusmaxchar')) {
         $message = JString::substr($message, 0, $config->get('statusmaxchar'));
     }
     //trim it here so that it wun go into activities stream.
     $message = JString::trim($message);
     $my = CFactory::getUser();
     $status =& $this->getModel('status');
     $status->update($my->id, $message);
     //set user status for current session.
     $today =& JFactory::getDate();
     $message2 = empty($message) ? ' ' : $message;
     $my->set('_status', $message2);
     $my->set('_posted_on', $today->toMySQL());
     $profileid = JRequest::getVar('userid', 0, 'GET');
     if (COwnerHelper::isMine($my->id, $profileid)) {
         $objResponse->addScriptCall("joms.jQuery('#profile-status span#profile-status-message').html('" . addslashes($message) . "');");
     }
     CFactory::load('helpers', 'string');
     $message = CStringHelper::escape($message);
     if (!empty($message)) {
         $act = new stdClass();
         $act->cmd = 'profile.status.update';
         $act->actor = $my->id;
         $act->target = $my->id;
         CFactory::load('helpers', 'linkgenerator');
         // @rule: Autolink hyperlinks
         $message = CLinkGeneratorHelper::replaceURL($message);
         // @rule: Autolink to users profile when message contains @username
         $message = CLinkGeneratorHelper::replaceAliasURL($message);
         $privacyParams = $my->getParams();
         $act->title = '{actor} ' . $message;
         $act->content = '';
         $act->app = 'profile';
         $act->cid = $my->id;
         $act->access = $privacyParams->get('privacyProfileView');
         CFactory::load('libraries', 'activities');
         CActivityStream::add($act);
         //add user points
         CFactory::load('libraries', 'userpoints');
         CUserPoints::assignPoint('profile.status.update');
         //now we need to reload the activities streams
         $friendsModel = CFactory::getModel('friends');
         $memberSince = CTimeHelper::getDate($my->registerDate);
         $friendIds = $friendsModel->getFriendIds($my->id);
         include_once JPATH_COMPONENT . DS . 'libraries' . DS . 'activities.php';
         $act = new CActivityStream();
         $params =& $my->getParams();
         $limit = !empty($params) ? $params->get('activityLimit', '') : '';
         $html = $act->getHTML($my->id, $friendIds, $memberSince, $limit);
         $status = $my->getStatus();
         $status = addslashes($status);
         $objResponse->addScriptCall("joms.jQuery('#profile-status-message').html('" . $status . "');");
         $objResponse->addScriptCall("joms.jQuery('title').val('" . $status . "');");
         $objResponse->addAssign('activity-stream-container', 'innerHTML', $html);
     }
     return $objResponse->sendResponse();
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:69,代码来源:status.php

示例9: die

<?php

/**
 * @copyright (C) 2013 iJoomla, Inc. - All rights reserved.
 * @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author iJoomla.com <webmaster@ijoomla.com>
 * @url https://www.jomsocial.com/license-agreement
 * The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
 * More info at https://www.jomsocial.com/license-agreement
 */
defined('_JEXEC') or die('Restricted access');
include_once JPATH_BASE . '/components/com_community/defines.community.php';
require_once JPATH_BASE . '/components/com_community/libraries/core.php';
include_once COMMUNITY_COM_PATH . '/libraries/activities.php';
include_once COMMUNITY_COM_PATH . '/helpers/time.php';
JFactory::getLanguage()->isRTL() ? CTemplate::addStylesheet('style.rtl') : CTemplate::addStylesheet('style');
$activities = new CActivityStream();
$maxEntry = $params->get('max_entry', 10);
$stream = $activities->getHTML('', '', null, $maxEntry, '');
require JModuleHelper::getLayoutPath('mod_activitystream', $params->get('layout', 'default'));
开发者ID:Jougito,项目名称:DynWeb,代码行数:20,代码来源:mod_activitystream.php

示例10: ajaxGetActivities

 public function ajaxGetActivities($filter, $user_id = 0, $view = '')
 {
     $objResponse = new JAXResponse();
     include_once JPATH_COMPONENT . DS . 'libraries' . DS . 'activities.php';
     $config = CFactory::getConfig();
     $act = new CActivityStream();
     if ($user_id == 0) {
         // Legacy code, some module might still use the old code
         $user = CFactory::getRequestUser();
     } else {
         $user = CFactory::getUser($user_id);
     }
     //@todo: need to check if the user_id, is a private profile and not
     // a friend!. Disallow for viewing it!
     switch ($filter) {
         case "active-profile":
             $target = array($user->id);
             $params =& $user->getParams();
             $actLimit = $view == 'profile' ? $params->get('activityLimit', $config->get('maxactivities')) : $config->get('maxactivities');
             $data = $act->getHTML($user->id, $target, "", $actLimit);
             break;
         case "me-and-friends":
             $user =& JFactory::getUser();
             $filter = $this->getActivitiesFilter($user->id, $user->registerDate);
             $data = $act->getHTML($user->id, $filter->friendIds, $filter->memberSince, 0, '', '', true, COMMUNITY_SHOW_ACTIVITY_MORE);
             break;
         case "active-user-and-friends":
         case "active-profile-and-friends":
             $filter = $this->getActivitiesFilter($user->id, $user->registerDate);
             $params =& $user->getParams();
             $actLimit = $view == 'profile' ? $params->get('activityLimit', $config->get('maxactivities')) : $config->get('maxactivities');
             $data = $act->getHTML($user->id, $filter->friendIds, $filter->memberSince, $actLimit);
             break;
         case "all":
         default:
             $data = $act->getHTML('', '', null, 0, '', '', true, COMMUNITY_SHOW_ACTIVITY_MORE);
             break;
     }
     $objResponse->addAssign('activity-stream-container', 'innerHTML', $data);
     $objResponse->addScriptCall("joms.filters.hideLoading();");
     return $objResponse->sendResponse();
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:42,代码来源:frontpage.php

示例11: ajaxUpdate

 /**
  * Update the status of current user
  */
 public function ajaxUpdate($message = '')
 {
     $filter = JFilterInput::getInstance();
     $message = $filter->clean($message, 'string');
     $cache = CFactory::getFastCache();
     $cache->clean(array('activities'));
     if (!COwnerHelper::isRegisteredUser()) {
         return $this->ajaxBlockUnregister();
     }
     $mainframe =& JFactory::getApplication();
     $objResponse = new JAXResponse();
     //@rule: In case someone bypasses the status in the html, we enforce the character limit.
     $config = CFactory::getConfig();
     if (JString::strlen($message) > $config->get('statusmaxchar')) {
         $message = JString::substr($message, 0, $config->get('statusmaxchar'));
     }
     //trim it here so that it wun go into activities stream.
     $message = JString::trim($message);
     $my = CFactory::getUser();
     $status =& $this->getModel('status');
     // @rule: Spam checks
     if ($config->get('antispam_akismet_status')) {
         CFactory::load('libraries', 'spamfilter');
         $filter = CSpamFilter::getFilter();
         $filter->setAuthor($my->getDisplayName());
         $filter->setMessage($message);
         $filter->setEmail($my->email);
         $filter->setURL(CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id));
         $filter->setType('message');
         $filter->setIP($_SERVER['REMOTE_ADDR']);
         if ($filter->isSpam()) {
             $objResponse->addAlert(JText::_('COM_COMMUNITY_STATUS_MARKED_SPAM'));
             return $objResponse->sendResponse();
         }
     }
     $status->update($my->id, $message);
     //set user status for current session.
     $today =& JFactory::getDate();
     $message2 = empty($message) ? ' ' : $message;
     $my->set('_status', $message2);
     $my->set('_posted_on', $today->toMySQL());
     $profileid = JRequest::getVar('userid', 0, 'GET');
     if (COwnerHelper::isMine($my->id, $profileid)) {
         $objResponse->addScriptCall("joms.jQuery('#profile-status span#profile-status-message').html('" . addslashes($message) . "');");
     }
     CFactory::load('helpers', 'string');
     $message = CStringHelper::escape($message);
     if (!empty($message)) {
         $act = new stdClass();
         $act->cmd = 'profile.status.update';
         $act->actor = $my->id;
         $act->target = $my->id;
         CFactory::load('helpers', 'linkgenerator');
         // @rule: Autolink hyperlinks
         $message = CLinkGeneratorHelper::replaceURL($message);
         // @rule: Autolink to users profile when message contains @username
         $message = CLinkGeneratorHelper::replaceAliasURL($message);
         CFactory::load('libraries', 'activities');
         $privacyParams = $my->getParams();
         $act->title = '{actor} ' . $message;
         $act->content = '';
         $act->app = 'profile';
         $act->cid = $my->id;
         $act->access = $privacyParams->get('privacyProfileView');
         $act->comment_id = CActivities::COMMENT_SELF;
         $act->comment_type = 'profile.status';
         $act->like_id = CActivities::LIKE_SELF;
         $act->like_type = 'profile.status';
         CActivityStream::add($act);
         //add user points
         CFactory::load('libraries', 'userpoints');
         CUserPoints::assignPoint('profile.status.update');
         //now we need to reload the activities streams
         $friendsModel = CFactory::getModel('friends');
         $memberSince = CTimeHelper::getDate($my->registerDate);
         $friendIds = $friendsModel->getFriendIds($my->id);
         //include_once(JPATH_COMPONENT . DS.'libraries'.DS.'activities.php');
         $act = new CActivityStream();
         $params =& $my->getParams();
         $limit = !empty($params) ? $params->get('activityLimit', '') : '';
         $html = $act->getHTML($my->id, $friendIds, $memberSince, $limit);
         $status = $my->getStatus();
         $status = addslashes($status);
         $objResponse->addScriptCall("joms.jQuery('#.-message').html('" . $status . "');");
         $objResponse->addScriptCall("joms.jQuery('title').val('" . $status . "');");
         $objResponse->addAssign('activity-stream-container', 'innerHTML', $html);
     }
     return $objResponse->sendResponse();
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:92,代码来源:status.php

示例12: die

 * More info at https://www.jomsocial.com/license-agreement
 */
defined('_JEXEC') or die('Restricted access');
include_once JPATH_BASE . '/components/com_community/defines.community.php';
require_once JPATH_BASE . '/components/com_community/libraries/core.php';
include_once COMMUNITY_COM_PATH . '/libraries/activities.php';
include_once COMMUNITY_COM_PATH . '/helpers/time.php';
$svgPath = CFactory::getPath('template://assets/icon/joms-icon.svg');
include_once $svgPath;
JFactory::getLanguage()->isRTL() ? CTemplate::addStylesheet('style.rtl') : CTemplate::addStylesheet('style');
$activities = new CActivityStream();
$maxEntry = $params->get('limit', 20);
$user = CFactory::getUser();
//$stream = $activities->getHTML('', '', null, $maxEntry, '');
switch ($params->get('stream_type', 0)) {
    case 0:
        $stream = $activities->getHTML('', '', null, $maxEntry, '');
        break;
    case 1:
        $stream = $activities->getHTML(CFactory::getUser()->id, '', '', $maxEntry, '', '', true, false, null, false, 'active-profile', 0, array('apps' => 'profiles'));
        break;
    case 2:
        $stream = $activities->getHTML(CFactory::getUser()->id, '', '', $maxEntry, '', '', true, false, null, false, 'active-profile', 0, array('apps' => 'groups'));
        break;
    case 3:
        $stream = $activities->getHTML(CFactory::getUser()->id, '', '', $maxEntry, '', '', true, false, null, false, 'active-profile', 0, array('apps' => 'events'));
        break;
    default:
        $stream = $activities->getHTML('', '', null, $maxEntry, '');
}
require JModuleHelper::getLayoutPath('mod_community_activitystream', $params->get('layout', 'default'));
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:mod_community_activitystream.php


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