| 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/plats-individuels/lyon/administrator/components/com_djclassifieds/models/ |
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 DjClassifiedsModelEmails extends JModelList{
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'title', 'e.title',
'id', 'e.id',
'label', 'e.label'
);
}
parent::__construct($config);
}
protected function populateState($ordering = null, $direction = null)
{
$search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
$this->setState('filter.search', $search);
// List state information.
parent::populateState('e.label', 'asc');
$order = $this->getUserStateFromRequest($this->context.'.filter.order', 'filter_order');
if($order){
$this->setState('list.ordering', $order);
}
$order_dir = $this->getUserStateFromRequest($this->context.'.filter.order_Dir', 'filter_order_Dir');
if($order_dir){
$this->setState('list.direction', $order_dir);
}
}
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.search');
return parent::getStoreId($id);
}
public function _buildWhere()
{
$where = '';
$search = $this->getState('filter.search');
if (!empty($search)) {
$db = JFactory::getDBO();
$search_id = $db->Quote($db->escape($search, true));
$search = $db->Quote('%'.$db->escape($search, true).'%');
$where .= "AND (e.label LIKE ".$search." OR e.title LIKE ".$search." OR e.content LIKE ".$search." OR e.id=".$search_id.") ";
}
$where .= "AND e.id != 32 "; // not used
if(!JPluginHelper::isEnabled('djclassifieds', 'offers')){
$where .= "AND e.id NOT IN (24,25,26,31) ";
}
if(!JPluginHelper::isEnabled('djclassifieds', 'searchalerts')){
$where .= "AND e.id != 28 ";
}
if(!JPluginHelper::isEnabled('djclassifieds', 'badwords')){
$where .= "AND e.id != 30 ";
}
if(!JPluginHelper::isEnabled('djclassifieds', 'plans')){
$where .= "AND e.id != 37 ";
}
if(!JPluginHelper::isEnabled('djclassifiedsmessage', 'djmessages') && !JPluginHelper::isEnabled('djclassifiedsmessage', 'djcfmsguddeim')){
$where .= "AND e.id NOT IN (27,36) ";
}
return $where;
}
protected function getListQuery()
{
$orderCol = $this->getState('list.ordering', 'e.label');
$orderDirn = $this->getState('list.direction');
$query = "SELECT e.* FROM #__djcf_emails e "
."WHERE 1 ".$this->_buildWhere()
."ORDER BY ".$orderCol." ".$orderDirn;
return $query;
}
}
?>