'getBanner', ); function SponsorBlockShow($opt) { $this->opt = $opt; } function exec(&$Doc) { $this->Doc = &$Doc; $this->_initDBObj(); parent::exec(); } function _initDBObj() { if (!is_object($this->DBObj)) { $this->DBObj = SiteMap::getObj('Sponsor/Sponsor.php'); } } function getNames() { $this->_initDBObj(); return (array)$this->DBObj->getDSponsorType4Select(); } function getBannerAjax() { $res = $this->DBObj->getRandomBlock($_REQUEST['id_type'], $_REQUEST['current_ids'], $_REQUEST['markets']); if (empty($res)) { $res = array('error'=>'Not Found'); } else { foreach ($res as &$v) { if ($_REQUEST['id_type'] == 1) { $v['img'] = image_db($v['img'], SPONSOR_BANNER_WIDTH, SPONSOR_BANNER_HEIGHT); } else { $v['img'] = image_db($v['img']); } } $res = array('list' => $res, 'num_rows' => count($res)); } $this->displayJSON($res); } }