Comsenz Inc.'; var $targets = array('portal', 'home', 'member', 'forum', 'group', 'userapp', 'plugin', 'custom'); var $imagesizes = array('300x250', '290x200', '250x180'); function getsetting() { global $_G; $settings = array( 'fids' => array( 'title' => 'cornerbanner_fids', 'type' => 'mselect', 'value' => array(), ), 'groups' => array( 'title' => 'cornerbanner_groups', 'type' => 'mselect', 'value' => array(), ), 'category' => array( 'title' => 'cornerbanner_category', 'type' => 'mselect', 'value' => array(), ), 'disableclose' => array( 'title' => 'cornerbanner_disableclose', 'type' => 'mradio', 'value' => array( array(0, 'cornerbanner_show'), array(1, 'cornerbanner_hidden'), ), 'default' => 0, ), 'animator' => array( 'title' => 'cornerbanner_animator', 'type' => 'radio', 'default' => 0, ), ); loadcache(array('forums', 'grouptype')); $settings['fids']['value'][] = $settings['groups']['value'][] = array(0, ' '); $settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'cornerbanner_index'); if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array(); foreach($_G['cache']['forums'] as $fid => $forum) { $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat(' ', 4) : ($forum['type'] == 'sub' ? str_repeat(' ', 8) : '')).$forum['name']); } foreach($_G['cache']['grouptype']['first'] as $gid => $group) { $settings['groups']['value'][] = array($gid, str_repeat(' ', 4).$group['name']); if($group['secondlist']) { foreach($group['secondlist'] as $sgid) { $settings['groups']['value'][] = array($sgid, str_repeat(' ', 8).$_G['cache']['grouptype']['second'][$sgid]['name']); } } } loadcache('portalcategory'); $this->categoryvalue[] = array(-1, 'cornerbanner_index'); $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']['fids']) && in_array(0, $parameters['extra']['fids'])) { $parameters['extra']['fids'] = array(); } if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) { $parameters['extra']['groups'] = array(); } if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) { $parameters['extra']['category'] = array(); } $parameters['extra']['animator'] = $parameters['animator']; } function evalcode($adv) { return array( 'check' => ' if($_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !(in_array($_G[\'fid\'], $parameter[\'fids\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'fids\']) || defined(\'IN_ARCHIVER\') && in_array(-2, $parameter[\'fids\'])) || $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !(in_array($_G[\'grouptypeid\'], $parameter[\'groups\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'groups\'])) || $_G[\'basescript\'] == \'portal\' && $parameter[\'category\'] && !(!empty($_G[\'catid\']) && in_array($_G[\'catid\'], $parameter[\'category\']) || empty($_G[\'catid\']) && in_array(-1, $parameter[\'category\'])) ) { $checked = false; }', 'create' => ' if(empty($parameter[\'disableclose\'])) { $adid = $adids[array_rand($adids)]; $aniscript = $parameter[\'animator\'] ? \'\' : \'\'; $adcode = empty($_G[\'cookie\'][\'adclose_\'.$adid]) ? \'
\'.$codes[$adid].$aniscript : \'\'; $extra = \'style="\'.($parameters[$adid][\'height\'] ? \'line-height:\'.$parameters[$adid][\'height\'].\'px;height:\'.$parameters[$adid][\'height\'].\'px\' : \'\').($parameter[\'animator\'] ? \';visibility:hidden\': \'\').\'"\'; } else { $adcode = $codes[$adids[array_rand($adids)]]; } ', ); } } ?>