| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Old Sites/moke/components/com_imageads/models/ |
Upload File : |
<?php
/**
* @version $Id: ads.php
* @package ImageAds
* @author Andrey Sokolnikov <aasfalcon@gmail.com>
* @copyright (C) 2011 Emergination, LLC. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
/**
* My Ads model
*
* @package ImageAds
*/
class imageadsModelMyAds extends JModel
{
/**
* Array of ad rows
*
* @access private
* @var array
*/
var $_data = null;
/**
* Get ad list
*
* @access public
* @return &array Array of record rows
*/
function getAds($user_id)
{
if (empty($this->_data)) {
$params = JComponentHelper::getParams(IA_OPTION);
$sql = "SELECT a.*"
."\nFROM #__image_ads AS a"
."\nWHERE a.user_id=".(int)$user_id
."\nORDER BY a.id"
;
$this->_db->setQuery($sql);
$this->_data = $this->_db->loadObjectList();
if ($this->_db->getErrorNum())
{
$this->setError($this->_db->getErrorMsg());
return false;
}
}
return $this->_data;
}
}