Comsenz Inc.'; var $targets = array('portal'); var $imagesizes = array('250x60', '250x250', '250x300', '658x40', '658x60'); var $categoryvalue = array(); function getsetting() { global $_G; $settings = array( 'position' => array( 'title' => 'article_position', 'type' => 'mradio', 'value' => array( array(1, 'article_position_float'), array(2, 'article_position_up'), array(3, 'article_position_down'), ), 'default' => 1, ), 'category' => array( 'title' => 'article_category', 'type' => 'mselect', 'value' => array(), ), ); loadcache('portalcategory'); $this->getcategory(0); $settings['category']['value'] = $this->categoryvalue; return $settings; } function getcategory($upid) { global $_G; foreach($_G['cache']['portalcategory'] as $category) { if($category['upid'] == $upid) { $this->categoryvalue[] = array($category['catid'], str_repeat(' ', $category['level'] * 4).$category['catname']); $this->getcategory($category['catid']); } } } function setsetting(&$advnew, &$parameters) { global $_G; if(is_array($advnew['targets'])) { $advnew['targets'] = implode("\t", $advnew['targets']); } if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) { $parameters['extra']['category'] = array(); } } function evalcode() { return array( 'check' => ' $checked = $params[2] == $parameter[\'position\'] && (!$parameter[\'category\'] || $parameter[\'category\'] && in_array($_G[\'catid\'], $parameter[\'category\'])); ', 'create' => '$adcode = $codes[$adids[array_rand($adids)]];', ); } } ?>