Файловый менеджер - Редактировать - /var/www/html/components/com_community/templates/jomsocial/layouts/stream/base.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\Component\ComponentHelper; use Joomla\CMS\Date\Date; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Table\Table; use Joomla\Registry\Registry; defined('_JEXEC') or die(); if(!isset($isSingleActivity)){ $isSingleActivity = false; } if (!isset($filterValue)) $filterValue = ''; $appLib = CAppPlugins::getInstance(); $filter = Factory::getApplication()->input->get('filter', $filter); $filterValue = Factory::getApplication()->input->getString('value', $filterValue); $actId = Factory::getApplication()->input->get('actid'); $date = Date::getInstance(); if ($config->get('activitydateformat') == "lapse") { $createdTime = CTimeHelper::timeLapse($date); } else { $createdTime = $date->format($config->get('profileDateFormat')); } $activitiesLib = new CActivities(); $newestStreamId = $activitiesLib->getNewestStreamId($filter, $filterId, $filterValue); // 2. welcome message for new installation if (isset($freshInstallMsg)) : ?> <div class="joms-alert" style="margin-top: 10px"> <?php echo $freshInstallMsg; ?> </div> <?php endif; ?> <?php if (count($activities) == 0 && $actId) { ?> <div class="joms-page" style="text-align: center;" > <h1><?php echo Text::_('COM_COMMUNITY_STREAM_TITLE_UNAVAILABLE'); ?></h1> <p><?php echo Text::_('COM_COMMUNITY_STREAM_CONTENT_UNAVAILABLE'); ?></p> <div class="joms-gap"></div> <svg viewBox="0 0 16 16" class="joms-icon" style="width:10%;height:10%;"> <use xlink:href="<?php echo CRoute::getURI(); ?>#joms-icon-support"></use> </svg> <div class="joms-gap"></div> <div class="joms-gap"></div> <a href="<?php echo CRoute::_('index.php?option=com_community&view=frontpage') ?>" class="joms-button--primary"><?php echo Text::_('COM_COMMUNITY_GO_TO_FRONTPAGE'); ?></a> <a href="<?php echo CRoute::_('index.php?option=com_community&view=profile'); ?>" class="joms-button--neutral"><?php echo Text::_('COM_COMMUNITY_GO_TO_PROFILE'); ?></a> <div class="joms-gap"></div> </div> <?php } ?> <!-- begin: .joms-stream__wrapper --> <div class="joms-stream__wrapper"> <div class="joms-load-latest joms-js--stream-latest" style="display:none;"></div> <!-- begin: .joms-stream__container --> <div class="joms-stream__container" data-filter="<?php echo $filter; ?>" data-filter-value="<?php echo $filterValue; ?>" data-filterid="<?php echo $filterId; ?>" data-pageid="<?php $this->pageId; ?>" data-groupid="<?php $this->groupId; ?>" data-eventid="<?php $this->eventId; ?>" data-profileid="<?php $this->profileId; ?>"> <?php if (isset($extra) && isset($extra->id) && is_array($activities)) { $included = false; foreach ($activities as $act) { if (isset($act->id) && $extra->id == $act->id) { $included = true; break; } } if (!$included) { array_unshift($activities, $extra); } } ?> <?php foreach ($activities as $act): ?> <?php if (empty($act->app)) { continue; } ?> <?php if ($act->groupid) { $streamURL = CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid='.$act->groupid.'&actid='.$act->id); } else if ($act->pageid) { $streamURL = CRoute::_('index.php?option=com_community&view=pages&task=viewpage&pageid='.$act->pageid.'&actid='.$act->id); } else if ($act->eventid) { $streamURL = CRoute::_('index.php?option=com_community&view=events&task=viewevent&eventid='.$act->eventid.'&actid='.$act->id); } else { $streamURL = CRoute::_('index.php?option=com_community&view=profile&userid='.$act->actor.'&actid='.$act->id); } $this->set('streamURL', $streamURL); /* If actor is no longer exists than we do not display it */ if ($act->actor != 0) { $actor = $act->actor; } else { if ($act->params instanceof JRegistry) { } else { $act->params = new Registry($act->params); } $actor = $act->params->get('actors'); } $tUser = CFactory::getUser($actor); /* User not exists and this's not system activity */ // if ($tUser->_userid == 0 && strpos($act->app, 'system.') === false) // continue; ?> <?php //special case for video in normal post $headMetas = $act->params; $isVideo = ''; /* We do convert into JRegistry to make it easier to use */ if (!empty($headMetas) && $headMetas != '{}') { $headMetaParams = json_decode($headMetas); $headMetaParams = isset($headMetaParams->headMetas) ? json_decode($headMetaParams->headMetas) : null; if (isset($headMetaParams->type) && $headMetaParams->type == 'video') { $isVideo = 'videos'; } } ob_start(); ?> <div class="joms-stream <?php echo "joms-embedly--" . $config->get('enable_embedly_card_position'); ?> joms-js--stream joms-js--stream-<?php echo $act->id; ?> <?php echo (isset($act->isFeatured) && $act->isFeatured) ? 'joms-stream--featured' : ''; ?>" data-stream-id="<?php echo $act->id; ?>" data-stream-type="<?php echo $act->app; ?>"> <?php // echo $act->app; ob_start(); $this->set('act', $act); $act->createdtime = $createdTime; // Load ONLY known app switch ($act->app) { case 'users.featured': $this->load('stream/profile-featured'); break; case 'profile.avatar.upload': case 'profile': $this->load('stream/status'); break; case 'profile.status.share': $this->load('activities.profile.status.share'); break; case 'albums.comment': case 'albums': $this->load('activities.albums'); break; case 'albums.featured': case 'photos.comment': $this->load('stream/photos'); break; case 'photos': // do not count unpublished photos $photoIds = $act->params->get('photosId', ''); $photoIds = explode(',', $photoIds); $photos = array(); foreach ($photoIds as $photoId) { $photo = Table::getInstance('Photo', 'CTable'); if ($photoId) { $photo->load($photoId); if ($photo->published && $photo->status != 'delete' && $photo->id) { $photos[] = $photo->id; } } } if (!count($photos)) break; $this->set('count', count($photos)); $this->load('stream/photos'); break; case 'videos.featured': $this->load('activities/videos/featured'); break; case 'videos.comment': case 'videos.linking': case 'videos': $this->load('stream/videos'); break; case 'friends.connect': $this->load('stream/friend-connect'); break; case 'pages.featured': case 'pages.wall': case 'pages.join': case 'pages.bulletin': case 'pages.discussion': case 'pages.discussion.reply': case 'pages.update': case 'pages': $this->load('activities/pages/base'); break; case 'pages.avatar.upload': $this->load('activities.pages.avatar.upload'); break; case 'groups.featured': case 'groups.wall': case 'groups.join': case 'groups.bulletin': case 'groups.discussion': case 'groups.discussion.reply': case 'groups.update': case 'groups': $this->load('activities/groups/base'); break; case 'groups.avatar.upload': $this->load('activities.groups.avatar.upload'); break; case 'events.featured': case 'events.wall': case 'events.attend': case 'events.update': case 'events': $this->load('stream/events'); break; case 'events.avatar.upload': $this->load('activities.events.avatar.upload'); break; case 'system.message': case 'system.videos.popular': case 'system.photos.popular': case 'system.members.popular': case 'system.photos.total': case 'system.groups.popular': case 'system.members.registered': $this->load('activities/system/base'); break; case 'app.install': $this->load('activities.app.install'); break; case 'profile.like': case 'pages.like': case 'groups.like': case 'discussion.like': case 'events.like': case 'photo.like': case 'videos.like': case 'album.like': $this->load('activities.likes'); break; case 'cover.upload': $this->load('activities.photos.cover'); break; case 'filesharing': $this->load('stream/filesharing'); break; case 'polls': $this->load('stream/poll'); break; default: // If none of the above, only load 3rd party stream data // For some known stream, convert it into new app naming, which is the folder/plugin format // try load the plugin getStreamHTML $appName = explode('.', $act->app); $appName = $appName[0]; $plugin = $appLib->getPlugin($appName); if (!is_null($plugin)) { if (method_exists($plugin, 'onCommunityStreamRender')) { $stream = $plugin->onCommunityStreamRender($act); if (!isset($stream->access)) { $stream->access = 10; } $date = JDate::getInstance($act->created); if ( $config->get('activitydateformat') == "lapse" ) { $createdTime = CTimeHelper::timeLapse($date); } else { $createdTime = $date->format($config->get('profileDateFormat')); } $stream->createdtime = $createdTime; $this->set('stream', $stream); $this->load('stream/base-extended'); } } else { // Process the old ways $user = CFactory::getUser($act->actor); if(!$user->id){ $actorLink = $user->getDisplayName(); // this could be a deleted user, so we remove the anchor link }else{ $actorLink = '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>'; } $title = $act->title; // Handle 'single' view exclusively $title = preg_replace('/\{multiple\}(.*)\{\/multiple\}/i', '', $title); $search = array('{single}', '{/single}'); $title = CString::str_ireplace($search, '', $title); $title = CString::str_ireplace('{actor}', $actorLink, $title); //get the time $date = JDate::getInstance($act->created); if ( $config->get('activitydateformat') == "lapse" ) { $createdTime = CTimeHelper::timeLapse($date); } else { $createdTime = $date->format($config->get('profileDateFormat')); } $stream = new stdClass(); $stream->actor = $user; $stream->target = null; $stream->headline = $title; $stream->message = $act->content; $stream->access = $act->access; $stream->createdtime = $createdTime; $stream->attachments = array(); //dont show footer(likes and comments if this comes from third party), we determine by the type because it will always start with service $app = explode('.', $act->app); if (isset($app[0]) && $app[0] == 'service') { $this->set('showFooter', false); } $this->set('stream', $stream); $this->load('stream/base-extended'); } break; } $html = ob_get_contents(); $html = trim($html); $showStream = true; ob_end_clean(); echo $html; // Show debug message if (empty($html)) { // enable only during stream debugging // echo 'UNPROCESSED STREAM POST: ' . $act->app; $showStream = false; } ?> </div> <?php $html = ob_get_contents(); $html = trim($html); ob_end_clean(); // Only show if there is a content t be shown if ($showStream) { echo $html; } ?> <?php endforeach; ?> </div> <!-- end: .joms-stream__container --> <?php if ($isSingleActivity) { ?> <script>joms_singleactivity = true;</script> <?php } ?> <?php if ($showMoreActivity && (!$isSingleActivity) && count($activities) > 0) { ?> <div class="joms-stream__loadmore cActivity-LoadMore" id="activity-more"> <a class="more-activity-text joms-button--primary joms-button--full" href="javascript:" onclick="joms.api.streamsLoadMore();"><?php echo Text::_('COM_COMMUNITY_MORE'); ?></a> <div class="loading" style="margin: 0 auto"></div> </div> <?php if ($my->id != 0) { ?> <script> joms_infinitescroll = +'<?php echo $config->get("infinitescroll", 0); ?>'; joms_autoloadtrigger = +'<?php echo $config->get("autoloadtrigger", 100); ?>'; joms_enable_refresh = +'<?php echo $config->get("enable_refresh", 0); ?>'; joms_newest_stream_id = +'<?php echo $newestStreamId; ?>'; </script> <?php } ?> <?php } ?> <?php if ((!$isSingleActivity) && CSystemHelper::isComponentExists('com_adagency') && ComponentHelper::getComponent('com_adagency', true)->enabled) { ?> <script>joms_adagency = 1;</script> <?php } ?> </div> <!-- end: .joms-stream__wrapper -->
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка