Select a mailing list;'; $foundlist = false; while($l=mysql_fetch_assoc($lists)) { $l = stripslashes_array($l); if(AllowList($l['ListID'])) { $foundlist = true; if ($CURRENTADMIN['DisplaySummaries']) { $numSubs = (int)mysql_result(mysql_query("SELECT COUNT(*) from " . $TABLEPREFIX . "members where ListID=" . addslashes($l['ListID'])), 0, 0); if($numSubs == 1) $subs = "1 subscriber"; else $subs = number_format($numSubs, 0) . " subscribers"; $subs = " (" . $subs . ")"; } else { $subs = ""; } $alllists.=$l["ListID"]."->".str_replace(';', '$$SEMI$$', str_replace(':', '$$COLON$$', $l["ListName"]))."$subs;"; } } if($Action == 'Add') { if (!$foundlist) { $OUTPUT = MakeBox("Add Banned Emails",'No mailing lists have been created. Please click on the "Create Mailing List" button below to create one.



'); } else { //add new banned! $FORM_ITEMS2[$FORM_REQUIRED_ITEM . "Banned Emails"]="textarea|Email:46:5:"; $HELP_ITEMS["Email"]["Title"] = "Banned Emails"; $HELP_ITEMS["Email"]["Content"] = "Enter the list of emails that you wish to ban here. You should separate each email address with a comma. To ban an entire domain enter @DOMAINNAME. For example, \'@hotmail.com\' would ban everyone using Hotmail."; $FORM_ITEMS2[$FORM_REQUIRED_ITEM . "Ban From"]="select|ListID:1:$alllists"; $HELP_ITEMS["ListID"]["Title"] = "Ban From"; $HELP_ITEMS["ListID"]["Content"] = "Which list would you like to ban these emails/domains from?"; $FORM_ITEMS2[-1]="submit|Save:1-banned"; $FORM2=new AdminForm; $FORM2->title="AddBanned"; $FORM2->items=$FORM_ITEMS2; $FORM2->action=MakeAdminLink("banned?Add=Banned"); $FORM2->MakeForm("Banned Email/Domain Details"); $FORM2->output = "Use the form below to add one or more email addresses to your banned email list.
Separate multiple email addresses with a comma, such as 'user1@host.com, user2@host.com'.
To ban an entire domain enter @DOMAINNAME. For example, '@hotmail.com' would ban everyone using Hotmail." . $FORM2->output; $OUTPUT.=MakeBox("Add Banned Emails",$FORM2->output); $OUTPUT .= ' '; } } else { if($View=='Banned') { if(!$OffSet || (int)$OffSet < 0) $OffSet=0; $x = " AND ListID='".addslashes($ListID)."'"; //now do activate, deactivate and delete if($Action=="StatusD"){ mysql_query("UPDATE " . $TABLEPREFIX . "banned_emails SET Status='0' WHERE Email='".addslashes($Email)."' $x"); } if($Action=="StatusA"){ mysql_query("UPDATE " . $TABLEPREFIX . "banned_emails SET Status='1' WHERE Email='".addslashes($Email)."' $x"); } if($Action=="Delete"){ mysql_query("DELETE FROM " . $TABLEPREFIX . "banned_emails WHERE Email='".addslashes($Email)."' $x"); } //end actions! if($Status!="ALL"){ $x.="AND Status='".addslashes($Status)."'"; } if($BannedType=="domains"){ $x.="AND Email LIKE '@%'"; }elseif($BannedType=="addy"){ $x.="AND Email NOT LIKE '@%'"; } $Total=mysql_result(mysql_query("SELECT COUNT(*) FROM " . $TABLEPREFIX . "banned_emails WHERE Email LIKE '%".addslashes($Search)."%' $x"), 0, 0); $results=mysql_query("SELECT * FROM " . $TABLEPREFIX . "banned_emails WHERE Email LIKE '%".addslashes($Search)."%' $x ORDER BY Email LIMIT ".($OffSet*$PerPage).",$PerPage"); if($Total<=$PerPage){ $Pages=1; }else{ $Pages=ceil($Total/$PerPage); } $RTB='Your search returned '.number_format($Total, 0).' results.'; if($Total > 0) { $RTB .= 'Currently displaying page '.number_format(($DisplayPage+1), 0).' of '.number_format($Pages, 0).' pages.'; } else { $RTB .= ' Click the "Start New Search" button to search again.'; } $RTB .= '



'; if($Total > 0) { $RTB .= ' '; if($Pages > 1) { $RTB .= ' '; } $RTB .= ' '; while($r=mysql_fetch_assoc($results)){ $r = stripslashes_array($r); $RTB .= ' '; } $RTB .= '
'; if($Pages > 1) { $RTB .= ' «« |'; } if($DisplayPage > 0){ $RTB.=' Prev |'; } for($i = 0; $i < $Pages; $i++) { if($DisplayPage != $i) $RTB .= ' ' . ($i+1) . ' |'; else $RTB .= ' ' . ($i+1) . ' |'; } if($DisplayPage < $Pages-1){ $RTB.=' Next |'; } if($Pages > 1) { $RTB .= ' »»'; } $RTB .= '
  Email Address Date Added Action
