get_files(e_IMAGE."banners/","",$reject); if (isset($_POST['update_menu'])) { foreach($_POST as $k => $v) { if (strpos($k, "banner_") === 0) { $menu_pref[$k] = $v; } } if (isset($_POST['catid'])) { $array_cat = explode("-", $_POST['catid']); for($i = 0; $i < count($array_cat); $i++) { $cat .= $array_cat[$i]."|"; } $cat = substr($cat, 0, -1); $menu_pref['banner_campaign'] = $cat; } $sysprefs->setArray('menu_pref'); $message = BANNER_MENU_L2; } if ($_POST['createbanner'] || $_POST['updatebanner']) { $start_date = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear'])); $end_date = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear'])); $cli = ($_POST['client_name'] ? $_POST['client_name'] : $_POST['banner_client_sel']); if ($_POST['banner_pages']) { $postcampaign = ($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']); $pagelist = explode("\r\n", $_POST['banner_pages']); for($i = 0 ; $i < count($pagelist) ; $i++) { $pagelist[$i] = trim($pagelist[$i]); } $plist = implode("|", $pagelist); $pageparms = $postcampaign."^".$_POST['banner_listtype']."-".$plist; $pageparms = preg_replace("#\|$#", "", $pageparms); $pageparms = (trim($_POST['banner_pages']) == '') ? '' : $pageparms; $cam = $pageparms; } else { $cam = ($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']); } if ($_POST['createbanner']) { admin_update($sql->db_Insert("banner", "0, '".$cli."', '".$_POST['client_login']."', '".$_POST['client_password']."', '".$_POST['banner_image']."', '".$_POST['click_url']."', '".intval($_POST['impressions_purchased'])."', '$start_date', '$end_date', '".$_POST['banner_class']."', 0, 0, '', '".$cam."'"), 'insert', BNRLAN_63); } else { admin_update($sql->db_Update("banner", "banner_clientname='".$cli."', banner_clientlogin='".$_POST['client_login']."', banner_clientpassword='".$_POST['client_password']."', banner_image='".$_POST['banner_image']."', banner_clickurl='".$_POST['click_url']."', banner_impurchased='".intval($_POST['impressions_purchased'])."', banner_startdate='$start_date', banner_enddate='$end_date', banner_active='".$_POST['banner_class']."', banner_campaign='".$cam."' WHERE banner_id='".$_POST['eid']."'"), 'update', BNRLAN_64); } unset($_POST['client_name'], $_POST['client_login'], $_POST['client_password'], $_POST['banner_image'], $_POST['click_url'], $_POST['impressions_purchased'], $start_date, $end_date, $_POST['banner_enabled'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear'], $_POST['banner_class'], $_POST['banner_pages'], $_POST['banner_listtype']); } if (isset($_POST['confirm'])) { admin_update($sql->db_Delete("banner", "banner_id='".$_POST['id']."' "), 'delete', BNRLAN_1); } if ($action == "delete" && $sub_action) { $text = "
".BNRLAN_2."

"; $ns->tablerender(BNRLAN_5, $text); require_once("footer.php"); exit; } if (isset($_POST['cancel'])) { $message = BNRLAN_6; } if (isset($message)) { $ns->tablerender("", "
".$message."
"); } if ($sql->db_Select("banner")) { while ($row = $sql->db_Fetch()) { extract($row); if (strpos($banner_campaign, "^") !== FALSE) { $campaignsplit = explode("^", $banner_campaign); $banner_campaign = $campaignsplit[0]; } if ($banner_campaign) { $campaigns[] = $banner_campaign; } if ($banner_clientname) { $clients[] = $banner_clientname; } if ($banner_clientlogin) { $logins[] = $banner_clientlogin; } if ($banner_clientpassword) { $passwords[] = $banner_clientpassword; } } } if (!$action) { $text = " "; if (!$banner_total = $sql->db_Select("banner")) { $text .= ""; } else { while ($row = $sql->db_Fetch()) { extract($row); $clickpercentage = ($banner_clicks && $banner_impressions ? round(($banner_clicks / $banner_impressions) * 100)."%" : "-"); $impressions_left = ($banner_impurchased ? $banner_impurchased - $banner_impressions : BNRLAN_16); $impressions_purchased = ($banner_impurchased ? $banner_impurchased : BNRLAN_16); $start_date = ($banner_startdate ? strftime("%d %B %Y", $banner_startdate) : BNRLAN_17); $end_date = ($banner_enddate ? strftime("%d %B %Y", $banner_enddate) : BNRLAN_17); if (strpos($banner_campaign, "^") !== FALSE) { $campaignsplit = explode("^", $banner_campaign); $banner_campaign = $campaignsplit[0]; $textvisivilitychanged = "(*)"; } else { $textvisivilitychanged = ""; } $text .= ""; } } $text .= "
".BNRLAN_7."
".BNRLAN_8." ".BNRLAN_9." ".BNRLAN_10." ".BNRLAN_11." ".BNRLAN_12." ".BNRLAN_13." ".LAN_OPTIONS."
".BNRLAN_15."
".$banner_id." ".$banner_clientname." ".$banner_clicks." ".$clickpercentage." ".$impressions_purchased." ".$impressions_left." ".ADMIN_EDIT_ICON." ".ADMIN_DELETE_ICON."
  ".$banner_campaign." ".r_userclass_name($banner_active)." ".$textvisivilitychanged." ".BNRLAN_45.": ".$start_date." <> ".BNRLAN_21.": ".$end_date."
 
"; $ns->tablerender(BNRLAN_42, $text); } if ($action == "create") { if ($sub_action == "edit" && $id) { if (!$sql->db_Select("banner", "*", "banner_id = '".$id."' " )) { $text .= "
".BNRLAN_15."
"; } else { while ($row = $sql->db_Fetch()) { extract($row); $_POST['client_name'] = $banner_clientname; $_POST['client_login'] = $banner_clientlogin; $_POST['client_password'] = $banner_clientpassword; $_POST['banner_image'] = $banner_image; $_POST['click_url'] = $banner_clickurl; $_POST['impressions_purchased'] = $banner_impurchased; $_POST['banner_campaign'] = $banner_campaign; $_POST['banner_active'] = $banner_active; if ($banner_startdate) { $tmp = getdate($banner_startdate); $_POST['startmonth'] = $tmp['mon']; $_POST['startday'] = $tmp['mday']; $_POST['startyear'] = $tmp['year']; } if ($banner_enddate) { $tmp = getdate($banner_enddate); $_POST['endmonth'] = $tmp['mon']; $_POST['endday'] = $tmp['mday']; $_POST['endyear'] = $tmp['year']; } if (strpos($_POST['banner_campaign'], "^") !== FALSE) { $campaignsplit = explode("^", $_POST['banner_campaign']); $listtypearray = explode("-", $campaignsplit[1]); $listtype = $listtypearray[0]; $campaign_pages = str_replace("|", "\n", $listtypearray[1]); $_POST['banner_campaign'] = $campaignsplit[0]; } else { $_POST['banner_campaign'] = $banner_campaign; } } } } $text = "
".($sub_action == "edit" ? BNRLAN_22 : BNRLAN_23)."
".BNRLAN_24." "; if (count($campaigns)) { $text .= " ".BNRLAN_25."  "; } $text .= " ".BNRLAN_26."
".BNRLAN_27." "; if (count($clients)) { $text .= " ".BNRLAN_28."  "; $text .= ""; } $text .= " ".BNRLAN_29."
".BNRLAN_30."
".BNRLAN_31."
".BNRLAN_32."

"; $c = 0; while ($images[$c]) { $image = $images[$c]['path'].$images[$c]['fname']; $fileext1 = substr(strrchr($image, "."), 1); $fileext2 = substr(strrchr($image, "."), 0); $text .= "
"; } else if($fileext1 == "php" || $fileext1 == "html" || $fileext1 == "js") { $text .= " /> ".BNRLAN_46.": ".$images[$c]['fname']."
"; } else { $text .= " />
"; } $c++; } $text .= "
".BNRLAN_33."
".BNRLAN_34." 0 = ".BNRLAN_35."
".BNRLAN_36." ".BNRLAN_38."
".BNRLAN_37." ".BNRLAN_38."
".BNRLAN_39." ".MENLAN_4." ".r_userclass("banner_class", $_POST['banner_active'], "off", "public,member,guest,admin,classes,nobody,classes")."
"; $text .= ($sub_action == "edit" && $id ? ""); $text .= "
"; $ns->tablerender(BNRLAN_42, $text); } if ($action == "menu") { $array_cat_in = explode("|", $menu_pref['banner_campaign']); if (!$menu_pref['banner_caption']) { $menu_pref['banner_caption'] = BANNER_MENU_L1; } $category_total = $sql -> db_Select("banner", "DISTINCT(banner_campaign) as banner_campaign", "ORDER BY banner_campaign", "mode=no_where"); while ($row = $sql -> db_Fetch()) { extract($row); if (in_array($banner_campaign, $array_cat_in)) { $in_catname[] = $banner_campaign; } else { $out_catname[] = $banner_campaign; } } $text = "
".BANNER_MENU_L3.":
".BANNER_MENU_L6."
".BANNER_MENU_L7."
".BANNER_MENU_L8."


".BANNER_MENU_L10."
"; $ns->tablerender(BANNER_MENU_L5, $text); echo "\n"; } function banner_adminmenu() { global $action, $sql, $sub_action, $id; $act = $action; if ($act == "") { $act = "main"; } $var['main']['text'] = BNRLAN_58; $var['main']['link'] = e_SELF; $var['create']['text'] = BNRLAN_59; $var['create']['link'] = e_SELF."?create"; $var['menu']['text'] = BNRLAN_61; $var['menu']['link'] = e_SELF."?menu"; show_admin_menu(BNRLAN_62, $act, $var); } require_once("footer.php"); ?>