'Rectangle Text (180 x 150)', 'mediumRectangleText' => 'Medium Rectangle Text (300 x 250)', 'verticalRectangleText' => 'Vertical Rectangle Text (240 x 400)', 'fullBanner' => 'Full Banner (468 x 60)', 'halfBanner' => 'Half Banner (234 x 60)', 'verticalBanner' => 'Vertical Banner (120 x 240)', 'skyscraper' => 'Skyscraper (160 x 600)', 'leaderboard' => 'Leaderboard (728 x 92)'); $options = get_option('echocurrent_affiliate_optimizer'); // Init defaults, if necessary if(!is_array($options)) { $options = array( 'website_key' => '', 'zone_style' => '', 'external_border_color' => 'black', 'internal_border_color' => '#6699FF', 'prod_name_font_color' => null, 'prod_desc_font_color' => 'black', 'alt_font_color' => '#008800'); } // Form posted? if($_POST['echocurrent_affiliate_submit']) { $options['website_key'] = strip_tags(stripslashes($_POST['ec_website_key'])); $options['zone_style'] = strip_tags(stripslashes($_POST['ec_zone_style'])); $options['external_border_color'] = strip_tags(stripslashes($_POST['ec_external_border_color'])); $options['internal_border_color'] = strip_tags(stripslashes($_POST['ec_internal_border_color'])); $options['background_color'] = strip_tags(stripslashes($_POST['ec_background_color'])); $options['prod_name_font_color'] = strip_tags(stripslashes($_POST['ec_prod_name_font_color'])); $options['prod_desc_font_color'] = strip_tags(stripslashes($_POST['ec_prod_desc_font_color'])); $options['alt_font_color'] = strip_tags(stripslashes($_POST['ec_alt_font_color'])); update_option('echocurrent_affiliate_optimizer', $options); } $website_key_option = htmlspecialchars($options['website_key'], ENT_QUOTES); $zone_style_option = htmlspecialchars($options['zone_style'], ENT_QUOTES); $external_border_color_option = htmlspecialchars($options['external_border_color'], ENT_QUOTES); $internal_border_color_option = htmlspecialchars($options['internal_border_color'], ENT_QUOTES); $background_color_option = htmlspecialchars($options['background_color'], ENT_QUOTES); $prod_name_font_color_option = htmlspecialchars($options['prod_name_font_color'], ENT_QUOTES); $prod_desc_font_color_option = htmlspecialchars($options['prod_desc_font_color'], ENT_QUOTES); $alt_font_color_option = htmlspecialchars($options['alt_font_color'], ENT_QUOTES); echo ' '; // The form fields echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
Please visit EchoCurrent for ' . ( $website_key_option == null || $website_key_option == '' ? 'registration information' : 'reports') . '.
'; echo ''; } function _generate_zone_style_option($zone_style_option, $current_zone_style, $label) { return ''; } // Widget callback function. Will generate the EchoCurrent Affiliate Products zone, based on options configured by the blog admin // TODO: Document ec-echocurrent_affiliate_zone-affiliate-zone() in Plugin's homepage and/or this file function echocurrent_affiliate_zone($args) { $ec_server_loc = 'services.echocurrent.com'; // PROD // $ec_server_loc = 'ec-dbrunette:8090/echocurrent-webapp'; // DEV extract($args); echo $before_widget; echo $before_title . /* No Title */ '' . $after_title; $options = get_option('echocurrent_affiliate_optimizer'); $website_key = $options['website_key']; if(empty($website_key)) $website_key = '0123456789'; $zone_style = $options['zone_style']; ?>