$err = validate_banner_form($vars); if (!$err) { $err = add_banner($vars); if (!$err) { display_banners(); break; } } } display_banner_form($vars, $err); break; case 'edit_banner': if ($vars['save']) { $err = validate_banner_form($vars); if (!$err) { $err = edit_banner($vars, $vars['banner_id']); if (!$err) { display_banners(); break; } else { $b = $vars; } } else { $b = $vars; } } else { $b = $config['aff']['banners'][$vars['banner_id']]; } display_banner_form($b, $err); break; case 'del_banner':
/** * Standard aed_module edit actualiser. * * @param ID_TEXT The entry being edited */ function edit_actualisation($id) { $orig_submitter = $GLOBALS['SITE_DB']->query_value_null_ok('banners', 'submitter', array('name' => $id)); if (is_null($orig_submitter)) { warn_exit(do_lang_tempcode('MISSING_RESOURCE')); } $b_type = post_param('b_type'); $title_text = post_param('title_text', ''); $b_type = post_param('b_type'); $this->donext_type = $b_type; list($url, $title_text) = check_banner($title_text, $b_type); $validated = post_param_integer('validated', 0); $_submitter = post_param('submitter', strval(get_member())); $submitter = !is_numeric($_submitter) ? $GLOBALS['FORUM_DRIVER']->get_member_from_username($_submitter) : intval($_submitter); edit_banner($id, post_param('name'), $url, $title_text, post_param('caption'), post_param_integer('campaignremaining', 0), fixup_protocolless_urls(post_param('site_url')), post_param_integer('importancemodulus'), post_param('notes', ''), post_param_integer('the_type', 1), get_input_date('expiry_date'), $submitter, $validated, $b_type); $this->new_id = post_param('name'); if (get_option('use_banner_permissions') == '1') { $this->set_permissions($id); } }