From 0192d9f481e48ad9c1d5ea4cb527a33956324625 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 3 Feb 2019 17:45:54 -0800 Subject: [PATCH] Removed old code. --- e107_plugins/banner/admin_banner.php | 688 +-------------------------- 1 file changed, 2 insertions(+), 686 deletions(-) diff --git a/e107_plugins/banner/admin_banner.php b/e107_plugins/banner/admin_banner.php index a6ec6116a..df33b01bb 100644 --- a/e107_plugins/banner/admin_banner.php +++ b/e107_plugins/banner/admin_banner.php @@ -595,6 +595,8 @@ class banner_form_ui extends e_admin_form_ui return array(); break; } + + return null; } // Custom Method/Function @@ -683,689 +685,3 @@ exit; - - - - - - - - - - - -require_once(e_ADMIN.'auth.php'); -require_once(e_HANDLER.'userclass_class.php'); -require_once(e_HANDLER.'file_class.php'); - - - - - - - - - - - - - - - - - - - -if(e_QUERY) -{ - list($action, $sub_action, $id) = explode('.', e_QUERY); -} - -$images = $fl->get_files(e_IMAGE.'banners/','','standard'); - - -$menu_pref = e107::getConfig('menu')->getPref(''); - - -if (isset($_POST['update_menu'])) -{ - $temp['banner_caption'] = $tp->toDB($_POST['banner_caption']); - $temp['banner_amount'] = intval($_POST['banner_amount']); - $temp['banner_rendertype'] = intval($_POST['banner_rendertype']); - - if (isset($_POST['multiaction_cat_active'])) - { - /*$array_cat = explode("-", $_POST['catid']); - $cat=''; - for($i = 0; $i < count($array_cat); $i++) - { - $cat .= $tp->toDB($array_cat[$i])."|"; - } - $cat = substr($cat, 0, -1);*/ - $cat = implode('|', $tp->toDB($_POST['multiaction_cat_active'])); - $temp['banner_campaign'] = $cat; - } - if ($admin_log->logArrayDiffs($temp,$menu_pref,'BANNER_01')) - { - $menuPref = e107::getConfig('menu'); - //e107::getConfig('menu')->setPref('', $menu_pref); - //e107::getConfig('menu')->save(false, true, false); - foreach ($temp as $k => $v) - { - $menuPref->setPref($k, $v); - } - $menuPref->save(false, true, false); - e107::getMessage()->addSuccess(LAN_SAVED); - - $menu_pref = e107::getConfig('menu')->getPref(''); - //banners_adminlog('01', $menu_pref['banner_caption'].'[!br!]'.$menu_pref['banner_amount'].', '.$menu_pref['banner_rendertype'].'[!br!]'.$menu_pref['banner_campaign']); - } -} - - - -if (vartrue($_POST['createbanner']) || vartrue($_POST['updatebanner'])) -{ - $start_date = vartrue(e107::getDate()->convert($_POST['banner_startdate'],'inputdate'), 0); - $end_date = vartrue(e107::getDate()->convert($_POST['banner_enddate'],'inputdate'), 0); - $cli = $tp->toDB($_POST['client_name'] ? $_POST['client_name'] : $_POST['banner_client_sel']); - $cLogin = $tp->toDB($_POST['client_login']); - $cPassword = $tp->toDB($_POST['client_password']); - $banImage = $tp->toDB($_POST['banner_image']); - $banURL = $tp->toDB($_POST['click_url']); - $cam = $tp->toDB($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']); - - $logString .= $cam.'[!br!]'.$cli.'[!br!]'.$banImage.'[!br!]'.$banURL; - if ($_POST['createbanner']) - { - e107::getMessage()->addAuto($sql->db_Insert("banner", "0, '".$cli."', '".$cLogin."', '".$cPassword."', '".$banImage."', '".$banURL."', '".intval($_POST['impressions_purchased'])."', '".$start_date."', '".$end_date."', '".intval($_POST['banner_class'])."', 0, 0, '', '".$cam."'"), 'insert', LAN_CREATED, false, false); - banners_adminlog('02',$logString); - } - else // updating, not creating - { - e107::getMessage()->addAuto($sql->db_Update("banner", "banner_clientname='".$cli."', banner_clientlogin='".$cLogin."', banner_clientpassword='".$cPassword."', banner_image='".$banImage."', banner_clickurl='".$banURL."', banner_impurchased='".intval($_POST['impressions_purchased'])."', banner_startdate='".$start_date."', banner_enddate='".$end_date."', banner_active='".intval($_POST['banner_class'])."', banner_campaign='".$cam."' WHERE banner_id=".intval($_POST['eid'])), 'update', LAN_UPDATED, false, false); - banners_adminlog('03',$logString); - } - - 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['banner_startdate'], $_POST['banner_enddate'], $_POST['banner_class'], $_POST['banner_listtype']); -} - -/* DELETE ACTIONS */ -if (isset($_POST['delete_cancel'])) // delete cancelled - redirect back to 'manage' -{ - session_write_close(); - header('Location:'.e_SELF); - exit; -} - -if (vartrue($action) == "delete" && $sub_action && vartrue($_POST['delete_confirm'])) // delete has been confirmed, process -{ - if($sql->db_Delete("banner", "banner_id=".intval($sub_action))) - { - $mes->addSuccess(LAN_DELETED); - banners_adminlog('04','Id: '.intval($sub_action)); - header('Location:'.e_SELF); - exit; - } - else // delete failed - redirect back to 'manage' and display message - { - $mes->addWarning(LAN_DELETED_FAILED); - session_write_close(); - header('Location:'.e_SELF); - exit; - } -} -elseif ($action == "delete" && $sub_action) // confirm delete -{ // shown only if JS is disabled or by direct url hit (?delete.banner_id) - $mes->addWarning(LAN_CONFIRMDEL); - $text = " -
-
- ".LAN_CONFIRMDEL." -
- ".$frm->admin_button('delete_confirm', LAN_CONFDELETE, 'delete')." - ".$frm->admin_button('delete_cancel', LAN_CANCEL, 'cancel')." - -
-
-
- "; - $ns->tablerender(LAN_CONFDELETE, $mes->render() . $text); - - require_once(e_ADMIN."footer.php"); - exit; -} - - -if ($sql->select("banner")) -{ - while ($banner_row = $sql->fetch()) - { - if (strpos($banner_row['banner_campaign'], "^") !== FALSE) { - $campaignsplit = explode("^", $banner_row['banner_campaign']); - $banner_row['banner_campaign'] = $campaignsplit[0]; - } - - if ($banner_row['banner_campaign']) - { - $campaigns[$banner_row['banner_campaign']] = $banner_row['banner_campaign']; - } - - if ($banner_row['banner_clientname']) - { - $clients[$banner_row['banner_clientname']] = $banner_row['banner_clientname']; - } - - if ($banner_row['banner_clientlogin']) - { - $logins[] = $banner_row['banner_clientlogin']; - } - - if ($banner_row['banner_clientpassword']) - { - $passwords[] = $banner_row['banner_clientpassword']; - } - } -} - -$text = ''; - -if (!$action) -{ - if (!$banner_total = $sql->select("banner")) - { - $mes->addInfo(BNRLAN_00); - } - else - { - $text = " -
-
- ".LAN_MANAGE." - - - - - - - - - - - - - - - - - - - - - - "; - - while ($banner_row = $sql->fetch()) - { - - $clickpercentage = ($banner_row['banner_clicks'] && $banner_row['banner_impressions'] ? round(($banner_row['banner_clicks'] / $banner_row['banner_impressions']) * 100)."%" : "-"); - $impressions_left = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] - $banner_row['banner_impressions'] : BANNERLAN_30); - $impressions_purchased = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] : BANNERLAN_30); - - $start_date = ($banner_row['banner_startdate'] ? strftime("%d %B %Y", $banner_row['banner_startdate']) : LAN_NONE); - $end_date = ($banner_row['banner_enddate'] ? strftime("%d %B %Y", $banner_row['banner_enddate']) : LAN_NONE); - - if (strpos($banner_row['banner_campaign'], "^") !== FALSE) { - $campaignsplit = explode("^", $banner_row['banner_campaign']); - $banner_row['banner_campaign'] = $campaignsplit[0]; - $textvisivilitychanged = "(*)"; - } else { - $textvisivilitychanged = ""; - } - - $text .= " - - - - - - - - - - "; - } - } - $text .= " - -
".LAN_ID."".BANNERLAN_22."".BANNERLAN_24."".BANNERLAN_25."".BANNERLAN_26."".BANNERLAN_26."".LAN_OPTIONS."
".$banner_row['banner_id']." - - ".($banner_row['banner_clientname'] ? $banner_row['banner_clientname'] : BANNERLAN_31)." - - ".$banner_row['banner_clicks']."".$clickpercentage."".$impressions_purchased."".$impressions_left." - - ".ADMIN_EDIT_ICON." - -
- -
-
- - "; - - $ns->tablerender(LAN_PLUGIN_BANNER_NAME.SEP.LAN_MANAGE, $mes->render().$text); -} - -if ($action == "create") -{ - if ($sub_action == "edit" && $id) - { - if (!$sql->select("banner", "*", "banner_id = '".$id."'")) // FIXME check not working for some reason - { - $mes->addWarning(BNRLAN_01); - } - else - { - while ($banner_row = $sql->fetch()) - { - $_POST['client_name'] = $banner_row['banner_clientname']; - $_POST['client_login'] = $banner_row['banner_clientlogin']; - $_POST['client_password'] = $banner_row['banner_clientpassword']; - $_POST['banner_image'] = $banner_row['banner_image']; - $_POST['click_url'] = $banner_row['banner_clickurl']; - $_POST['impressions_purchased'] = $banner_row['banner_impurchased']; - $_POST['banner_campaign'] = $banner_row['banner_campaign']; - $_POST['banner_active'] = $banner_row['banner_active']; - $_POST['banner_startdate'] = $banner_row['banner_startdate']; - $_POST['banner_enddate'] = $banner_row['banner_enddate']; - - if (strpos($_POST['banner_campaign'], "^") !== FALSE) { - $campaignsplit = explode("^", $_POST['banner_campaign']); - $listtypearray = explode("-", $campaignsplit[1]); - $listtype = $listtypearray[0]; - $campaign_pages = str_replace("|", "", $listtypearray[1]); - $_POST['banner_campaign'] = $campaignsplit[0]; - } else { - $_POST['banner_campaign'] = $banner_row['banner_campaign']; - } - - } - } - } - - $text = " -
-
- ".($sub_action == "edit" ? LAN_UPDATE : LAN_CREATE)." - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
".BNRLAN_11." - "; - - - if (count($campaigns)) - { - $text .= $frm->select('banner_campaign_sel',$campaigns,$_POST['banner_campaign'],'',LAN_SELECT."..."); - $text .= $frm->text('banner_campaign','','',array('placeholder'=> 'Or enter a new campaign')); - } - else - { - $text .= $frm->text('banner_campaign'); - } - $text .= "".BNRLAN_25." -
".BANNERLAN_22." - "; - - if (count($clients)) - { - $text .= $frm->select('banner_client_sel',$clients, $_POST['client_name'],'', LAN_SELECT."..."); - $text .= $frm->text('client_name','','',array('placeholder'=> 'Or enter a new client')); - - - /* - - - $text .= " - -
- ".$frm->admin_button('add_new_client', BNRLAN_30, 'other', '', array('other' => "onclick=\"e107Helper.toggle('add-new-client-cont', false); \$('banner_client_sel').selectedIndex=0; return false;\""))." -
- -
- - ".BNRLAN_29." -
- - "; - - */ - } - else - { - - $text .= $frm->text('client_name',$_POST['client_name']); - $text .= "".BNRLAN_29.""; - } - - $text .= " - ".BNRLAN_28."
".BNRLAN_12."".$frm->text('client_login', $_POST['client_login'], '20')."
".LAN_PASSWORD."".$frm->password('client_password', $_POST['client_password'], '50','strength=1&generate=1&required=0')."
".LAN_IMAGE."".$frm->imagepicker('banner_image', $_POST['banner_image'], '', 'media=banner&w=600'); - - - - /* - $text .= " -
- -
- "; - */ - - $text .= " -
".BNRLAN_15."".$frm->text('click_url', $_POST['click_url'], '150')."
".BNRLAN_16."".$frm->number('impressions_purchased', $_POST['impressions_purchased'], 10)."".BNRLAN_31."
".LAN_START."".$frm->datepicker('banner_startdate', $_POST['banner_startdate'],'type=date')."
".LAN_END."".$frm->datepicker('banner_enddate', $_POST['banner_enddate'],'type=date')."
".LAN_VISIBILITY." - ".$e_userclass->uc_dropdown('banner_class', $_POST['banner_active'], 'public,member,guest,admin,classes,nobody,classes')." -
- -
"; - - if ($sub_action == "edit" && $id) - { - $text .= $frm->admin_button('updatebanner','no-value','create', LAN_UPDATE); - $text .= ""; - } - else - { - $text .= $frm->admin_button('createbanner','no-value','create', LAN_CREATE); - } - - $text .= " -
-
-
"; - - $ns->tablerender(LAN_PLUGIN_BANNER_NAME.SEP.($sub_action == "edit" ? LAN_UPDATE : LAN_CREATE), $text); - -} - - - -if ($action == "menu") -{ - $in_catname = array(); // Notice removal - $all_catname = array(); - - $array_cat_in = explode("|", $menu_pref['banner_campaign']); - if (!$menu_pref['banner_caption']) - { - $menu_pref['banner_caption'] = BNRLAN_38; - } - - $category_total = $sql -> select("banner", "DISTINCT(banner_campaign) as banner_campaign", "ORDER BY banner_campaign", "mode=no_where"); - while ($banner_row = $sql -> fetch()) - { - $all_catname[] = $banner_row['banner_campaign']; - - if (in_array($banner_row['banner_campaign'], $array_cat_in)) - { - $in_catname[] = $banner_row['banner_campaign']; - } - } - - - $text = " - - "; - - $ns->tablerender(LAN_PLUGIN_BANNER_NAME.SEP.BNRLAN_36, $mes->render() . $text); -} - - -function admin_banner_adminmenu() -{ - - $qry = e_QUERY; - $act = vartrue($qry,'main'); - - $var['main']['text'] = LAN_MANAGE; - $var['main']['link'] = e_SELF; - - $var['create']['text'] = LAN_CREATE; - $var['create']['link'] = e_SELF."?create"; - - $var['menu']['text'] = BNRLAN_35; - $var['menu']['link'] = e_SELF."?menu"; - - e107::getNav()->admin(LAN_PLUGIN_BANNER_NAME, $act, $var); -} - -require_once(e_ADMIN."footer.php"); - - -// Log event to admin log -function banners_adminlog($msg_num='00', $woffle='') -{ - global $admin_log; - $pref = e107::getPref(); - -// if (!varset($pref['admin_log_log']['admin_banners'],0)) return; - e107::getLog()->add('BANNER_'.$msg_num,$woffle, E_LOG_INFORMATIVE,''); -} - -?> \ No newline at end of file