本文整理汇总了PHP中CFactory::getActiveProfile方法的典型用法代码示例。如果您正苦于以下问题:PHP CFactory::getActiveProfile方法的具体用法?PHP CFactory::getActiveProfile怎么用?PHP CFactory::getActiveProfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFactory
的用法示例。
在下文中一共展示了CFactory::getActiveProfile方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getOriginalHTML
public function _getOriginalHTML()
{
if (defined('JPATH_ROOT')) {
$path = JPATH_ROOT;
} else {
global $mosConfig_absolute_path;
$path = $mosConfig_absolute_path;
}
$status = (include $path . DIRECTORY_SEPARATOR . 'acctexp' . DIRECTORY_SEPARATOR . 'acctexp.php');
if (!$status && !defined('INSTALLER_FOLDER')) {
echo "We were unable to load the AEC library. If you removed the AEC folder, please also remove this plugins from the Joomla plugins manager.";
}
$user =& CFactory::getActiveProfile();
// get the memberID
$membersSessionC =& WGet::classes('members.session');
$myMember = $membersSessionC->getMember($user->_userid, true);
$memberId = $myMember->uid;
// if we dont have member we dont show the view
if (empty($memberId)) {
return;
}
// set the value for the view filter
WGlobals::setVar('integrationmemberid', $memberId);
WGlobals::setVar('extensionKEY', 'subscription.node', 'acctexp');
// Show the view
$integrationV = WView::get('subscription_widget_integration');
if (empty($integrationV)) {
return '';
}
$HTMLoutput .= $integrationV->make();
return $HTMLoutput;
}
示例2: onProfileDisplay
function onProfileDisplay()
{
// Load language
$lang =& JFactory::getLanguage();
JPlugin::loadLanguage('plg_community_plg_rsmembership', JPATH_ADMINISTRATOR);
// Attach CSS
$document =& JFactory::getDocument();
$css = JURI::base() . 'plugins/community/plg_rsmembership/style.css';
$document->addStyleSheet($css);
if (!file_exists($this->_path)) {
$content = '<div class="icon-nopost"><img src="' . JURI::base() . 'components/com_community/assets/error.gif" alt="" /></div>';
$content .= '<div class="content-nopost">' . JText::_('RSM_NOT_INSTALLED') . '</div>';
} else {
require_once $this->_path;
$user =& CFactory::getActiveProfile();
$userName = $user->getDisplayName();
$userId = $user->id;
$memberships = $this->_getMemberships();
$Itemid = $this->getItemid();
$cache =& JFactory::getCache('plgCommunityPlg_RSMembership');
$cache->setCaching($this->params->get('cache', 1));
$callback = array('plgCommunityPlg_RSMembership', '_getRSMembershipHTML');
$content = $cache->call($callback, $userName, $userId, $memberships, $Itemid);
}
return $content;
}
示例3: onProfileDisplay
function onProfileDisplay()
{
$config =& CFactory::getConfig();
$this->loadUserParams();
$uri = JURI::base();
$user = CFactory::getActiveProfile();
$document =& JFactory::getDocument();
$css = $uri . 'plugins/community/groups/style.css';
$document->addStyleSheet($css);
$view = $this->params->get('fabrik_view');
$id = $this->params->get('fabrik_view_id');
$rowid = $this->params->get('fabrik_row_id');
$usekey = $this->params->get('fabrik_usekey');
$layout = $this->params->get('fabrik_layout');
$additional = $this->params->get('fabrik_additional');
$element = $this->params->get('fabrik_element');
if (!empty($view) && !empty($id)) {
$cache =& JFactory::getCache('plgCommunityFabrik');
$cache->setCaching($this->params->get('cache', 1));
$callback = array('plgCommunityFabrik', '_getFabrikHTML');
$content = $cache->call($callback, $view, $id, $rowid, $usekey, $layout, $element, $additional, $this->userparams, $user->id);
} else {
$content = "<div class=\"icon-nopost\"><img src='" . JURI::base() . "components/com_community/assets/error.gif' alt=\"\" /></div>";
$content .= "<div class=\"content-nopost\">" . JText::_('Fabrik view details not set.') . "</div>";
}
return $content;
}
示例4: onProfileDisplay
function onProfileDisplay()
{
if (!file_exists($this->_path . DS . 'admin.jreviews.php')) {
return JText::_('jReviews is not installed. Please contact site administrator.');
} else {
$user = CFactory::getActiveProfile();
$userId = $user->id;
$cacheSetting = $this->params->get('cache', 1) ? JApplication::getCfg('caching') : 0;
# Load CSS stylesheets -- done here because when cache is on css is not loaded
if ($cacheSetting) {
# MVC initalization script
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
require 'components' . DS . 'com_jreviews' . DS . 'jreviews' . DS . 'framework.php';
$cache_file = 'jreviews_config_' . md5(cmsFramework::getConfig('secret'));
$Config =& S2Cache::read($cache_file);
if (!is_object($Config)) {
//Create config file
$eParams['data']['controller'] = 'common';
$eParams['data']['action'] = 'index';
$Dispatcher = new S2Dispatcher('jreviews', false, true);
$Dispatcher->dispatch($eParams);
$Config =& S2Cache::read($cache_file);
unset($Dispatcher);
}
App::import('Helper', 'html');
$Html =& RegisterClass::getInstance('HtmlHelper');
$Html->viewTheme = $Config->template;
$Html->app = 'jreviews';
$Html->startup();
App::import('Helper', 'libraries', 'jreviews');
$Libraries =& RegisterClass::getInstance('LibrariesHelper');
$Html->css(array('theme', 'plugins', 'paginator'));
$Html->js(array('jreviews', 'jquery' => 'jquery', 'jq.scrollable'), $Libraries->js());
}
$cache =& JFactory::getCache('plgCommunityJreviews_myfavorites');
$cache->setCaching($cacheSetting);
$callback = array('plgCommunityJreviews_myfavorites', '_getPage');
$contents = $cache->call($callback, $userId, $this->params, $cacheSetting);
return $contents;
}
}
示例5: onProfileDisplay
function onProfileDisplay()
{
JPlugin::loadLanguage('plg_community_ninjaboard', JPATH_SITE);
$config =& CFactory::getConfig();
$this->loadUserParams();
$my =& JFactory::getUser();
$user =& CFactory::getActiveProfile();
// Attach CSS & JS
$document =& JFactory::getDocument();
$document->addStyleSheet(JURI::base() . 'plugins/community/ninjaboard/ninjaboard.css');
//get parameters
$caching = $this->params->get('cache', "0");
$nbPlugShowSubject = $this->params->get('nbPlugShowSubject', "1");
$nbPlugTruncateSubject = $this->params->get('nbPlugTruncateSubject', "25");
$nbPlugShowMessage = $this->params->get('nbPlugShowMessage', "1");
$nbPlugTruncateMessage = $this->params->get('nbPlugTruncateMessage', "50");
$nbPlugShowForum = $this->params->get('nbPlugShowForum', "1");
$nbPlugShowHits = $this->params->get('nbPlugShowHits', "1");
$nbPlugShowCreated = $this->params->get('nbPlugShowCreated', "1");
$nbPlugShowModified = $this->params->get('nbPlugShowModified', "1");
$nbPlugDateFormat = $this->params->get('nbPlugDateFormat', "D, d M");
$nbPlugShowEdit = $this->params->get('nbPlugShowEdit', "1");
$nbPlugSortBy = $this->params->get('nbPlugSortBy', "1");
$nbPlugSortOrder = $this->params->get('nbPlugSortOrder', "DESC");
$nbPlugShowPagination = $this->params->get('nbPlugShowPagination', "0");
$nbPlugPaginationCount = $this->params->get('nbPlugPaginationCount', "5");
$userId = $user->id;
$limit = $nbPlugPaginationCount > 0 ? $nbPlugPaginationCount : 0;
$offset = JRequest::getVar('limitstart', 0, 'REQUEST');
//get user posts
$rows = $this->getPosts($userId, $nbPlugSortBy, $nbPlugSortOrder, $nbPlugPaginationCount, $limit, $offset);
//get user post count
$row_count = $this->countPosts($userId);
//get itemid
$itemId = $this->getItemId();
$cache =& JFactory::getCache('plgCommunityNinjaBoard');
$cache->setCaching($caching);
$callback = array('plgCommunityNinjaBoard', '_getNinjaBoardHTML');
$content = $cache->call($callback, $rows, $row_count, $user->id, $nbPlugShowSubject, $nbPlugTruncateSubject, $nbPlugShowMessage, $nbPlugTruncateMessage, $nbPlugShowForum, $nbPlugShowHits, $nbPlugShowCreated, $nbPlugShowModified, $nbPlugDateFormat, $nbPlugShowEdit, $nbPlugSortBy, $nbPlugSortOrder, $nbPlugShowPagination, $nbPlugPaginationCount, $offset, $limit, $itemId, $this->params, $user, $my);
return $content;
}
示例6: onProfileDisplay
function onProfileDisplay()
{
$config = CFactory::getConfig();
$db = JFactory::getDBO();
$uri = JURI::base();
$my = JFactory::getUser();
$user = CFactory::getActiveProfile();
$lang = JFactory::getLanguage();
$lang->load('plg_community_jssurveyresponses', JPATH_ADMINISTRATOR, $lang->getTag(), true);
$lang->load('plg_community_jssurveyresponsesoverride', JPATH_ADMINISTRATOR, $lang->getTag(), true);
$query = '
select
distinct(a.id), a.title, a.alias, a.created, a.responses, a.private_survey
from
#__survey a
left join
#__survey_responses r on a.id = r.survey_id
where
r.created_by=' . $user->id . ' and a.published = 1 order by a.created desc';
$db->setQuery($query, 0, 10);
$items = $db->loadObjectList();
$content = '';
if ($items && count($items)) {
$content = '<ol>';
$menu = JFactory::getApplication()->getMenu();
$mnuitems = $menu->getItems('link', 'index.php?option=com_communitysurveys&view=survey');
$itemid = isset($mnuitems[0]) ? '&Itemid=' . $mnuitems[0]->id : '';
foreach ($items as $item) {
if ($item->private_survey == 0) {
$url = JRoute::_('index.php?option=com_communitysurveys&view=survey&task=respond&id=' . $item->id . ':' . $item->alias . $itemid);
$content .= '<li><a href="' . $url . '">' . htmlentities($item->title, ENT_COMPAT, 'UTF-8') . '</a> (' . $item->responses . ' ' . ($item->responses == 1 ? JText::_('LBL_RESPONSE') : JText::_('LBL_RESPONSES')) . ')</li>';
} else {
$content .= '<li>' . htmlentities($item->title, ENT_COMPAT, 'UTF-8') . ' (' . $item->responses . ' ' . ($item->responses == 1 ? JText::_('LBL_RESPONSE') : JText::_('LBL_RESPONSES')) . ')</li>';
}
}
$content .= '</ol>';
}
return $content;
}
示例7: plgCommunityActivityComment
function plgCommunityActivityComment(&$subject, $config)
{
$this->_user =& CFactory::getActiveProfile();
$this->_my =& CFactory::getUser();
parent::__construct($subject, $config);
}
示例8: showTab
/**
* Helper-method to show the tab
*
* @access private
* @param null
* @return null
*/
private function showTab()
{
// Require the core JomSocial library
if (!class_exists('CFactory')) {
require_once JPATH_BASE . '/components/com_community/libraries/core.php';
}
// Import the MageBridge autoloader
require_once JPATH_BASE . '/components/com_magebridge/helpers/loader.php';
// Get the variables
$toolbar = CFactory::getToolbar();
$user = CFactory::getActiveProfile();
$username = $user->getDisplayName();
$tab = $this->getTab();
if (!empty($tab)) {
$toolbar->addGroup('MAGEBRIDGE', $tab['name'], $this->getLink($tab['url']));
foreach ($tab['children'] as $link) {
$this->addLink($link[0], $link[1], $link[2]);
}
}
}
示例9: onProfileDisplay
function onProfileDisplay()
{
if (!file_exists($this->_path . DS . 'admin.jreviews.php')) {
return JText::_('jReviews is not installed. Please contact site administrator.');
} else {
$user = CFactory::getActiveProfile();
$userId = $user->id;
$cacheSetting = $this->params->get('cache', 1) ? JApplication::getCfg('caching') : 0;
# Load CSS stylesheets -- done here because when cache is on css is not loaded
if ($cacheSetting) {
# MVC initalization script
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
require 'components' . DS . 'com_jreviews' . DS . 'jreviews' . DS . 'framework.php';
//Create config file
$eParams['data']['controller'] = 'common';
$eParams['data']['action'] = 'index';
$Dispatcher = new S2Dispatcher('jreviews', false, true);
$Dispatcher->dispatch($eParams);
unset($Dispatcher);
$Access = Configure::read('JreviewsSystem.Access');
$Config = Configure::read('JreviewsSystem.Config');
App::import('Helper', 'html');
$Html = ClassRegistry::getClass('HtmlHelper');
$Html->viewTheme = $Config->template;
$Html->app = 'jreviews';
App::import('Helper', 'libraries', 'jreviews');
$Libraries = ClassRegistry::getClass('LibrariesHelper');
$Libraries->Config = $Config;
$assets = array('css' => array('theme', 'theme.detail', 'theme.form', 'jq.ui.core', 'paginator'), 'js' => array('jreviews', 'jquery' => 'jquery', 'jq.ui.core', 'jq.jreviews.plugins'));
if ($Access->canAddReview() || $Access->isEditor()) {
$assets['js'][] = 'jreviews.fields';
if ($Config->rating_selector == 'stars') {
$assets['js'][] = 'jq.ui.rating';
}
$assets['js'][] = 'jq.tooltip';
}
$Html->css(arrayFilter($assets['css'], $Libraries->css()));
$Html->js(arrayFilter($assets['js'], $Libraries->js()));
?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready(function()
{
<?php
if ($Access->canAddReview && !$Access->moderateReview() && $Config->facebook_enable && $Config->facebook_reviews) {
?>
if(!jQuery('#fb-root').length) jQuery("body").append('<div id="fb-root"></div>');
jreviews.facebook.init({
'appid':'<?php
echo $Config->facebook_appid;
?>
',
'optout':<?php
echo $Config->facebook_optout;
?>
,
'success':function(){
jreviews.facebook.checkPermissions({
'onPermission':function(){jreviews.facebook.setCheckbox('jr_submitButton',true);},
'onNoSession':function(){jreviews.facebook.setCheckbox('jr_submitButton',false);}
});
},
'publish_text': '<?php
__t("Publish to Facebook", false, true);
?>
'
});
<?php
}
?>
});
/* ]]> */
</script>
<?php
}
$cache =& JFactory::getCache('plgCommunityJreviews_reviewme');
$cache->setCaching($cacheSetting);
$callback = array('plgCommunityJreviews_reviewme', '_getPage');
$contents = $cache->call($callback, $userId, $this->params, $cacheSetting);
return $contents;
}
}