query("UPDATE ".$wpdb->prefix."ad_buttons SET ad_active = 0 WHERE id = $ad_button"); } elseif($ad_button_action == 'activate') { $ol_flash = "Ad Button $ad_button has been activated."; $wpdb->query("UPDATE ".$wpdb->prefix."ad_buttons SET ad_active = 1 WHERE id = $ad_button"); } elseif($ad_button_action == 'delete') { $ol_flash = "Ad Button $ad_button has been deleted."; $wpdb->query("UPDATE ".$wpdb->prefix."ad_buttons SET ad_active = 2 WHERE id = $ad_button"); } $widget_adbuttons_cfg = array( 'ab_cfg1' => '' ); $widget_adbuttons_cfg = get_option('widget_adbuttons_cfg'); // check if the form has been submitted and validate input if(isset($_POST['ab_img']) || isset($_POST['ab_link']) || isset($_POST['ab_txt'])) { if (isset($_POST['ab_img'])) { $ab_img = $htp.str_replace($htp, "", $_POST['ab_img']); } if (isset($_POST['ab_link'])) { $ab_link = $htp.str_replace($htp, "", $_POST['ab_link']); } if (isset($_POST['ab_txt'])) { $ab_txt = $_POST['ab_txt']; } if($ab_img == $htp || $ab_img == ''){ $ab_img_err = 'Please fill in the link to your image file'; } if($ab_link == $htp || $ab_link == ''){ $ab_link_err = 'Please fill in the target link for your ad'; } if($ab_img_err == '' && $ab_link_err == ''){ // everything looks good, lets write to the database $table = $wpdb->prefix."ad_buttons"; $wpdb->query("INSERT INTO $table(ad_picture, ad_link, ad_text, ad_active) VALUES('$ab_img', '$ab_link', '$ab_txt', 0)"); $ol_flash = 'Your Ad Button has been created!'; $ab_img = $htp; $ab_link = $htp; $ab_txt = ''; $ab_img_err = ''; $ab_link_err= ''; } } ?>
' . $ol_flash . '
'; ?>| Ad ID | Ad Button | Ad Text | Ad Views | Ad Clicks | CTR | Action |
|---|---|---|---|---|---|---|
| $result->id | ad_link\" target=\"_blank\" title=\"$result->ad_text\"> |
$result->ad_text | $result->ad_views | $result->ad_clicks | $ad_ctr% | id\" title=\"Deactivate this Ad Button\" class=\"delete\">Deactivate |
| Ad ID | Ad Button | Ad Text | Ad Views | Ad Clicks | CTR | Action |
|---|---|---|---|---|---|---|
| $result->id | ad_link\" target=\"_blank\" title=\"$result->ad_text\"> |
$result->ad_text | $result->ad_views | $result->ad_clicks | $ad_ctr% | id\" title=\"Activate this Ad Button\" class=\"delete\">Activate id\" title=\"Delete this Ad Button\" class=\"delete\">Delete |