' . $r["Email"] . ' ' . DisplayDate($r["DateAdded"]) . ' '; if($r["Status"]==1) { $RTB.=MakeLink("banned?View=Banned&DisplayPage=$DisplayPage&Action=StatusD&ListID=$ListID&Status=$Status&Search=$Search&OffSet=$OffSet&PerPage=$PerPage&Email=".$r["Email"],"Unban") . "   "; }else{ $RTB.= MakeLink("banned?View=Banned&DisplayPage=$DisplayPage&Action=StatusA&ListID=$ListID&Status=$Status&Search=$Search&OffSet=$OffSet&PerPage=$PerPage&Email=".$r["Email"],"Re-ban") . "   "; } $RTB.= MakeLink("banned?View=Banned&Action=Delete&DisplayPage=$DisplayPage&ListID=$ListID&Status=$Status&Search=$Search&OffSet=$OffSet&PerPage=$PerPage&Email=".$r["Email"],"Delete",1); $RTB .= '
'; } $OUTPUT.=MakeBox("Search Banned Emails",$RTB); $DontDo=1; } if($Add=="Banned") { //check if its already there! $arrEmail = explode(",", $Email); for($i = 0; $i < sizeof($arrEmail); $i++) { if(trim($arrEmail[$i]) != "") { $count_check = mysql_result(mysql_query("SELECT COUNT(*) FROM " . $TABLEPREFIX . "banned_emails WHERE Email LIKE '" . addslashes(trim($arrEmail[$i])) . "' && ListID='".addslashes($ListID)."'"), 0, 0); if((int)$count_check==0) { mysql_query("INSERT INTO " . $TABLEPREFIX . "banned_emails SET Email='" . addslashes(trim($arrEmail[$i])) . "', DateAdded='".addslashes($SYSTEMTIME)."', ListID='".addslashes($ListID)."', Status='1'"); } } } // Show the success message $OUTPUT .= MakeSuccessBox("Banned Emails Added Successfully", "The emails that you entered have been added to your banned list.", MakeAdminLink("banned")); } if(!$DontDo && $Add != "Banned") { if (!$foundlist) { $OUTPUT = MakeBox("Manage Banned Emails",'No mailing lists have been created. Please click on the "Create Mailing List" button below to create one.



'); } else { $FORM_ITEMS[$FORM_REQUIRED_ITEM."View"]="select|BannedType:1:all->All Banned;domains->Banned Domains;addy->Banned Addresses"; $HELP_ITEMS["BannedType"]["Title"] = "View"; $HELP_ITEMS["BannedType"]["Content"] = "Would you like to view a list of banned email address, banned domains, or both banned emails and domains?"; $FORM_ITEMS[$FORM_REQUIRED_ITEM."Status"]="select|Status:1:ALL->View All;0->Inactive;1->Active:1"; $HELP_ITEMS["Status"]["Title"] = "Status"; $HELP_ITEMS["Status"]["Content"] = "Would you like to view a list of active banned emails, inactive banned emails, or both?"; $FORM_ITEMS[$FORM_REQUIRED_ITEM."View Banned From"]="select|ListID:1:$alllists"; $HELP_ITEMS["ListID"]["Title"] = "View Banned From"; $HELP_ITEMS["ListID"]["Content"] = "Which mailing list would you like to view banned emails from?"; $FORM_ITEMS[$FORM_REQUIRED_ITEM."Emails Per DisplayPage"]="select|PerPage:1:10->10;20->20;50->50;100->100:20"; $HELP_ITEMS["PerPage"]["Title"] = "Banned Emails Per DisplayPage"; $HELP_ITEMS["PerPage"]["Content"] = "How many banned emails / domains should be shown in the list on the next page?"; $FORM_ITEMS[$FORM_NOT_REQUIRED_ITEM."Match Email"]="textfield|Search:30:44:"; $HELP_ITEMS["Search"]["Title"] = "Match Email"; $HELP_ITEMS["Search"]["Content"] = "If you want to filter banned emails by their email address, then enter the complete or partial email address here."; $FORM_ITEMS["-1"]="submit|Search:1-members"; //make the form $FORM=new AdminForm; $FORM->title="View Banned Emails"; $FORM->items=$FORM_ITEMS; $FORM->action=MakeAdminLink("banned?View=Banned"); $FORM->MakeForm("Banned Search Details"); // Add the description $FORM->output = "Use the form below to view or search for emails and domains on your banned email list.
On the next page you will have the option to unban and remove emails from your banned list." . $FORM->output; $FORM->output .= ' '; $OUTPUT .= MakeBox("Manage Banned Emails",$FORM->output); } } } ?>