Banner Updated!
"; if (isset($_GET['action'])) { if( 0 == strcmp('new', $_GET['action'])) { $list = false; if (isset($_POST['save'])) { $sql = "INSERT INTO $adMangler->adsTable ( `width`, `height`, `active`, `approved`, `type`, `code`, `href`, `advertiser`, `base`, `src`, `pageassoc`, `pagex`, `position`, `posix` ) VALUES ( ".intval($_POST['width']).", ".intval($_POST['height']).", ".intval($_POST['active']).", ".intval($_POST['approved']).", '{$_POST['type']}', '{$_POST['code']}', '{$_POST['href']}', '{$_POST['advertiser']}'', ".intval($_POST['base']).", '{$_POST['src']}', '{$_POST['pageassoc']}', '{$_POST['pagex']}', '{$_POST['position']}', '{$_POST['posix']}' );"; $wpdb->query($sql); echo $message; $sql = "SELECT * FROM $adMangler->adsTable ORDER BY id DESC LIMIT 1"; $banner = $wpdb->get_row($sql); echo $adMangler->FormatAd($banner); // This is a bug fix to prevent duplicate ads being created $action = str_replace("new", "edit", $action); } } else if (0 == strcmp('delete', $_GET['action']) && isset($_GET['id'])) { $sql = "DELETE FROM $adMangler->adsTable WHERE id=".intval($_GET['id']); $wpdb->query($sql); $list = true; } else if (0 == strcmp('edit', $_GET['action']) && isset($_GET['id'])) { $list = false; if (isset($_POST['save'])) { $sql = "UPDATE $adMangler->adsTable SET width=".intval($_POST['width']).", height=".intval($_POST['height']).", active=".intval($_POST['active']).", approved=".intval($_POST['approved']).", type='{$_POST['type']}', code='{$_POST['code']}', href='{$_POST['href']}', advertiser='{$_POST['advertiser']}', base=".intval($_POST['base']).", src='{$_POST['src']}', pageassoc='{$_POST['pageassoc']}', pagex=".intval($_POST['pagex']).", position=".intval($_POST['position']).", posix=".intval($_POST['posix'])." WHERE id=".intval($_GET['id']); $wpdb->query($sql); echo $message; } } if (isset($_GET['id'])) { $sql = "SELECT * FROM $adMangler->adsTable WHERE id=".intval($_GET['id']); $banner = $wpdb->get_row($sql); echo $adMangler->FormatAd($banner); } } if (!$list): ?>| Action | Preview | Active | Approved | Base | Page ID | Page Exclusive | Position | Position Exclusive | Type | Size |
|---|---|---|---|---|---|---|---|---|---|---|
| Edit | Delete |
preview
FormatAd($result); ?>
|
active) ? "Yes" : "No"; ?> | approved) ? "Yes" : "No"; ?> | base) ? "Yes" : "No"; ?> | pageassoc; ?> | pagex) ? "Yes" : "No";; ?> | position; ?> | posix)? "Yes" : "No"; ?> | type; ?> | width; ?>xheight; ?> |