Exemplo n.º 1
0
 /**
  * Post processing once a user's access has been revoked
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function revoke()
 {
     FD::info()->set($this->getMessage());
     $url = FRoute::profile(array('layout' => 'edit'), false);
     $this->redirect($url);
     $this->close();
 }
Exemplo n.º 2
0
 public function __construct($config = array())
 {
     // We want to allow child classes to easily access theme configurations on the view
     $this->themeConfig = FD::themes()->getConfig();
     parent::__construct($config);
     // Check if there is a method isFeatureEnabled exists. If it does, we should do a check all the time.
     if (method_exists($this, 'isFeatureEnabled')) {
         $this->isFeatureEnabled();
     }
     // // When the user doesn't have community access, ensure that they can only view selected views.
     if (!$this->my->hasCommunityAccess()) {
         // Get the current view
         $view = $this->getName();
         $layout = $this->input->get('layout', '', 'cmd');
         // If this is an ajax call, we need to allow some ajax calls to go through
         $allowedAjaxNamespaces = array('site/views/profile/showFormError');
         if ($this->doc->getType() == 'ajax') {
             $namespace = $this->input->get('namespace', '', 'default');
             // If this is an ajax call, and the namespace is valid, skip checking below
             if (in_array($namespace, $allowedAjaxNamespaces)) {
                 return;
             }
         }
         // Define allowed views and layout
         $allowedViews = array('profile');
         $allowedLayouts = array('edit');
         // views that we should redirect the user to profile edit page.
         $redirectView = array('dashboard', 'profile');
         // User should be allowed to logout from the site
         $isLogout = $this->input->get('controller', '', 'cmd') == 'account' && $this->input->get('task', '', 'cmd') == 'logout' || $this->input->get('view', '', 'cmd') == 'login' && $this->input->get('layout', '', 'cmd') == 'logout';
         // user should be allowed to save their profile details on the site.
         $isProfileSaving = $this->input->get('controller', '', 'cmd') == 'profile' && $this->input->get('task', '', 'cmd') == 'save';
         if (in_array($view, $redirectView) && !$layout && !$isLogout && !$isProfileSaving) {
             // we need to redirect the user to profile edit page.
             $this->redirect(FRoute::profile(array('layout' => 'edit'), false));
             return;
         }
         // Ensure that the restricted user is not able to view other views
         if (!in_array($view, $allowedViews) && !$isLogout && !$isProfileSaving) {
             return JError::raiseError(500, JText::_('COM_EASYSOCIAL_NOT_ALLOWED_TO_VIEW_SECTION'));
         }
         // Ensure that the user is only viewing the allowed layouts
         if (!in_array($layout, $allowedLayouts) && !$isLogout && !$isProfileSaving) {
             return JError::raiseError(500, JText::_('COM_EASYSOCIAL_NOT_ALLOWED_TO_VIEW_SECTION'));
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Provide a link to social profile.
  *
  * <code>
  * $userId = 1;
  *
  * $profile = new Prism\Integration\Profile\EasySocial(\JFactory::getDbo());
  * $profile->load($userId);
  *
  * $link = $profile->getLink();
  * </code>
  *
  * @param bool $route Route or not the link.
  *
  * @return string Return a link to the profile.
  */
 public function getLink($route = true)
 {
     $link = "";
     if ($route) {
         $options = array('id' => $this->getAlias());
         $link = \FRoute::profile($options);
     }
     return $link;
 }
Exemplo n.º 4
0
        ?>
                    <div>
                        <?php 
        echo $this->loadTemplate('site/profile/button.conversations.new');
        ?>
                    </div>
                    <?php 
    }
    ?>

                <?php 
} else {
    ?>
                    <div>
                        <a href="<?php 
    echo FRoute::profile(array('layout' => 'edit'));
    ?>
" class="btn btn-clean btn-block btn-sm">
                            <i class="ies-cog mr-5"></i>
                            <?php 
    echo JText::_('COM_EASYSOCIAL_PROFILE_UPDATE_PROFILE');
    ?>
                        </a>
                    </div>
                <?php 
}
?>

                <?php 
if ($this->template->get('profile_points', true) && $this->config->get('points.enabled')) {
    ?>
Exemplo n.º 5
0
					<a href="javascript:void(0);">
						<?php 
    echo JText::_("COM_EASYSOCIAL_USE_AS_PROFILE_AVATAR");
    ?>
					</a>
				</li>
				<?php 
}
?>

				<?php 
if ($lib->canSetProfileCover()) {
    ?>
				<li data-photo-profileCover-button>
					<a href="<?php 
    echo FRoute::profile(array('id' => $this->my->getAlias(), 'cover_id' => $photo->id));
    ?>
">
						<?php 
    echo JText::_('COM_EASYSOCIAL_USE_AS_PROFILE_COVER');
    ?>
					</a>
				</li>
				<li class="divider"></li>
				<?php 
}
?>


				<?php 
if ($lib->albumLib->editable() && $lib->isAlbumOwner()) {
Exemplo n.º 6
0
 /**
  * Provide a link to social profile.
  *
  * <code>
  * $userId = 1;
  *
  * $profile = new ITPrismIntegrateProfileEasySocial($userId);
  * $link = $profile->getLink();
  * </code>
  *
  * @return string Return a link to the profile.
  */
 public function getLink()
 {
     $options = array('id' => $this->getAlias());
     return FRoute::profile($options);
 }
Exemplo n.º 7
0
 function getPasswordAndProfileLinks()
 {
     $registerType = $this->params->get('register_type');
     $this->forgotLink = '';
     if ($registerType == "jomsocial" && file_exists(JPATH_BASE . '/components/com_community/libraries/core.php')) {
         $jspath = JPATH_BASE . '/components/com_community';
         include_once $jspath . '/libraries/core.php';
         $this->registerLink = CRoute::_('index.php?option=com_community&view=register');
         $user = JFactory::getUser();
         $this->profileLink = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id);
     } else {
         if ($registerType == 'easysocial' && file_exists(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php')) {
             include_once JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php';
             $this->registerLink = FRoute::registration();
             if (method_exists('FRoute', 'getDefaultItemId')) {
                 $Itemid = '&Itemid=' . FRoute::getDefaultItemId('account');
             } else {
                 $Itemid = '';
             }
             $this->forgotUsernameLink = JRoute::_('index.php?option=com_easysocial&view=account&layout=forgetUsername' . $Itemid);
             $this->forgotPasswordLink = JRoute::_('index.php?option=com_easysocial&view=account&layout=forgetpassword' . $Itemid);
             $this->profileLink = FRoute::profile();
         } else {
             if ($registerType == "communitybuilder" && file_exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php')) {
                 $this->registerLink = JRoute::_("index.php?option=com_comprofiler&task=registers", false);
                 $this->forgotLink = JRoute::_("index.php?option=com_comprofiler&task=lostPassword");
                 $this->forgotUsernameLink = $this->forgotLink;
                 $this->forgotPasswordLink = $this->forgotLink;
                 $this->profileLink = JRoute::_("index.php?option=com_comprofiler", false);
             } else {
                 if ($registerType == "virtuemart" && file_exists(JPATH_ADMINISTRATOR . '/components/com_virtuemart/version.php')) {
                     require_once JPATH_ADMINISTRATOR . '/components/com_virtuemart/version.php';
                     if (class_exists('vmVersion') && property_exists('vmVersion', 'RELEASE')) {
                         if (version_compare('1.99', vmVersion::$RELEASE)) {
                             // -1 if ver1, 1 if 2.0+
                             $this->registerLink = JRoute::_("index.php?option=com_virtuemart&view=user", false);
                         } else {
                             if (file_exists(JPATH_SITE . '/components/com_virtuemart/virtuemart_parser.php')) {
                                 require_once JPATH_SITE . '/components/com_virtuemart/virtuemart_parser.php';
                                 global $sess;
                                 $this->registerLink = $sess->url(SECUREURL . 'index.php?option=com_virtuemart&amp;page=shop.registration');
                             }
                         }
                     }
                     $this->profileLink = '';
                 } else {
                     if ($registerType == 'kunena' && JFolder::exists(JPATH_SITE . '/components/com_kunena')) {
                         $this->profileLink = JRoute::_('index.php?option=com_kunena&view=user', false);
                         $this->registerLink = JRoute::_('index.php?option=com_users&view=registration', false);
                     } else {
                         if ($registerType == 'custom') {
                             $this->profileLink = '';
                             $this->registerLink = $this->getLoginRedirect('registrationlink', false);
                         } else {
                             $this->profileLink = '';
                             $this->registerLink = JRoute::_('index.php?option=com_users&view=registration', false);
                         }
                     }
                 }
             }
         }
     }
     // common for J!, JomSocial, and Virtuemart
     if (!$this->forgotUsernameLink) {
         $this->forgotUsernameLink = JRoute::_('index.php?option=com_users&view=remind', false);
     }
     if (!$this->forgotPasswordLink) {
         $this->forgotPasswordLink = JRoute::_('index.php?option=com_users&view=reset', false);
     }
 }
 /**
  * Get a link to user profile.
  *
  * <code>
  * $ids = array(1, 2, 3, 4);
  * $userId = 1;
  *
  * $profiles = new Prism\Integration\Profiles\EasySocial(\JFactory::getDbo());
  * $profiles->load($ids);
  *
  * $link = $profiles->getLink($userId);
  * </code>
  *
  * @param int $userId
  * @param bool $route Route or not the link.
  *
  * @return string
  */
 public function getLink($userId, $route = true)
 {
     $link = '';
     if (array_key_exists($userId, $this->profiles) and $route) {
         $options = array('id' => $this->getAlias($this->profiles[$userId]));
         $link = \FRoute::profile($options);
     }
     return $link;
 }
Exemplo n.º 9
0
 /**
  * Get a link to user profile.
  *
  * <code>
  * $ids = array(1, 2, 3, 4);
  * $userId = 1;
  *
  * $profiles = new ITPrismIntegrateProfilesEasySocial();
  * $profiles->load($ids);
  *
  * $link = $profiles->getLink($userId);
  * </code>
  *
  * @param integer $userId
  *
  * @return string
  */
 public function getLink($userId)
 {
     if (!isset($this->profiles[$userId])) {
         $link = "";
     } else {
         $options = array('id' => $this->getAlias($this->profiles[$userId]));
         $link = FRoute::profile($options);
     }
     return $link;
 }
Exemplo n.º 10
0
" />
							<?php 
        echo $this->loadTemplate('site/utilities/user.online.state', array('online' => $connection->user->isOnline(), 'size' => 'mini'));
        ?>
						</a>
					</div>
				</div>
			</div>
			<div class="media-body">
				<div class="pull-right object-action">
					<div class="es-action" data-friend-item-actions>

						<i class="loading-indicator fd-small"></i>

						<a class="btn btn-es-primary btn-small view-profile" href="<?php 
        echo FRoute::profile(array('id' => $connection->user->getAlias()));
        ?>
" data-friend-item-action>
							<?php 
        echo JText::_('COM_EASYSOCIAL_VIEW_PROFILE_BUTTON');
        ?>
 <i class="ies-arrow-right ies-small ies-white"></i>
						</a>
						<a class="btn btn-es btn-small reject-friend" href="javascript:void(0);" data-friend-item-reject data-friend-item-action data-id="<?php 
        echo $connection->id;
        ?>
">
							<?php 
        echo JText::_('COM_EASYSOCIAL_REJECT_BUTTON');
        ?>
						</a>
Exemplo n.º 11
0
 /**
  * Gets the user permalink for the app
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function getUserPermalink($userAlias)
 {
     // Get the profile view
     $view = $this->getViews('profile');
     $type = $view->type;
     // The app is embedded on the page
     if ($type == 'embed') {
         $url = FRoute::profile(array('id' => $userAlias, 'appId' => $this->getAlias()));
         return $url;
     }
     // If it's a canvas view
     $url = FRoute::apps(array('id' => $this->getAlias(), 'layout' => 'canvas', 'type' => 'user', 'uid' => $userAlias));
     return $url;
 }
Exemplo n.º 12
0
					<?php 
        echo JText::_('COM_EASYSOCIAL_PROFILE_LAST_SEEN');
        ?>
, <strong><?php 
        echo $user->getLastVisitDate('lapsed');
        ?>
</strong>
				</li>
				<?php 
    }
    ?>
			</ul>

			<div class="fd-small">
				<a href="<?php 
    echo FRoute::profile(array('id' => $user->getAlias(), 'layout' => 'about'));
    ?>
"><?php 
    echo JText::_('COM_EASYSOCIAL_PROFILE_MORE_INFO');
    ?>
</a>

				<?php 
    if ($this->access->allowed('reports.submit')) {
        ?>
				&bull;
				<?php 
        echo FD::reports()->getForm('com_easysocial', SOCIAL_TYPE_USER, $user->id, $user->getName(), JText::_('COM_EASYSOCIAL_PROFILE_REPORT_USER'), '', JText::_('COM_EASYSOCIAL_PROFILE_REPORT_USER_DESC'), $user->getPermalink(true, true));
        ?>
				<?php 
    }
Exemplo n.º 13
0
 /**
  * Redirects users view to easysocial
  *
  * @since	1.0
  * @access	public
  * @return
  */
 public function processUsersRedirection()
 {
     $doc = JFactory::getDocument();
     if ($doc->getType() != 'html') {
         return;
     }
     // Check if the admin wants to enable this
     if (!$this->params->get('redirection', true)) {
         return;
     }
     // If this is registration from com_users, redirect to the appropriate page.
     if ($this->isUserRegistration()) {
         // Redirect to EasySocial's registration
         $url = FRoute::registration(array(), false);
         return $this->app->redirect($url);
     }
     // If this is username reminder, redirect to the appropriate page.
     if ($this->isUserRemind()) {
         // Redirect to EasySocial's registration
         $url = FRoute::account(array('layout' => 'forgetUsername'), false);
         return $this->app->redirect($url);
     }
     // If this is password reset, redirect to the appropriate page.
     if ($this->isUserReset()) {
         // Redirect to EasySocial's registration
         $url = FRoute::account(array('layout' => 'forgetPassword'), false);
         return $this->app->redirect($url);
     }
     // If this is password reset, redirect to the appropriate page.
     if ($this->isUserLogin()) {
         // Determine if there's any "return" url in the query string
         $return = JRequest::getVar('return');
         if ($return) {
             FD::setCallback(base64_decode($return));
         }
         // Redirect to EasySocial's registration
         $url = FRoute::login(array(), false);
         return $this->app->redirect($url);
     }
     // If this is password reset, redirect to the appropriate page.
     if ($this->isUserProfile()) {
         // Redirect to EasySocial's registration
         $url = FRoute::profile(array(), false);
         return $this->app->redirect($url);
     }
 }
Exemplo n.º 14
0
 public function getEditURL()
 {
     return FRoute::profile(array('layout' => 'edit'));
 }
Exemplo n.º 15
0
 /**
  * Gets the user profile url of selected <code>system</code>. Currently supported systems are <br><br> 
  * 
  * JomSocial - jomsocial, Community Builder - cb, Touch - touch, Kunena - kunena, Alpha User Points - aup
  * 
  * @param string $system User profile system
  * @param int $userid user id
  * @param string $username User name to be used to display with link
  * @param array $links array of links for mighty touch
  * @param path_only boolean want to retrive just the url or the full html hyperlink markup?
  * 
  * @return string user profile url
  */
 public static function get_user_profile_url($system, $userid = 0, $username = '******', $path_only = true, $attribs = array())
 {
     $link = null;
     switch ($system) {
         case 'cjforum':
             $api = JPATH_ROOT . '/components/com_cjforum/helpers/api.php';
             if (file_exists($api)) {
                 require_once $api;
                 $link = CjForumApi::get_user_profile_url($userid, $path_only, $attribs);
             }
             break;
         case 'cjblog':
             $api = JPATH_ROOT . DS . 'components' . DS . 'com_cjblog' . DS . 'api.php';
             if (file_exists($api)) {
                 require_once $api;
                 $link = CjBlogApi::get_user_profile_url($userid, 'name', $path_only, $attribs);
             }
             break;
         case 'jomsocial':
             $jspath = JPATH_BASE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php';
             if (file_exists($jspath)) {
                 include_once $jspath;
                 if ($path_only) {
                     $link = CRoute::_('index.php? option=com_community&view=profile&userid=' . $userid);
                 } else {
                     $link = JHtml::link(CRoute::_('index.php? option=com_community&view=profile&userid=' . $userid), $username, $attribs);
                 }
             }
             break;
         case 'cb':
             global $_CB_framework, $_CB_database, $ueConfig, $mainframe;
             $api = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
             if (!is_file($api)) {
                 return;
             }
             require_once $api;
             cbimport('cb.database');
             cbimport('cb.tables');
             cbimport('language.front');
             cbimport('cb.field');
             $url = cbSef('index.php?option=com_comprofiler&amp;task=userProfile&amp;user='******'kunena':
             if (CJFunctions::_initialize_kunena() && $userid > 0) {
                 $user = KunenaFactory::getUser($userid);
                 if ($user === false) {
                     break;
                 }
                 if ($path_only) {
                     $link = KunenaRoute::_('index.php?option=com_kunena&func=profile&userid=' . $user->userid, true);
                 } else {
                     $link = JHtml::link(KunenaRoute::_('index.php?option=com_kunena&func=profile&userid=' . $user->userid, true), $user->name, $attribs);
                 }
             }
             break;
         case 'aup':
             $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
             if (file_exists($api_AUP)) {
                 require_once $api_AUP;
                 if ($path_only) {
                     $link = AlphaUserPointsHelper::getAupLinkToProfil($userid);
                 } else {
                     $link = JHtml::link(AlphaUserPointsHelper::getAupLinkToProfil($userid), $username, $attribs);
                 }
             }
             break;
         case 'easysocial':
             $api = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_easysocial' . DS . 'includes' . DS . 'foundry.php';
             if (file_exists($api)) {
                 require_once $api;
                 $my = Foundry::user($userid);
                 $link = FRoute::profile(array('id' => $my->getAlias()));
                 if (!$path_only) {
                     $username = $my->getName();
                     $link = JHtml::link($link, $username, $attribs);
                 }
             }
             break;
     }
     return null == $link ? $username : $link;
 }
Exemplo n.º 16
0
 public static function checkCompleteProfile()
 {
     $config = FD::config();
     $my = FD::user();
     // If user is not registered, or no profile id, or settings is not enabled, we cannot do anything to check
     if (empty($my->id) || empty($my->profile_id) || !$config->get('user.completeprofile.required', false)) {
         return true;
     }
     $total = $my->getProfile()->getTotalFields(SOCIAL_PROFILES_VIEW_EDIT);
     $filled = $my->completed_fields;
     // Avoid using maintenance script to do this because it is possible that a site might have >1000 users
     // Using this method instead so that every user will at least get executed once during login
     // Won't happen on subsequent logins
     if (empty($filled)) {
         $fields = FD::model('Fields')->getCustomFields(array('profile_id' => $my->getProfile()->id, 'data' => true, 'dataId' => $my->id, 'dataType' => SOCIAL_TYPE_USER, 'visible' => SOCIAL_PROFILES_VIEW_EDIT, 'group' => SOCIAL_FIELDS_GROUP_USER));
         $args = array(&$my);
         $completedFields = FD::fields()->trigger('onProfileCompleteCheck', SOCIAL_FIELDS_GROUP_USER, $fields, $args);
         $table = FD::table('Users');
         $table->load(array('user_id' => $my->id));
         $table->completed_fields = count($completedFields);
         $table->store();
         $filled = $table->completed_fields;
     }
     if ($total == $filled) {
         return true;
     }
     $percentage = (int) ($filled / $total * 100);
     if ($percentage < 100) {
         $action = $config->get('user.completeprofile.action', 'info');
         if ($action === 'redirect') {
             $mainframe = JFactory::getApplication();
             $mainframe->redirect(FRoute::profile(array('layout' => 'edit')));
         }
         if ($action === 'info' || $action === 'infoprofile' && JRequest::getVar('view') === 'profile') {
             $incompleteMessage = JText::sprintf('COM_EASYSOCIAL_PROFILE_YOUR_PROFILE_IS_INCOMPLETE', $percentage, FRoute::profile(array('layout' => 'edit')));
             FD::info()->set(false, $incompleteMessage, SOCIAL_MSG_WARNING, 'easysocial.profilecompletecheck');
         }
         return false;
     }
     return true;
 }
Exemplo n.º 17
0
 public static function getEditProfileLink()
 {
     $default = EBR::_('index.php?option=com_easyblog&view=dashboard&layout=profile');
     $config = EasyBlogHelper::getConfig();
     if ($config->get('integrations_easysocial_editprofile')) {
         $easysocial = EasyBlogHelper::getHelper('EasySocial');
         if ($easysocial->exists()) {
             $default = FRoute::profile(array('layout' => 'edit'));
         }
     }
     return $default;
 }
Exemplo n.º 18
0
 /**
  * Centralized method to retrieve a person's profile link.
  * This is where all the magic happens.
  *
  * @access	public
  * @param	null
  *
  * @return	string	The url for the person
  */
 public function getPermalink($xhtml = true, $external = false, $sef = true)
 {
     // If user is blocked, just use a dummy link
     if ($this->isBlock()) {
         return 'javascript:void(0);';
     }
     $options = array('id' => $this->getAlias());
     if ($external) {
         $options['external'] = true;
     }
     $options['sef'] = $sef;
     $url = FRoute::profile($options, $xhtml);
     return $url;
 }
Exemplo n.º 19
0
 /**
  * Shorthand function to send notification for various actions.
  *
  * @author Jason Rey <*****@*****.**>
  * @since  1.2
  * @access private
  * @param  string    $verb   The action string.
  * @param  integer   $actor  The acting user id.
  * @param  integer   $target The targeted user id.
  */
 private function notify($verb, $actor, $target)
 {
     $actor = FD::user($actor);
     $target = FD::user($target);
     $emailOptions = array('title' => 'PLG_FIELDS_RELATIONSHIP_EMAIL_TITLE_' . strtoupper($verb), 'template' => 'fields/user/relationship/' . $verb, 'actor' => $actor->getName(), 'posterName' => $actor->getName(), 'posterAvatar' => $actor->getAvatar(), 'posterLink' => $actor->getPermalink(true, true), 'recipientName' => $target->getName(), 'type' => $this->type, 'link' => FRoute::profile(array('layout' => 'edit', 'external' => true), true));
     $systemOptions = array('uid' => $this->id, 'actor_id' => $actor->id, 'type' => 'relationship', 'title' => 'APP_USER_RELATIONSHIP_NOTIFICATION_TITLE_' . strtoupper($verb), 'url' => FRoute::profile(array('layout' => 'edit', 'sef' => false)), 'image' => $actor->getAvatar(SOCIAL_AVATAR_LARGE), 'context_type' => 'apps.user.relationship.' . $verb);
     // relationship.request
     // relationship.approve
     // relationship.reject
     FD::notify('relationship.' . $verb, array($target->id), $emailOptions, $systemOptions);
 }
Exemplo n.º 20
0
    ?>
					</a>
				</li>
				<li>
					<a href="<?php 
    echo FRoute::profile(array('layout' => 'editPrivacy'));
    ?>
">
						<i class="ies-key ies-small mr-5"></i> <?php 
    echo JText::_('COM_EASYSOCIAL_TOOLBAR_PRIVACY_SETTINGS');
    ?>
					</a>
				</li>
				<li>
					<a href="<?php 
    echo FRoute::profile(array('layout' => 'editNotifications'));
    ?>
">
						<i class="ies-mail-3 ies-small mr-5"></i> <?php 
    echo JText::_('COM_EASYSOCIAL_TOOLBAR_NOTIFICATION_SETTINGS');
    ?>
					</a>
				</li>
				<?php 
    if ($this->template->get('show_browse_users', true) || $this->template->get('show_advanced_search', true)) {
        ?>
				<li class="divider"></li>
					<li>
						<h5 class="ml-10">
							<i class="ies-podcast"></i> <?php 
        echo JText::_('COM_EASYSOCIAL_TOOLBAR_PROFILE_DISCOVER');
Exemplo n.º 21
0
            ?>
"
    			>
    				<i class="ies-home"></i>
    			</a>
    		</li>
    		<?php 
        }
        ?>

    		<li class="<?php 
        echo $view == 'profile' && !$userId ? 'active' : '';
        ?>
">
    			<a href="<?php 
        echo FRoute::profile();
        ?>
">
    				<?php 
        echo JText::_('COM_EASYSOCIAL_TOOLBAR_PROFILE_VIEW_YOUR_PROFILE');
        ?>
    			</a>
    		</li>
    		<li class="<?php 
        echo $view == 'friends' && $layout != 'invite' ? 'active' : '';
        ?>
">
    			<a href="<?php 
        echo FRoute::friends();
        ?>
">
Exemplo n.º 22
0
 public function streamSchema($rows, $userid)
 {
     $result = array();
     foreach ($rows as $ky => $row) {
         if (isset($row->uid)) {
             $item = new streamSimpleSchema();
             //new code
             // Set the stream title
             $item->id = $row->uid;
             //$item->title = strip_tags($row->title);
             //code changed as request not right way
             $item->title = $row->title;
             if ($row->type != 'links') {
                 $item->title = str_replace('href="', 'href="' . JURI::root(), $item->title);
             }
             $item->type = $row->type;
             $item->group = $row->cluster_type;
             $item->element_id = $row->contextId;
             //
             $item->content = $row->content;
             //$item->preview = $row->preview;
             //hari - code for build video iframe
             //check code optimisation
             $frame_match = preg_match('/;iframe.*?>/', $row->preview);
             if ($frame_match) {
                 $dom = new DOMDocument();
                 $dom->loadHTML($row->preview);
                 foreach ($dom->getElementsByTagName('a') as $node) {
                     $first = $node->getAttribute('href');
                     break;
                 }
                 if (strstr($first, "youtu.be")) {
                     $first = preg_replace("/\\s+/", '', $first);
                     $first = preg_replace("/youtu.be/", "youtube.com/embed", $first);
                     $abc = $first . "?feature=oembed";
                     $item->preview = '<div class="video-container"><iframe src="' . $abc . '" frameborder="0" allowfullscreen=""></iframe></div>';
                 } else {
                     $df = preg_replace("/\\s+/", '', $first);
                     $df = preg_replace("/watch\\?v=([a-zA-Z0-9\\]+)([a-zA-Z0-9\\/\\\\?\\&\\;\\%\\=\\.])/i", "embed/\$1 ", $first);
                     $abc = $df . "?feature=oembed";
                     $df = preg_replace("/\\s+/", '', $abc);
                     $item->preview = '<div class="video-container"><iframe src="' . $df . '" frameborder="0" allowfullscreen=""></iframe></div>';
                 }
             } else {
                 $item->preview = $row->preview;
             }
             //end
             // Set the stream content
             if (!empty($item->preview)) {
                 $item->raw_content_url = $row->preview;
             } elseif (!empty($item->content)) {
                 $item->raw_content_url = $row->content;
             }
             //code for easyblog / easydisucss share , img path not proper
             if (strpos($item->raw_content_url, 'src="//')) {
                 $item->raw_content_url = str_replace('src="//', 'src="' . 'http://', $item->raw_content_url);
             }
             if (strpos($item->content, 'src="//')) {
                 $item->content = str_replace('src="//', 'src="' . 'http://', $item->content);
             }
             if ($row->type != 'links') {
                 $item->raw_content_url = str_replace('href="', 'href="' . JURI::root(), $item->raw_content_url);
             }
             // Set the publish date
             $item->published = $row->created->toMySQL();
             /*
             // Set the generator
             $item->generator = new stdClass();
             $item->generator->url = JURI::root();
             
             // Set the generator
             $item->provider = new stdClass();
             $item->provider->url = JURI::root();
             */
             // Set the verb
             $item->verb = $row->verb;
             //create users object
             $actors = array();
             $user_url = array();
             foreach ($row->actors as $actor) {
                 $user_url[$actor->id] = JURI::root() . FRoute::profile(array('id' => $actor->id, 'layout' => 'item', 'sef' => false));
                 $actors[] = $this->createUserObj($actor->id);
             }
             //with share obj users object
             //$with_usr = array();
             $with_user_url = array();
             foreach ($row->with as $actor) {
                 $withurl = JURI::root() . FRoute::profile(array('id' => $actor->id, 'layout' => 'item', 'sef' => false));
                 $with_user_url[] = "<a href='" . $withurl . "'>" . $actor->username . "</a>";
                 //$with_url = $with_url." and ".
                 //$with_user_url[] = $this->createUserObj($actor->id);
             }
             $item->with = null;
             //to maintain site view for with url
             if (!empty($with_user_url)) {
                 $cnt = sizeof($with_user_url);
                 $item->with = 'with ' . $with_user_url[0];
                 for ($i = 0; $i < $cnt - 2; $i++) {
                     $item->with = $item->with . ', ' . $with_user_url[$i + 1];
                 }
                 if ($cnt - 1 != 0) {
                     $item->with = $item->with . ' and ' . $with_user_url[$cnt - 1];
                 }
             }
             //
             $item->actor = $actors;
             //This node is for Report-flag for the posts.
             $item->isself = $actors[0]->id == $userid ? true : false;
             $item->likes = !empty($row->likes) ? $this->createlikeObj($row->likes, $userid) : null;
             if (!empty($row->comments->element)) {
                 $item->comment_element = $row->comments->element . "." . $row->comments->group . "." . $row->comments->verb;
                 $row->comments->stream_id = $row->comments->options['streamid'];
             } else {
                 $item->comment_element = null;
             }
             $item->comments = !empty($row->comments->uid) ? $this->createCommentsObj($row->comments) : null;
             // These properties onwards are not activity stream specs
             $item->icon = $row->fonticon;
             // Set the lapsed time
             $item->lapsed = $row->lapsed;
             // set the if this stream is mini mode or not.
             // mini mode should not have any actions such as - likes, comments, share and etc.
             $item->mini = $row->display == SOCIAL_STREAM_DISPLAY_MINI ? true : false;
             //build share url use for share post through app
             $sharing = FD::get('Sharing', array('url' => FRoute::stream(array('layout' => 'item', 'id' => $row->uid, 'external' => true, 'xhtml' => true)), 'display' => 'dialog', 'text' => JText::_('COM_EASYSOCIAL_STREAM_SOCIAL'), 'css' => 'fd-small'));
             $item->share_url = $sharing->url;
             // Check if this item has already been bookmarked
             $sticky = FD::table('StreamSticky');
             $item->isPinned = null;
             if ($sticky) {
                 $item->isPinned = $sticky->load(array('stream_id' => $row->uid));
             }
             //create urls for app side mapping
             //$log_usr = FRoute::profile( array('id' => $row->uid , 'layout' => 'item', 'sef' => false ));
             $strm_urls = array();
             $strm_urls['actors'] = $user_url;
             /*switch( $row->type )
             		{
             			case 'discussions': $strm_urls['discussions'] = JURI::root().FRoute::apps( array('id' => $row->uid , 'layout' => 'canvas', 'sef' => false ));
             			//FRoute::apps( array( 'layout' => 'canvas' , 'customView' => 'item' , 'uid' => $group->getAlias() , 'type' => SOCIAL_TYPE_GROUP , 'id' => $this->getApp()->getAlias() , 'discussionId' => $discussion->id ) , false );
             							break;
             			case 'apps':	$strm_urls['apps'] = JURI::root().FRoute::apps( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'dashboard':	$strm_urls['dashboard'] = JURI::root().FRoute::dashboard( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'albums':	$strm_urls['album'] = JURI::root().FRoute::albums( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'photos':	$strm_urls['photos'] = JURI::root().FRoute::photos( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'groups':	$strm_urls['groups'] = JURI::root().FRoute::groups( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'links':	$lnk_arr = explode('shared', $item->title);
             							
             							preg_match_all('/href=\"(.*?)\"/i', $lnk_arr[1], $matches);
             							$strm_urls['links'] = $matches[1][0];
             							break;
             		}
             		
             		$item->strm_urls = $strm_urls; */
             $result[] = $item;
             //$result[]	= $row;
             //end new
         }
     }
     return $result;
 }
Exemplo n.º 23
0
 public function initInfo()
 {
     FD::checkToken();
     $view = $this->getCurrentView();
     $id = JRequest::getInt('id');
     $user = FD::user($id);
     if (empty($user) || empty($user->id) || $user->isBlock()) {
         $view->setMessage(JText::_('COM_EASYSOCIAL_USERS_NO_SUCH_USER'), SOCIAL_MSG_ERROR);
         return $view->call(__FUNCTION__);
     }
     $my = FD::user();
     $privacy = $my->getPrivacy();
     // @privacy: Let's test if the current viewer is allowed to view this profile.
     if ($my->id != $user->id && !$privacy->validate('profiles.view', $user->id, SOCIAL_TYPE_USER)) {
         $view->setMessage(JText::_('COM_EASYSOCIAL_PROFILE_PRIVACY_NOT_ALLOWED'), SOCIAL_MSG_ERROR);
         return $view->call(__FUNCTION__);
     }
     FD::language()->loadAdmin();
     $steps = FD::model('Steps')->getSteps($user->profile_id, SOCIAL_TYPE_PROFILES, SOCIAL_PROFILES_VIEW_DISPLAY);
     $fieldsLib = FD::fields();
     $fieldsModel = FD::model('Fields');
     $index = 1;
     foreach ($steps as $step) {
         $step->fields = $fieldsModel->getCustomFields(array('step_id' => $step->id, 'data' => true, 'dataId' => $user->id, 'dataType' => SOCIAL_TYPE_USER, 'visible' => SOCIAL_PROFILES_VIEW_DISPLAY));
         if (!empty($step->fields)) {
             $args = array($user);
             $fieldsLib->trigger('onDisplay', SOCIAL_FIELDS_GROUP_USER, $step->fields, $args);
         }
         $step->hide = true;
         foreach ($step->fields as $field) {
             // As long as one of the field in the step has an output, then this step shouldn't be hidden
             // If step has been marked false, then no point marking it as false again
             // We don't break from the loop here because there is other checking going on
             if (!empty($field->output) && $step->hide === true) {
                 $step->hide = false;
             }
         }
         if ($index === 1) {
             $step->url = FRoute::profile(array('id' => $user->getAlias(), 'layout' => 'about'), false);
         } else {
             $step->url = FRoute::profile(array('id' => $user->getAlias(), 'layout' => 'about', 'step' => $index), false);
         }
         $step->title = $step->get('title');
         $step->active = !$step->hide && $index == 1;
         if ($step->active) {
             $theme = FD::themes();
             $theme->set('fields', $step->fields);
             $step->html = $theme->output('site/profile/default.info');
         }
         $step->index = $index;
         $index++;
     }
     return $view->call(__FUNCTION__, $steps);
 }
Exemplo n.º 24
0
 /**
  * Post process after removing an avatar
  *
  * @since	1.0
  * @access	public
  */
 public function removeAvatar()
 {
     FD::info()->set($this->getMessage());
     $my = FD::user();
     $this->redirect(FRoute::profile(array('id' => $my->getAlias()), false));
 }
Exemplo n.º 25
0
 public function streamSchema($rows, $userid)
 {
     $result = array();
     foreach ($rows as $ky => $row) {
         if (isset($row->uid)) {
             $item = new streamSimpleSchema();
             //new code
             // Set the stream title
             $item->id = $row->uid;
             //$item->title = strip_tags($row->title);
             //code changed as request not right way
             $item->title = $row->title;
             if ($row->type != 'links') {
                 $item->title = str_replace('href="', 'href="' . JURI::root(), $item->title);
             }
             $item->type = $row->type;
             $item->group = $row->cluster_type;
             $item->element_id = $row->contextId;
             //
             $item->content = $row->content;
             $item->preview = $row->preview;
             // Set the stream content
             if (!empty($item->preview)) {
                 $item->raw_content_url = $row->preview;
             } elseif (!empty($item->content)) {
                 $item->raw_content_url = $row->content;
             }
             if ($row->type != 'links') {
                 $item->raw_content_url = str_replace('href="', 'href="' . JURI::root(), $item->raw_content_url);
             }
             // Set the publish date
             $item->published = $row->created->toMySQL();
             /*
             // Set the generator
             $item->generator = new stdClass();
             $item->generator->url = JURI::root();
             
             // Set the generator
             $item->provider = new stdClass();
             $item->provider->url = JURI::root();
             */
             // Set the verb
             $item->verb = $row->verb;
             //create users object
             $actors = array();
             $user_url = array();
             foreach ($row->actors as $actor) {
                 $user_url[$actor->id] = JURI::root() . FRoute::profile(array('id' => $actor->id, 'layout' => 'item', 'sef' => false));
                 $actors[] = $this->createUserObj($actor->id);
             }
             //with share obj users object
             //$with_usr = array();
             $with_user_url = array();
             foreach ($row->with as $actor) {
                 $withurl = JURI::root() . FRoute::profile(array('id' => $actor->id, 'layout' => 'item', 'sef' => false));
                 $with_user_url[] = "<a href='" . $withurl . "'>" . $actor->username . "</a>";
                 //$with_url = $with_url." and ".
                 //$with_user_url[] = $this->createUserObj($actor->id);
             }
             $item->with = null;
             //to maintain site view for with url
             if (!empty($with_user_url)) {
                 $cnt = sizeof($with_user_url);
                 $item->with = 'with ' . $with_user_url[0];
                 for ($i = 0; $i < $cnt - 2; $i++) {
                     $item->with = $item->with . ', ' . $with_user_url[$i + 1];
                 }
                 if ($cnt - 1 != 0) {
                     $item->with = $item->with . ' and ' . $with_user_url[$cnt - 1];
                 }
             }
             //
             $item->actor = $actors;
             $item->likes = !empty($row->likes) ? $this->createlikeObj($row->likes, $userid) : null;
             if (!empty($row->comments->element)) {
                 $item->comment_element = $row->comments->element . "." . $row->comments->group . "." . $row->comments->verb;
             } else {
                 $item->comment_element = null;
             }
             $item->comments = !empty($row->comments->uid) ? $this->createCommentsObj($row->comments) : null;
             // These properties onwards are not activity stream specs
             $item->icon = $row->fonticon;
             // Set the lapsed time
             $item->lapsed = $row->lapsed;
             // set the if this stream is mini mode or not.
             // mini mode should not have any actions such as - likes, comments, share and etc.
             $item->mini = $row->display == SOCIAL_STREAM_DISPLAY_MINI ? true : false;
             //build share url use for share post through app
             $sharing = FD::get('Sharing', array('url' => FRoute::stream(array('layout' => 'item', 'id' => $row->uid, 'external' => true, 'xhtml' => true)), 'display' => 'dialog', 'text' => JText::_('COM_EASYSOCIAL_STREAM_SOCIAL'), 'css' => 'fd-small'));
             $item->share_url = $sharing->url;
             // Check if this item has already been bookmarked
             $sticky = FD::table('StreamSticky');
             $item->isPinned = $sticky->load(array('stream_id' => $row->uid));
             //create urls for app side mapping
             //$log_usr = FRoute::profile( array('id' => $row->uid , 'layout' => 'item', 'sef' => false ));
             $strm_urls = array();
             $strm_urls['actors'] = $user_url;
             /*switch( $row->type )
             		{
             			case 'discussions': $strm_urls['discussions'] = JURI::root().FRoute::apps( array('id' => $row->uid , 'layout' => 'canvas', 'sef' => false ));
             			//FRoute::apps( array( 'layout' => 'canvas' , 'customView' => 'item' , 'uid' => $group->getAlias() , 'type' => SOCIAL_TYPE_GROUP , 'id' => $this->getApp()->getAlias() , 'discussionId' => $discussion->id ) , false );
             							break;
             			case 'apps':	$strm_urls['apps'] = JURI::root().FRoute::apps( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'dashboard':	$strm_urls['dashboard'] = JURI::root().FRoute::dashboard( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'albums':	$strm_urls['album'] = JURI::root().FRoute::albums( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'photos':	$strm_urls['photos'] = JURI::root().FRoute::photos( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'groups':	$strm_urls['groups'] = JURI::root().FRoute::groups( array('id' => $row->element_id , 'layout' => 'item', 'sef' => false ));
             							break;
             			case 'links':	$lnk_arr = explode('shared', $item->title);
             							
             							preg_match_all('/href=\"(.*?)\"/i', $lnk_arr[1], $matches);
             							$strm_urls['links'] = $matches[1][0];
             							break;
             		}
             		
             		$item->strm_urls = $strm_urls; */
             $result[] = $item;
             //$result[]	= $row;
             //end new
         }
     }
     return $result;
 }
Exemplo n.º 26
0
 /**
  * Get a link to user profile.
  *
  * <code>
  * $ids = array(1, 2, 3, 4);
  * $userId = 1;
  *
  * $profiles = new Prism\Integration\Profiles\EasySocial(\JFactory::getDbo());
  * $profiles->load($ids);
  *
  * $link = $profiles->getLink($userId);
  * </code>
  *
  * @param int $userId
  * @param bool $route Route or not the link.
  *
  * @return string
  */
 public function getLink($userId, $route = true)
 {
     $link = "";
     if (isset($this->profiles[$userId]) and $route) {
         $options = array('id' => $this->getAlias($this->profiles[$userId]));
         $link = \FRoute::profile($options);
     }
     return $link;
 }
Exemplo n.º 27
0
 public static function getResetPasswordLink()
 {
     $config = DiscussHelper::getConfig();
     $default = JRoute::_('index.php?option=com_user&view=reset');
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         $default = JRoute::_('index.php?option=com_users&view=reset');
     }
     switch ($config->get('main_login_provider')) {
         case 'joomla':
         case 'cb':
         case 'jomsocial':
             $link = $default;
             break;
         case 'easysocial':
             $easysocial = DiscussHelper::getHelper('EasySocial');
             if ($easysocial->exists()) {
                 $link = FRoute::profile(array('layout' => 'forgetPassword'));
             } else {
                 $link = $default;
             }
             break;
     }
     return $link;
 }
Exemplo n.º 28
0
?>
" />
                                    </div>
                                        <table align="center" width="540" style="clear:both;margin:auto 20px">
                                            <tr>
                                                <td style="line-height:1.5;color:#555;font-family:'Lucida Grande',Tahoma,Arial;font-size:12px;text-align:center">
													<?php 
if ($manageAlerts) {
    ?>
                                                    <div style="font-size:11px; color:#999; line-height:13px;padding: 20px">
                                                        <?php 
    echo JText::_('COM_EASYSOCIAL_EMAILS_FOOTER_BECAUSE');
    ?>
<br /><br />
                                                        <a href="<?php 
    echo FRoute::profile(array('layout' => 'editNotifications', 'external' => true));
    ?>
" style="color:#00aeef; text-decoration:none;"><?php 
    echo JText::_('COM_EASYSOCIAL_EMAILS_MANAGE_ALERTS');
    ?>
</a>
                                                    </div>
                                                    <?php 
} else {
    ?>
<br /><br /><?php 
}
?>
                                                </td>
                                            </tr>
                                        </table>
Exemplo n.º 29
0
</span>

        <table width="520" align="center" style="border:1px solid #ebebeb" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                    <table width="250" align="center">
                        <tr>
                            <td valign="top" style="padding: 10px 0;">
                                <img src="<?php 
echo rtrim(JURI::root(), '/');
?>
/components/com_easysocial/themes/wireframe/images/emails/icon-user.png" alt="" />
                            </td>
                            <td valign="top" style="text-align:left;padding: 10px 0;font-size:12px;">
                                <a href="<?php 
echo FRoute::profile(array('layout' => 'edit', 'external' => true));
?>
" style="text-decoration:none;color:#00aeef;">
                                    <?php 
echo JText::_('COM_EASYSOCIAL_EMAILS_UPDATE_YOUR_PROFILE');
?>
                                </a>
                                <p style="margin: 5px 0 0;color:#888;">
                                    <?php 
echo JText::_('COM_EASYSOCIAL_EMAILS_UPDATE_YOUR_PROFILE_DESC');
?>
                                </p>
                            </td>
                        </tr>
                    </table>
                </td>
Exemplo n.º 30
0
"
										data-id="<?php 
        echo $user->id;
        ?>
"
										data-layout="<?php 
        echo $app->getViews('profile')->type;
        ?>
"
										data-namespace="site/controllers/profile/getAppContents"
										data-canvas-url="<?php 
        echo FRoute::apps(array('id' => $app->getAlias(), 'layout' => 'canvas', 'uid' => $user->getAlias(), 'type' => SOCIAL_TYPE_USER));
        ?>
"
										data-embed-url="<?php 
        echo FRoute::profile(array('id' => $user->getAlias(), 'appId' => $app->getAlias()));
        ?>
"
										data-title="<?php 
        echo $app->getPageTitle();
        ?>
"
										data-profile-apps-item
									>
										<a href="javascript:void(0);">

											<img src="<?php 
        echo $app->getIcon();
        ?>
" class="app-icon-small mr-5" /> <?php 
        echo $app->getAppTitle();