本文整理汇总了PHP中Foundry类的典型用法代码示例。如果您正苦于以下问题:PHP Foundry类的具体用法?PHP Foundry怎么用?PHP Foundry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Foundry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Displays the application output in the canvas.
*
* @param int The user id that is currently being viewed.
* @param string layout path
* @since 1.0
* @access public
*/
public function display($userId = null, $docType = null)
{
// Get the user params
$params = $this->getUserParams($userId);
// Get the app params
$appParams = $this->app->getParams();
// Get the blog model
$total = (int) $params->get('total', $appParams->get('total', 5));
$pin_width = (int) $appParams->get('pin_width', 145);
$pin_padding = (int) $appParams->get('pin_padding', 3);
// Get list of all products created by the user on the site.
$input = JFactory::getApplication()->input;
$storeid = $input->get('storeid', '', 'INT');
$model = $this->getModel('q2cmyproducts');
$products = $model->getItems($userId, $total, $storeid);
$productsCount = $model->getProductsCount($userId, $storeid);
$user = Foundry::user($userId);
// Get store list of user
require_once JPATH_ROOT . '/components/com_quick2cart/helpers/storeHelper.php';
$storeHelper = new storeHelper();
$storelist = $storeHelper->getUserStore($userId);
$this->set('user', $user);
$this->set('userId', $userId);
$this->set('total', $total);
$this->set('pin_width', $pin_width);
$this->set('pin_padding', $pin_padding);
$this->set('products', $products);
$this->set('productsCount', $productsCount);
$this->set('storelists', $storelist);
echo parent::display('profile/default');
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:39,代码来源:view.html.php
示例2: onPromoteData
function onPromoteData($id)
{
$db = JFactory::getDBO();
$Itemid = JRequest::getInt('Itemid');
$eschk = $this->_chkextension();
if (!empty($eschk)) {
/*$query = "SELECT cf.id FROM #__community_fields as cf
LEFT JOIN #__community_fields_values AS cfv ON cfv.field_id=cf.id
WHERE cf.name like '%About me%' AND cfv.user_id=".$id;
$db->setQuery($query);
$fieldid = $db->loadresult();
*/
$query = "SELECT u.name AS title\n\t\t\t\t\t\tFROM #__users AS u\n\t\t\t\t\t\tWHERE u.id =" . $id;
$db->setQuery($query);
$previewdata = $db->loadobjectlist();
//if($fieldid)
//$query .= " AND cfv.field_id=".$fieldid;
require_once JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php';
$user = Foundry::user($id);
//easysocial data for user
$activitysocialintegrationprofiledata = new activitysocialintegrationprofiledata();
$img_path = $activitysocialintegrationprofiledata->getUserAvatar('EasySocial', JFactory::getUser($id));
$link = $activitysocialintegrationprofiledata->getUserProfileUrl('EasySocial', $id);
$previewdata[0]->image = $img_path;
$previewdata[0]->url = JUri::root() . substr(JRoute::_($link, false), strlen(JUri::base(true)) + 1);
$previewdata[0]->bodytext = '';
return $previewdata;
} else {
return '';
}
}
开发者ID:politik86,项目名称:test2,代码行数:31,代码来源:plug_promote_esprofile.php
示例3: activate
/**
* Allows user to activate their account.
*
* @since 1.0
* @access public
*/
public function activate()
{
$my = FD::user();
// Get current view.
$view = $this->getCurrentView();
// Get the id from the request
$id = JRequest::getInt('userid');
$currentUser = FD::user($id);
// If user is already logged in, redirect to the dashboard.
if ($my->isLoggedIn()) {
return $view->call(__FUNCTION__, $currentUser);
}
$token = JRequest::getVar('token', '');
// If token is empty, warn the user.
if (empty($token) || strlen($token) !== 32) {
$view->setMessage(JText::_('COM_EASYSOCIAL_REGISTRATION_ACTIVATION_TOKEN_INVALID'), SOCIAL_MSG_ERROR);
return $view->call(__FUNCTION__, $currentUser);
}
// Retrieve registration model
$model = FD::model('Registration');
// Activate the token.
$user = $model->activate($token);
if ($user === false) {
$view->setMessage($model->getError(), SOCIAL_MSG_ERROR);
return $view->call(__FUNCTION__, $currentUser);
}
// @points: user.register
// Assign points when user registers on the site.
$points = Foundry::points();
$points->assign('user.registration', 'com_easysocial', $this->id);
// @badge: registration.create
// Assign badge for the person that initiated the friend request.
$badge = FD::badges();
$badge->log('com_easysocial', 'registration.create', $user->id, JText::_('COM_EASYSOCIAL_REGISTRATION_BADGE_REGISTERED'));
// Get configuration object.
$config = FD::config();
// Add activity logging when a uer registers on the site.
// Get the application params
$app = FD::table('App');
$app->load(array('element' => 'profiles', 'group' => SOCIAL_TYPE_USER));
$params = $app->getParams();
// If not allowed, we will not want to proceed here.
if ($params->get('stream_register', true)) {
$stream = FD::stream();
$streamTemplate = $stream->getTemplate();
// Set the actor
$streamTemplate->setActor($user->id, SOCIAL_TYPE_USER);
// Set the context
$streamTemplate->setContext($user->id, SOCIAL_TYPE_PROFILES);
// Set the verb
$streamTemplate->setVerb('register');
// set sitewide
$streamTemplate->setSiteWide();
$streamTemplate->setAccess('core.view');
// Add stream template.
$stream->add($streamTemplate);
}
$view->setMessage(JText::_('COM_EASYSOCIAL_REGISTRATION_ACTIVATION_COMPLETED_SUCCESS'), SOCIAL_MSG_SUCCESS);
return $view->call(__FUNCTION__, $user);
}
开发者ID:ppantilla,项目名称:bbninja,代码行数:66,代码来源:registration.php
示例4: getHTML
/**
* Shares a story through 3rd party oauth clients
*
* @param TableBlog $blog A blog table object
* @param string $type The type of oauth client
*
* @return boolean True on success and false otherwise.
**/
public function getHTML($bloggerid = "")
{
$html = '';
$my = JFactory::getUser();
$config = EasyBlogHelper::getConfig();
if ($config->get('main_jomsocial_messaging') && $my->id != $bloggerid) {
$file_core = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'core.php';
$file_messaging = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'messaging.php';
if (file_exists($file_core) && file_exists($file_messaging)) {
require_once $file_core;
require_once $file_messaging;
CMessaging::load();
$html = '<a href="javascript:void(0);" onclick="' . CMessaging::getPopup($bloggerid) . '" class="author-message" title="' . JText::_('COM_EASYBLOG_MESSAGE_AUTHOR') . '"><span>' . JText::_('COM_EASYBLOG_MESSAGE_AUTHOR') . '</span></a>';
}
}
$easysocial = EasyBlogHelper::getHelper('EasySocial');
if ($config->get('integrations_easysocial_conversations') && $easysocial->exists() && $my->id != $bloggerid) {
$easysocial->init();
$user = Foundry::user($bloggerid);
$theme = new CodeThemes();
$theme->set('user', $user);
$html = $theme->fetch('easysocial.conversation.php');
}
return $html;
}
开发者ID:Tommar,项目名称:vino2,代码行数:33,代码来源:messaging.php
示例5: getLink
public function getLink()
{
$user = Foundry::user($this->profile->id);
if ($this->komentoprofile) {
return JRoute::_('index.php?option=com_komento&view=profile&id=' . $this->profile->id);
}
return $user->getPermalink();
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:8,代码来源:profileVendors.php
示例6: display
/**
* Responsible to display the generic login form.
*
* @since 1.0
* @access public
*/
public function display($tpl = null)
{
$my = FD::user();
// If user is already logged in, they should not see this page.
if ($my->id > 0) {
return $this->redirect(FRoute::dashboard(array(), false));
}
// Add page title
FD::page()->title(JText::_('COM_EASYSOCIAL_LOGIN_PAGE_TITLE'));
// Add breadcrumb
FD::page()->breadcrumb(JText::_('COM_EASYSOCIAL_LOGIN_PAGE_BREADCRUMB'));
// Facebook codes.
$facebook = FD::oauth('Facebook');
$config = FD::config();
$loginMenu = $config->get('general.site.login');
// Get any callback urls.
$return = FD::getCallback();
// If return value is empty, always redirect back to the dashboard
if (!$return) {
// Determine if there's a login redirection
$urlFromCaller = FD::input()->getVar('return', '');
if ($urlFromCaller) {
$return = $urlFromCaller;
} else {
if ($loginMenu != 'null') {
$return = FRoute::getMenuLink($loginMenu);
} else {
$return = FRoute::dashboard(array(), false);
}
$return = base64_encode($return);
}
} else {
$return = base64_encode($return);
}
if ($config->get('registrations.enabled')) {
$profileId = $config->get('registrations.mini.profile', 'default');
if ($profileId === 'default') {
$profileId = Foundry::model('profiles')->getDefaultProfile()->id;
}
$options = array('visible' => SOCIAL_PROFILES_VIEW_MINI_REGISTRATION, 'profile_id' => $profileId);
$fieldsModel = Foundry::model('fields');
$fields = $fieldsModel->getCustomFields($options);
if (!empty($fields)) {
FD::language()->loadAdmin();
$fieldsLib = FD::fields();
$session = JFactory::getSession();
$registration = FD::table('Registration');
$registration->load($session->getId());
$data = $registration->getValues();
$args = array(&$data, &$registration);
$fieldsLib->trigger('onRegisterMini', SOCIAL_FIELDS_GROUP_USER, $fields, $args);
$this->set('fields', $fields);
}
}
$this->set('return', $return);
$this->set('facebook', $facebook);
return parent::display('site/login/default');
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:64,代码来源:view.html.php
示例7: _getAvatar
function _getAvatar($profile)
{
$easysocial = EasyBlogHelper::getHelper('EasySocial');
$easysocial->init();
$user = Foundry::user($profile->id);
$avatar = new stdClass();
$avatar->link = $user->getAvatar();
return $avatar;
}
开发者ID:Tommar,项目名称:vino2,代码行数:9,代码来源:avatar.php
示例8: getAvatar
public function getAvatar($profile)
{
$easysocial = EB::easysocial();
if (!$easysocial->exists()) {
return false;
}
// Load the user
$user = Foundry::user($profile->id);
return $user->getAvatar();
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:10,代码来源:client.php
示例9: isValidNode
public function isValidNode()
{
if (!$this->group->id) {
$this->lib->setError(JText::_('Sorry, but the group id provided is not a valid group id.'));
return false;
}
if (Foundry::user()->id != $this->group->creator_uid) {
if (FD::user()->isBlockedBy($this->group->creator_uid)) {
return JError::raiseError(404, JText::_('COM_EASYSOCIAL_GROUPS_GROUP_NOT_FOUND'));
}
}
return true;
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:13,代码来源:group.php
示例10: main
public function main()
{
$db = Foundry::db();
$sql = $db->sql();
$query = "update `#__social_stream` as a";
$query .= ' inner join `#__social_clusters` as b on a.`cluster_id` = b.`id`';
$query .= ' set a.`cluster_access` = b.`type`';
$query .= ' where a.`cluster_id` != 0 and a.`cluster_access` = 1';
$sql->raw($query);
$db->setQuery($sql);
$state = $db->query();
return $state;
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:13,代码来源:StreamClusterItemAccess.php
示例11: form
/**
* Responsible to display the generic login form via ajax
*
* @since 1.0
* @access public
*/
public function form($tpl = null)
{
$ajax = FD::ajax();
$my = FD::user();
// If user is already logged in, they should not see this page.
if ($my->id > 0) {
$this->setMessage(JText::_('COM_EASYSOCIAL_LOGIN_ALREADY_LOGGED_IN'), SOCIAL_MSG_ERROR);
return $ajax->reject($this->getMessage());
}
// Facebook codes.
$facebook = FD::oauth('Facebook');
// Get any callback urls.
$return = FD::getCallback();
// If return value is empty, always redirect back to the dashboard
if (!$return) {
$return = FRoute::dashboard(array(), false);
}
// Determine if there's a login redirection
$config = FD::config();
$loginMenu = $config->get('general.site.login');
if ($loginMenu != 'null') {
$return = FD::get('toolbar')->getRedirectionUrl($loginMenu);
}
$return = base64_encode($return);
$this->set('return', $return);
$this->set('facebook', $facebook);
if ($config->get('registrations.enabled')) {
$profileId = $config->get('registrations.mini.profile', 'default');
if ($profileId === 'default') {
$profileId = Foundry::model('profiles')->getDefaultProfile()->id;
}
$options = array('visible' => SOCIAL_PROFILES_VIEW_MINI_REGISTRATION, 'profile_id' => $profileId);
$fieldsModel = FD::model('Fields');
$fields = $fieldsModel->getCustomFields($options);
if (!empty($fields)) {
FD::language()->loadAdmin();
$fieldsLib = FD::fields();
$session = JFactory::getSession();
$registration = FD::table('Registration');
$registration->load($session->getId());
$data = $registration->getValues();
$args = array(&$data, &$registration);
$fieldsLib->trigger('onRegisterMini', SOCIAL_FIELDS_GROUP_USER, $fields, $args);
$this->set('fields', $fields);
}
}
$contents = parent::display('site/login/dialog.login');
return $ajax->resolve($contents);
}
开发者ID:ppantilla,项目名称:bbninja,代码行数:55,代码来源:view.ajax.php
示例12: getHTML
public function getHTML($bloggerid = "")
{
$config = EB::config();
$html = '';
$easysocial = EB::easysocial();
if ($config->get('integrations_easysocial_badges') && $easysocial->exists()) {
$easysocial->init();
$user = Foundry::user($bloggerid);
$badges = $user->getBadges();
$theme = EB::template();
$theme->set('badges', $badges);
$html = $theme->output('site/easysocial/achievements');
}
return $html;
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:15,代码来源:achievements.php
示例13: getHTML
public function getHTML($bloggerid = "")
{
$config = EasyBlogHelper::getConfig();
$html = '';
$easysocial = EasyBlogHelper::getHelper('EasySocial');
if ($config->get('integrations_easysocial_badges') && $easysocial->exists()) {
$easysocial->init();
$user = Foundry::user($bloggerid);
$badges = $user->getBadges();
$theme = new CodeThemes();
$theme->set('badges', $badges);
$html = $theme->fetch('easysocial.achievements.php');
}
return $html;
}
开发者ID:Tommar,项目名称:vino2,代码行数:15,代码来源:achievements.php
示例14: getProductsCount
public function getProductsCount($userId, $storeid = '')
{
$db = Foundry::db();
$sql = $db->sql();
$sql = 'SELECT COUNT(i.item_id)
FROM `#__kart_items` as i, `#__kart_store` as s
WHERE s.id = i.store_id
AND i.state = 1
AND `owner` = ' . $userId;
if ($storeid) {
$sql .= ' AND i.store_id = ' . $storeid;
}
$sql .= " AND i.parent = 'com_quick2cart'";
$db->setQuery($sql);
$result = $db->loadResult();
return $result;
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:17,代码来源:q2cmyproducts.php
示例15: getAlbums
/**
* Display the list of photos a user has uploaded
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function getAlbums($user)
{
$params = $this->getUserParams($user->id);
$appParam = $this->app->getParams();
$albums = array();
// Load up albums model
$model = FD::model('Albums');
$sorting = $params->get('ordering', $appParam->get('ordering', 'latest'));
$options = array('order' => 'assigned_date', 'direction' => $sorting == 'latest' ? 'desc' : 'asc');
$options['excludeblocked'] = 1;
// privacy lib
$privacy = Foundry::privacy(Foundry::user()->id);
$results = $model->getAlbums($user->id, SOCIAL_TYPE_USER, $options);
if ($results) {
foreach ($results as $item) {
// we need to check the photo's album privacy to see if user allow to view or not.
if ($privacy->validate('albums.view', $item->id, SOCIAL_TYPE_ALBUM, $item->user_id)) {
$albums[] = $item;
}
}
}
if (empty($albums)) {
return;
}
// If sorting is set to random, then we shuffle the albums
if ($sorting == 'random') {
shuffle($albums);
}
// since we are getting all albums belong to user,
// we do not need to run another query to count the albums.
// just do array count will be fine.
// $total = $model->getTotalAlbums($options);
$total = count($albums);
$limit = $params->get('limit', $appParam->get('limit', 10));
$this->set('total', $total);
$this->set('appParams', $appParam);
$this->set('params', $params);
$this->set('user', $user);
$this->set('albums', $albums);
$this->set('limit', $limit);
$this->set('privacy', $privacy);
return parent::display('widgets/profile/albums');
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:51,代码来源:view.html.php
示例16: install
/**
* Installs a new theme
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function install($file)
{
$source = $file['tmp_name'];
$fileName = md5($file['name'] . Foundry::date()->toMySQL());
$fileExtension = '_themes_install.zip';
$destination = JPATH_ROOT . '/tmp/' . $fileName . $fileExtension;
// Upload the zip archive
$state = JFile::upload($source, $destination);
if (!$state) {
$this->setError(JText::_('COM_EASYBLOG_THEMES_INSTALLER_ERROR_COPY_FROM_PHP'));
return false;
}
// Extract the zip
$extracted = dirname($destination) . '/' . $fileName . '_themes_install';
$state = JArchive::extract($destination, $extracted);
// Once it is extracted, delete the zip file
JFile::delete($destination);
// Get the configuration file.
$manifest = $extracted . '/config/template.json';
$manifest = JFile::read($manifest);
// Get the theme object
$theme = json_decode($manifest);
// Move it to the appropriate folder
$themeDestination = EBLOG_THEMES . '/' . strtolower($theme->element);
$exists = JFolder::exists($themeDestination);
// If folder exists, overwrite it. For now, just throw an error.
if ($exists) {
// Delete teh etracted folder
JFolder::delete($extracted);
$this->setError(JText::sprintf('COM_EASYBLOG_THEMES_INSTALLER_ERROR_SAME_THEME_FOLDER_EXISTS', $theme->element));
return false;
}
// Move extracted folder
$state = JFolder::move($extracted, $themeDestination);
if (!$state) {
// Delete the etracted folder
JFolder::delete($extracted);
$this->setError(JText::_('COM_EASYBLOG_THEMES_INSTALLER_ERROR_MOVING_FOLDER_TO_THEMES_FOLDER'));
return false;
}
return true;
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:50,代码来源:themes.php
示例17: execute
/**
*
*
* @since 1.2
* @access public
* @param string
* @return
*/
public function execute($item)
{
// Get comment participants
$model = FD::model('Comments');
$users = $model->getParticipants($item->uid, $item->context_type);
// Include the actor of the stream item as the recipient
// Exclude myself from the list of users.
// Ensure that the values are unique
$users[] = $item->actor_id;
$users = array_values(array_unique(array_diff($users, array(Foundry::user()->id))));
// Convert the names to stream-ish
$names = Foundry::string()->namesToNotifications($users);
$plurality = count($users) > 1 ? '_PLURAL' : '_SINGULAR';
// By default content is always empty;
$content = '';
// Only show the content when there is only 1 item
if (count($users) == 1 && !empty($item->content)) {
$content = JString::substr(strip_tags($item->content), 0, 30);
if (JString::strlen($item->content) > 30) {
$content .= JText::_('COM_EASYSOCIAL_ELLIPSES');
}
}
// Load the milestone
$milestone = FD::table('Milestone');
$state = $milestone->load($item->uid);
if (!$state) {
return;
}
// We need to generate the notification message differently for the author of the item and the recipients of the item.
if ($milestone->owner_id == $item->target_id && $item->target_type == SOCIAL_TYPE_USER) {
$item->title = JText::sprintf('APP_GROUP_TASKS_USER_COMMENTED_ON_YOUR_MILESTONE', $names);
return $item;
}
if ($milestone->owner_id == $item->actor_id && count($users) == 1) {
$item->title = JText::sprintf('APP_GROUP_TASKS_USER_COMMENTED_ON_THEIR_MILESTONE', $names);
return $item;
}
// This is for 3rd party viewers
$item->title = JText::sprintf('APP_GROUP_TASKS_USER_COMMENTED_ON_USERS_MILESTONE', $names, Foundry::user($milestone->owner_id)->getName());
return $item;
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:49,代码来源:notification.comments.php
示例18: getUserinfowindow
/**
* Get the message
* @return string The message to be displayed to the user
*/
static function getUserinfowindow()
{
$user = JFactory::getUser();
$db = JFactory::getDBO();
$jinput = JFactory::getApplication()->input;
$userid = $jinput->get('contentid', null, 'int');
$file = JPATH_ROOT . '/administrator/components/com_easysocial/includes/foundry.php';
jimport('joomla.filesystem.file');
if (!JFile::exists($file)) {
return;
}
require_once $file;
$config = Foundry::config();
$photos_enabled = $config->get('photos.enabled');
//$videos_enabled = $config->get( 'videos.enabled' );
$points_enabled = $config->get('points.enabled');
$followers_enabled = $config->get('followers.enabled');
// u , sa , sc , sp , spm , sf
$q = "SELECT u.name, u.username , u.lastvisitDate \r\n\t\t, spm.value AS cover \r\n\t\t, sc.photo_id , sc.x , sc.y \r\n\t\t, sf.state as isfriend \r\n\t\t, (SELECT COUNT(*) FROM #__session WHERE userid=u.id AND client_id='0') AS onlinestatus ";
if ($photos_enabled) {
$q .= " , (SELECT COUNT(*) FROM #__social_albums WHERE user_id=u.id AND type='user' AND core='0') AS photoalbumscount ";
}
if ($points_enabled) {
$q .= " , (SELECT SUM(points) FROM #__social_points_history WHERE user_id=u.id AND state='1') AS points ";
}
if ($followers_enabled) {
$q .= " , (SELECT COUNT(*) FROM #__social_subscriptions WHERE uid=u.id AND type='user.user') AS followerscount ";
}
$q .= " , (SELECT COUNT(*) FROM #__social_friends WHERE (actor_id=u.id OR target_id=u.id ) AND state='1') AS friendscount ";
//if($videos_enabled)
//$q .= " , (SELECT COUNT(*) FROM #__social_videos WHERE user_id=u.id AND type='user' AND state='1') AS videoscount ";
$q .= " FROM #__users u \r\n\t\tLEFT JOIN #__social_covers sc ON sc.uid=u.id AND sc.type='user' \r\n\t\tLEFT JOIN #__social_photos_meta spm ON spm.photo_id=sc.photo_id AND spm.property='large' \r\n\t\tLEFT JOIN #__social_friends sf ON (sf.actor_id ='" . $user->id . "' AND sf.target_id=u.id AND sf.state='-1') OR (sf.actor_id ='" . $user->id . "' AND sf.target_id=u.id AND sf.state='1') OR (sf.actor_id =u.id AND sf.target_id='" . $user->id . "' AND sf.state='1')\r\n\t\tWHERE u.id='" . $userid . "'";
$db->setQuery($q);
$infowindow = $db->loadObject();
//echo $infowinfow["medium"] = Foundry::user( $user->id )->getAvatar();
//$infowinfow->medium = Foundry::user( $user->id )->getAvatar();
//$infowinfow->offsetSet("medium",Foundry::user( $user->id )->getAvatar() );
//var_dump($infowindow);
return $infowindow;
}
开发者ID:,项目名称:,代码行数:44,代码来源:
示例19: getHTML
public function getHTML($bloggerid = "")
{
$html = '';
$my = JFactory::getUser();
$config = EasyBlogHelper::getConfig();
// We don't want to show the link to the same user
if ($my->id == $bloggerid) {
return;
}
if ($config->get('main_jomsocial_friends')) {
$file_core = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'core.php';
$file_messaging = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'friends.php';
jimport('joomla.filesystem.file');
if (JFile::exists($file_core) && JFile::exists($file_messaging)) {
require_once $file_core;
require_once $file_messaging;
$user = CFactory::getUser();
$model = CFactory::getModel('Friends');
$friends = $model->getFriendIds($bloggerid);
if (!in_array($my->id, $friends)) {
CFriends::load();
$html = '<a href="javascript:void(0);" onclick="' . CFriends::getPopup($bloggerid) . '" class="author-friend"><span>' . JText::_('COM_EASYBLOG_ADD_FRIEND') . '</span></a>';
}
}
}
$easysocial = EasyBlogHelper::getHelper('EasySocial');
if ($config->get('integrations_easysocial_friends') && $easysocial->exists()) {
$user = Foundry::user($bloggerid);
// Check if the user is friends with the current viewer.
if ($user->isFriends($my->id)) {
return;
}
$easysocial->init();
$theme = new CodeThemes();
$theme->set('id', $bloggerid);
$html = $theme->fetch('easysocial.friends.php');
}
return $html;
}
开发者ID:Tommar,项目名称:vino2,代码行数:39,代码来源:friends.php
示例20: getHTML
public function getHTML($bloggerid = "")
{
$html = '';
$my = JFactory::getUser();
$config = EasyBlogHelper::getConfig();
// We don't want to show the link to the same user
if ($my->id == $bloggerid) {
return;
}
$easysocial = EasyBlogHelper::getHelper('EasySocial');
if ($config->get('integrations_easysocial_followers') && $easysocial->exists()) {
$user = Foundry::user($bloggerid);
$followed = $user->isFollowed($my->id);
if ($followed) {
return;
}
$easysocial->init();
$theme = new CodeThemes();
$theme->set('id', $bloggerid);
$html = $theme->fetch('easysocial.followers.php');
}
return $html;
}
开发者ID:Tommar,项目名称:vino2,代码行数:23,代码来源:followers.php
注:本文中的Foundry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论