| Server IP : 54.36.91.62 / Your IP : 216.73.217.117 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/montpellier/components/com_djclassifieds/views/items/ |
Upload File : |
<?php
/**
* @package DJ-Classifieds
* @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://dj-extensions.com
* @author email contact@dj-extensions.com
*/
defined ('_JEXEC') or die('Restricted access');
class DJClassifiedsViewItems extends JViewLegacy
{
function display($tpl = null)
{
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$app->input->set('limit', $app->getCfg('feed_limit'));
$siteEmail = $app->getCfg('mailfrom');
$fromName = $app->getCfg('fromname');
$document->editor = $fromName;
$document->editorEmail = $siteEmail;
// Get some data from the model
$model = $this->getModel();
$cat_id = $app->input->getInt('cid', 0);
$catlist = '';
$main_cat = '';
if($cat_id){
$main_cat = $model->getCategory($cat_id);
$document->title = JText::_($main_cat->name);
$cats = DJClassifiedsCategory::getSubCatItemsCount($cat_id,1);
$catlist = $cat_id;
foreach($cats as $c){
$catlist .= ','. $c->id;
}
}
$items = $model->getItems($catlist);
foreach ($items as $item)
{
// strip html from feed item title
$title = $this->escape($item->name);
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
// url link to article
$link = JRoute::_($item->item_uri, false);
// strip html from feed item description text
$description = $item->intro_desc;
$date = ($item->date_start ? date('r', strtotime($item->date_start)) : '');
if(count($item->images)){
$description .= '<img align="right" src="'.JURI::base().$item->images[0]->thumb_feed.'" alt="'.str_ireplace('"', "'", $item->images[0]->caption).'" />';
}
// load individual item creator class
$feeditem = new JFeedItem();
$feeditem->title = $title;
$feeditem->link = $link;
$feeditem->description = $description;
$feeditem->date = $date;
$feeditem->category = JText::_($item->c_name);
// loads item info into rss array
$document->addItem($feeditem);
}
}
}
?>