| 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/lorient/modules/mod_community_photos/ |
Upload File : |
<?php
/**
* @copyright (C) 2015 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
*/
defined( '_JEXEC' ) or die( 'Unauthorized Access' );
// Check if JomSocial core file exists
$corefile = JPATH_ROOT . '/components/com_community/libraries/core.php';
jimport( 'joomla.filesystem.file' );
if( !JFile::exists( $corefile ) )
{
return;
}
// Include JomSocial's Core file, helpers, settings...
include_once(JPATH_BASE . '/components/com_community/defines.community.php');
require_once( $corefile );
require_once dirname(__FILE__) . '/helper.php';
// Add proper stylesheet
JFactory::getLanguage()->isRTL() ? CTemplate::addStylesheet('style.rtl') : CTemplate::addStylesheet('style');
$config = CFactory::getConfig();
$my = CFactory::getUser();
$isAlbumModal = $config->get('album_mode') == 1;
$displayType = $params->get('display_type',1); // 0 = albums, 1 = photos (default)
$limit = $params->get('limit',20);
$photoType = $params->get('category_type',0);
$sortBy = $params->get('filter_by', 0);
if($sortBy){
// 1 = popularity
$sortBy = 'hit';
}
switch($photoType){
case 0:
$photoType = false; // this will grab all the photos
break;
case 1:
$photoType = 'user';
break;
case 2:
$photoType = 'group';
break;
case 3:
$photoType = 'event';
break;
default:
$photoType = 'user';
}
if($displayType){
$model = CFactory::getModel('photos');
//photos
$photos = $model->getAllPhotos(null, $photoType, $limit, array(0,10,20,30,40), COMMUNITY_ORDER_BY_DESC,
$sortBy, false, true, false, $my->id);
if ($photos) {
// Make sure it is all photo object
foreach ($photos as $row) {
$photo = JTable::getInstance('Photo', 'CTable');
$photo->bind($row);
$row = $photo;
}
}
require(JModuleHelper::getLayoutPath('mod_community_photos', 'photos'));
} else {
$model = CFactory::getModel('photos');
$filter = 'all';
if($photoType == 'group' || $photoType == 'event'){
$filter = $photoType;
}
$albums = $model->getAllAlbums($my->id, $limit, $sortBy, $filter);
if ($albums) {
// shuffle($latestAlbums);
// Make sure it is all albums object
foreach ($albums as $row) {
$album = JTable::getInstance('Album', 'CTable');
$album->bind($row);
$row = $album;
}
}
if (!empty($albums)) {
for ($i = 0; $i < count($albums); $i++) {
$row = $albums[$i];
$row->user = CFactory::getUser($row->creator);
}
}
require(JModuleHelper::getLayoutPath('mod_community_photos', 'albums'));
}