I'm trying to modify MrEdge73's AcceptApplications function to include a blacklist, but I can't get it to work.
I got the adding/removing names part working just fine, but it won't do anything when I test it with the application function.
The BlackList map is the username and userid, like this:
Here's what I tried:
Even if the person is listed in the BlackList, he gets accepted into the clan. I can't see what I'm doing wrong here.
I got the adding/removing names part working just fine, but it won't do anything when I test it with the application function.
The BlackList map is the username and userid, like this:
Code:
HasteBro 930575
Here's what I tried:
PHP:
string appl(boolean ProcessAll)
{
string[string]BlackList;
file_to_map("BlackList.txt", BlackList);
string outstring="";
matcher APPCHECK = create_matcher("y <b>(\\d+)</b> p", visit_url("clan_office.php"));
if(APPCHECK.find())
{
outstring="There are "+APPCHECK.group( 1 )+" new member applications.<br />";
if (ProcessAll==true)
{
int dudes = 0;
matcher Applicants = create_matcher("who=(\\d+)\">(.+?)<", visit_url(clan_applications.php));
#"
while (Applicants.find())
{
foreach i in blacklist
{
if( BlackList[i] == Applicants.group( 1 ) )
{
visit_url("clan_applications.php?request"+Applicants.group( 1 )+"=2&action=process");
outstring = outstring+""+ i +" ("+ BlackList[i] +") was rejected due to being on the blacklist. <br />";
}
else
{
visit_url("clan_applications.php?request"+Applicants.group( 1 )+"=1&action=process");
outstring = outstring+"Accepted "+Applicants.group( 2 )+" into the clan! <br />";
dudes = dudes+1;
}
}
}
outstring = outstring+"HastyBuffer welcomed "+to_string(dudes)+" new member(s)! <br />";
}
}
else
outstring="There are no new member applications <br />";
outstring="<FONT color=#365f91>"+outstring+"</FONT><br />";
return outstring;
}
Even if the person is listed in the BlackList, he gets accepted into the clan. I can't see what I'm doing wrong here.