| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/lemans/modules/mod_community_videos/ |
Upload File : |
<?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\Factory;
use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\Table\Table;
defined('_JEXEC') or die('Restricted access');
include_once(JPATH_BASE . '/components/com_community/defines.community.php');
require_once(JPATH_BASE . '/components/com_community/libraries/core.php');
$config = CFactory::getConfig();
$document = Factory::getDocument();
$isVideoModal = $config->get('video_mode') == 1;
if ($config->get('video_native') == 1) {
$document->addScriptDeclaration('joms_videoplayer_native = 1;');
}
//add style css
Factory::getLanguage()->isRTL() ? CTemplate::addStylesheet('style.rtl') : CTemplate::addStylesheet('style');
$frontpageVideos = intval($config->get('frontpagevideos',
5)); /* Fix provide default value to prevent null return if user not apply */
$document->addScriptDeclaration("var frontpageVideos = " . $frontpageVideos . ";");
$my = CFactory::getUser();
$model = CFactory::getModel('videos');
$limitCount = $params->get('limit',6);
$permissions = ($my->id == 0) ? 10 : 20;
$permissions = COwnerHelper::isCommunityAdmin() ? 40 : $permissions;
$videoType = $params->get('category_type',0);
$sortBy = $params->get('filter_by', 'latest');
if($sortBy == 1){
// 1 = popularity
$sortBy = 'mostviews';
}elseif($sortBy == 2){
//2 = featured
$sortBy = 'featured';
}
switch($videoType){
case 1:
$videoType = 'user';
break;
case 2:
$videoType = 'group';
break;
case 3:
$videoType = 'event';
break;
default:
$videoType = '';
}
$videosfilter = array(
'published' => 1,
'status' => 'ready',
'permissions' => $permissions,
'or_group_privacy' => 0,
'limit' => $limitCount,
'creator_type'=>$videoType,
'sorting'=>$sortBy,
'filterResult' => true
);
if ($params->get('category_id')) {
$videosfilter['category_id'] = $params->get('category_id');
}
if ($params->get('creator')) {
$videosfilter['creator'] = $params->get('creator');
}
$result = $model->getVideos($videosfilter, true, true, true, false);
$videos = array();
// Bind with video table to inherit its method
foreach ($result as $videoEntry) {
$video = Table::getInstance('Video', 'CTable');
$video->bind($videoEntry);
$videos[] = $video;
}
if ($videos) {
$default = $params->get('default');
// Test the number of result so the loop will not fail with incorrect index.
//$total = count( $videos ) < $default ? count($videos) : $default;
$videos = array_slice($videos, 0, $default);
}
require(ModuleHelper::getLayoutPath('mod_community_videos', $params->get('layout', 'default')));