Файловый менеджер - Редактировать - /var/www/html/components/com_community/templates/jomsocial/layouts/profile/hovercard.php
Ðазад
<?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 */ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; defined('_JEXEC') or die(); $params = $user->getParams(); $config = CFactory::getConfig(); $my = CFactory::getUser(); $isMine = COwnerHelper::isMine($my->id, $user->id); $isFriend = CFriendsHelper::isConnected($user->id, $my->id) && $user->id != $my->id; $isWaitingApproval = CFriendsHelper::isWaitingApproval($my->id, $user->id); $isWaitingResponse = CFriendsHelper::isWaitingApproval($user->id, $my->id); $isBlocked = $user->isBlocked(); $showUserInfo = $config->get('memberlist_show_profile_info'); $loggedIn = $my->id != 0; //links information $photoEnabled = ($config->get('enablephotos')) ? true : false; $eventEnabled = ($config->get('enableevents')) ? true : false; $groupEnabled = ($config->get('enablegroups')) ? true : false; $videoEnabled = ($config->get('enablevideos')) ? true : false; $pollsEnabled = ($config->get('enablepolls')) ? true : false; //likes CFactory::load('libraries', 'like'); $like = new Clike(); $isLikeEnabled = $like->enabled('profile') && $params->get('profileLikes', 1) ? 1 : 0; $isUserLiked = $like->userLiked('profile', $user->id, $my->id); /* likes count */ $likes = $like->getLikeCount('profile', $user->id); $profileFields = ''; $themeModel = CFactory::getModel('theme'); $profileModel = CFactory::getModel('profile'); $settings = $themeModel->getSettings('profile'); $profile = $profileModel->getViewableProfile($user->id, $user->getProfileType()); $profile = Joomla\Utilities\ArrayHelper::toObject($profile); $groupmodel = CFactory::getModel('groups'); $profile->_groups = $groupmodel->getGroupsCount($profile->id); $eventmodel = CFactory::getModel('events'); $profile->_events = $eventmodel->getEventsCount($profile->id); $profile->_friends = $user->_friendcount; $videoModel = CFactory::getModel('Videos'); $profile->_videos = $videoModel->getVideosCount($profile->id); $photosModel = CFactory::getModel('photos'); $profile->_photos = $photosModel->getPhotosCount($profile->id); $pollsModel = CFactory::getModel('polls'); $profile->_polls = $pollsModel->getPollsCount($profile->id); $modelFollower = CFactory::getModel('followers'); $isFollowing = $modelFollower->isFollowing($my->id, $user->id); if($config->get('profile_multiprofile') && isset($settings['profile'][$user->_profile_id]['tagline']) && strlen($settings['profile'][$user->_profile_id]['tagline'])) { $blocks = json_decode($settings['profile'][$user->_profile_id]['tagline'], true); } else if (isset($settings['profile']['tagline']) && strlen($settings['profile']['tagline'])) { $blocks = json_decode($settings['profile']['tagline'], true); } if (isset($blocks)) { $blockEnabled = true; foreach ($blocks as $block) { $blockString = ""; if(strlen($block['before'])) $blockString .= Text::_($block['before']); if(strlen($block['field'])) { if ( isset($profile->fieldsById->{$block['field']}) && strlen((string)$profile->fieldsById->{$block['field']}->value) ) { $blockString .= $themeModel->formatField($profile->fieldsById->{$block['field']}); $blockEnabled = true; } else { $blockEnabled = false; } } if(strlen($block['after'])) $blockString .= Text::_($block['after']); if($block['spaceafter']) $blockString .= "\n"; if($blockEnabled) { $profileFields .= $blockString; } } $profileFields = preg_replace("/(\s)*([,.:\-_&])*(\s)*$/", "", preg_replace("/^(\s)*([,.:\-_&])*/", "", $profileFields)); } ?> <div class="joms-hcard"> <div class="joms-hcard__cover"> <img src="<?php echo $user->getCover(); ?>" alt="<?php echo $user->name; ?>" style="width:100%;top:<?php echo $params->get('coverPosition', ''); ?>"> <div class="joms-hcard__info"> <div class="joms-avatar"> <a href="<?php echo CUrlHelper::userLink($user->id); ?>"><img src="<?php echo $user->getThumbAvatar(); ?>" alt="<?php echo $user->getDisplayName(); ?>"></a> </div> <div class="joms-hcard__info-content"> <h3 class="reset-gap"><?php echo $user->getDisplayName(false, true); ?></h3> <div class="joms-gap--small"></div> <?php if($showUserInfo){ ?> <span class="joms-text--small"><?php echo nl2br(HTMLHelper::_('string.truncate', str_replace(""",'"',$profileFields), 100)); ?></span> <?php } ?> </div> </div> </div> <ul class="joms-focus__link"> <li class="full"><a href="<?php echo CRoute::_('index.php?option=com_community&view=friends&userid='.$profile->id); ?>"> <?php echo ($profile->_friends == 1) ? Text::_('COM_COMMUNITY_FRIENDS_COUNT') . ' <span class="joms-text--light">' . $profile->_friends . '</span>' : Text::_('COM_COMMUNITY_FRIENDS_COUNT_MANY') . ' <span class="joms-text--light">' . $profile->_friends . '</span>' ?> </a></li> <?php if($photoEnabled) {?> <li class="half"><a href="<?php echo CRoute::_('index.php?option=com_community&view=photos&task=myphotos&userid='.$profile->id); ?>"><?php echo ($profile->_photos == 1) ? Text::_('COM_COMMUNITY_PHOTOS_COUNT_SINGULAR') . ' <span class="joms-text--light">' . $profile->_photos . '</span>' : Text::_('COM_COMMUNITY_PHOTOS_COUNT') . ' <span class="joms-text--light">' . $profile->_photos . '</span>' ?></a></li> <?php }?> <?php if($videoEnabled) {?> <li class="half"><a href="<?php echo CRoute::_('index.php?option=com_community&view=videos&task=myvideos&userid='.$profile->id); ?>"><?php echo ($profile->_videos == 1) ? Text::_('COM_COMMUNITY_VIDEOS_COUNT') . ' <span class="joms-text--light">' . $profile->_videos . '</span>' : Text::_('COM_COMMUNITY_VIDEOS_COUNT_MANY') . ' <span class="joms-text--light">' . $profile->_videos . '</span>' ?></a></li> <?php }?> <?php if($groupEnabled) {?> <li class="half"><a href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=mygroups&userid='.$profile->id); ?>"><?php echo ($profile->_groups == 1) ? Text::_('COM_COMMUNITY_GROUPS_COUNT') . ' <span class="joms-text--light">' . $profile->_groups . '</span>' : Text::_('COM_COMMUNITY_GROUPS_COUNT_MANY') . ' <span class="joms-text--light">' . $profile->_groups . '</span>' ?></a></li> <?php }?> <?php if($eventEnabled) {?> <li class="half"><a href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=myevents&userid='.$profile->id); ?>"><?php echo ($profile->_events == 1) ? Text::_('COM_COMMUNITY_EVENTS_COUNT') . ' <span class="joms-text--light">' . $profile->_events . '</span>' : Text::_('COM_COMMUNITY_EVENTS_COUNT_MANY') . ' <span class="joms-text--light">' . $profile->_events . '</span>' ?></a></li> <?php }?> <?php if($pollsEnabled) {?> <li class="half"><a href="<?php echo CRoute::_('index.php?option=com_community&view=polls&task=mypolls&userid='.$profile->id); ?>"><?php echo ($profile->_polls == 1) ? Text::_('COM_COMMUNITY_POLLS_COUNT') . ' <span class="joms-text--light">' . $profile->_polls . '</span>' : Text::_('COM_COMMUNITY_POLLS_COUNT_MANY') . ' <span class="joms-text--light">' . $profile->_polls . '</span>' ?></a></li> <?php }?> </ul> <?php if ( !$isMine ) { ?> <div class="joms-hcard__actions"> <!-- Send Message button --> <?php if (CFactory::getUser()->authorise('community.privateMessage', 'chat.' . $profile->id)) { ?> <a href="javascript:" class="joms-button--neutral joms-button--small" onclick="joms.api.pmSend('<?php echo $profile->id;?>');"> <?php echo Text::_('COM_COMMUNITY_INBOX_SEND_MESSAGE'); ?> </a> <?php } ?> <!-- Friending buton --> <?php if ( $isFriend ) { ?> <a href="javascript:" class="joms-button--neutral joms-button--small" onclick="joms.api.friendRemove('<?php echo $profile->id;?>')"> <?php echo Text::_('COM_COMMUNITY_FRIENDS_REMOVE'); ?> </a> <?php if ($loggedIn && $config->get('enablefollowers')) { ?> <?php if (!$isFollowing) { ?> <a href="javascript:" class="joms-button--neutral joms-button--small" onclick="joms.api.followAdd('<?php echo $profile->id;?>')"> <?php echo Text::_('COM_COMMUNITY_FOLLOW'); ?> </a> <?php } else { ?> <a href="javascript:" class="joms-button--neutral joms-button--small" onclick="joms.api.followRemove('<?php echo $profile->id;?>')"> <?php echo Text::_('COM_COMMUNITY_UNFOLLOW'); ?> </a> <?php } ?> <?php } ?> <?php } else if ( !$isBlocked ) { ?> <?php if ( $isWaitingApproval ) { ?> <a href="javascript:" class="joms-button--neutral joms-button--small" onclick="joms.api.friendAdd('<?php echo $profile->id;?>')"> <?php echo Text::_('COM_COMMUNITY_PROFILE_PENDING_FRIEND_REQUEST'); ?> </a> <?php } else if ( $isWaitingResponse ) { ?> <a href="javascript:" class="joms-button--neutral joms-button--small" onclick="joms.api.friendResponse('<?php echo $profile->id;?>')"> <?php echo Text::_('COM_COMMUNITY_PROFILE_PENDING_FRIEND_REQUEST'); ?> </a> <?php } else if (CFactory::getUser()->authorise('community.request', 'friends.' . $profile->id)) { ?> <a href="javascript:" class="joms-button--neutral joms-button--small" onclick="joms.api.friendAdd('<?php echo $profile->id;?>')"> <?php echo Text::_('COM_COMMUNITY_PROFILE_ADD_AS_FRIEND'); ?> </a> <?php } ?> <?php if ($loggedIn && $config->get('enablefollowers')) { ?> <?php if (!$isFollowing) { ?> <a href="javascript:" class="joms-button--neutral joms-button--small" onclick="joms.api.followAdd('<?php echo $profile->id;?>')"> <?php echo Text::_('COM_COMMUNITY_FOLLOW'); ?> </a> <?php } else { ?> <a href="javascript:" class="joms-button--neutral joms-button--small" onclick="joms.api.followRemove('<?php echo $profile->id;?>')"> <?php echo Text::_('COM_COMMUNITY_UNFOLLOW'); ?> </a> <?php } ?> <?php } ?> <?php } ?> </div> <?php } ?> </div>
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка