Example #1
0
 /**
  * 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);
     }
 }
Example #2
0
 /**
  * Standard stage of pointstore item purchase.
  *
  * @return tempcode		The UI
  */
 function __newbanner()
 {
     if (get_option('is_on_banner_buy') == '0') {
         return new ocp_tempcode();
     }
     $this->check_afford_banner();
     // So we don't need to call these big ugly names, again...
     $image_url = post_param('image_url');
     $site_url = post_param('site_url');
     $caption = post_param('caption');
     $notes = post_param('notes', '');
     $name = post_param('name');
     $cost = intval(get_option('banner_setup'));
     $this->handle_has_banner_already();
     check_banner();
     add_banner($name, $image_url, '', $caption, intval(get_option('initial_banner_hits')), $site_url, 3, $notes, 1, NULL, get_member(), 0);
     $GLOBALS['SITE_DB']->query_insert('sales', array('date_and_time' => time(), 'memberid' => get_member(), 'purchasetype' => 'banner', 'details' => $name, 'details2' => ''));
     require_code('points2');
     charge_member(get_member(), $cost, do_lang('ADD_BANNER'));
     // Send mail to staff
     require_code('submit');
     $edit_url = build_url(array('page' => 'cms_banners', 'type' => '_ed', 'name' => $name), get_module_zone('cms_banners'), NULL, false, false, true);
     if (addon_installed('unvalidated')) {
         send_validation_request('ADD_BANNER', 'banners', true, $name, $edit_url);
     }
     $title = get_page_title('ADD_BANNER');
     $stats_url = build_url(array('page' => 'banners', 'type' => 'misc'), get_module_zone('banners'));
     $text = do_lang_tempcode('PURCHASED_BANNER');
     $_banner_type_row = $GLOBALS['SITE_DB']->query_select('banner_types', array('t_image_width', 't_image_height'), array('id' => ''), '', 1);
     if (array_key_exists(0, $_banner_type_row)) {
         $banner_type_row = $_banner_type_row[0];
     } else {
         $banner_type_row = array('t_image_width' => 468, 't_image_height' => 60);
     }
     $banner_code = do_template('BANNER_SHOW_CODE', array('_GUID' => 'c96f0ce22de97782b1ab9bee3f43c0ba', 'TYPE' => '', 'NAME' => $name, 'WIDTH' => strval($banner_type_row['t_image_width']), 'HEIGHT' => strval($banner_type_row['t_image_height'])));
     return do_template('BANNER_ADDED_SCREEN', array('_GUID' => '68725923b19d3df71c72276ada826183', 'TITLE' => $title, 'TEXT' => $text, 'BANNER_CODE' => $banner_code, 'STATS_URL' => $stats_url, 'DO_NEXT' => ''));
 }