Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Trouble loading IPtoCountry table data
 New Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ZORRO
Starting Member

13 Posts

Posted - 10 March 2016 :  14:34:33  Show Profile  Reply with Quote
re: mod iptocountry-3407-31~1

I wonder if there's trick to loading the FORUM_IPTOCOUNTRY table?

First, I tried using MOD DB to load the big file DBS_LOCALE_ALL.asp, but the script always times out.

Next, I tried dividing the DBS_LOCALE file into 8 separate files. My shared host seems to be able to handle about 14,000 records at a time before timing out...

The first file of about 13,000 records loaded fine :)

But the next exhibited unexpected behavior. Certain records would load repeatedly, with new auto-generated index, but repeated IPSTART, IPEND, IPCOUNTRY data. That process adds thousands of new records, based on one input record, until it aborts with a subscript out of range error.

I had some luck getting deeper into the 2nd file by adding more frequent [END] breaks, about every 100 records, but this is getting to be real time consuming.

Is there a better way?

Thanks for any advice!

Jeff

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 10 March 2016 :  18:32:52  Show Profile
Hi Jeff,

Just had a look at the dbs_locale_all.asp file and have noticed that the last [INSERT] statement does not have a [END] at the very end, add a new line and add the [END] there and see how you go.

Cheers,

David Greening
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 March 2016 :  20:41:21  Show Profile
quote:
Originally posted by ZORRO

re: mod iptocountry-3407-31~1

I wonder if there's trick to loading the FORUM_IPTOCOUNTRY table?




I put another file out there - get the v3.2 package, it includes the dbs files broken into 4 parts. Import them in order, because the first file will drop and recreate the table.

Edited by - Carefree on 10 March 2016 20:50:46
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 11 March 2016 :  01:02:33  Show Profile
Hi Carefree,

You need to update dbs_locale_all.asp as the file ends like:

(IPSTART,IPEND,IPCOUNTRY)#('223.255.254.000','223.255.254.255','Singapore')
(IPSTART,IPEND,IPCOUNTRY)#('223.255.255.000','223.255.255.255','Australia')
(IPSTART,IPEND,IPCOUNTRY)#('224.000.000.000','255.255.255.255','Bogons')

Notice the missing [END] in it?

Cheers,

David Greening
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 11 March 2016 :  02:59:56  Show Profile
Did it already, thanks.
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 11 March 2016 :  17:13:17  Show Profile
Hi Carefree,

I just downloaded the file again and it shows it is still missing:
quote:
Originally posted by Carefree

Did it already, thanks.


It is the dbs_locale_all.asp file in the folder New Files that needs fixing or removing.

Cheers,

David Greening
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 11 March 2016 :  22:24:36  Show Profile
Odd - it's updated here. I replaced it again.
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 12 March 2016 :  00:40:32  Show Profile
Just downloaded it again, and the file in the /New Files/dbs_locale_all.asp still has it missing.
quote:
Originally posted by Carefree

Odd - it's updated here. I replaced it again.

The file in /New Files/dbs Locale All/dbs_locale_all.asp is updated and fine.

You could remove /New Files/dbs_locale_all.asp from the archive to avoid users from downloading and using it as you have it in the /New Files/dbs Locale All/ folder.

Cheers,

David Greening
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 12 March 2016 :  01:38:31  Show Profile
I deleted that from here when I created the sub-folders, before I updated the archive. It shouldn't have been there. Replaced it again.
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 12 March 2016 :  01:52:26  Show Profile
That got it.. The file that was faulty is no longer there...

By the way Jeff,

How did you go after the fix?

Cheers,

David Greening
Go to Top of Page

ZORRO
Starting Member

13 Posts

Posted - 12 March 2016 :  11:26:56  Show Profile
Thanks for trying to help! Actually, I had added the final [END]'s in case they were needed, and I had identified that the script timed-out in my remote host at about 14,000 records. Thats why I needed to divide the input file into eight sections. The first section loaded fine, but the subsequent one ran into a problem where it would fail to readln the next input record but instead would populate the table with one record over 27,000 times! (Same data, but with the IPID dutifully incrmementing).

Subsequently, I successfully extracted the three data fields from the DBS file and populated the FORUM_IPTOCOUNTRY table manually, via import-export and the SQL INSERT. We now have 115,304 records. The IPID field auto filled starting at 1 and incrementing by 1. The FORUM_IPTOCOUNTRY table looks good.

I'm trying to ban a couple countries.

The BAN IPS admin screen now pops up ok but does not work the same as other functions. The country drop down appears, but does not update the table.

I can add a country manually via SQL but not via the admin screen. But I can successfully EDIT once a record is in the FORUM_BAN_IPS table.

QUESTION: If I manually enter one record with a valid IP Range and the corresponding Country, will that ban all IP ranges for that country?



Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 12 March 2016 :  16:54:41  Show Profile
Do not include any data in the IP fields if you are trying to ban an entire country. Simply choose the country and hit submit. I can change that to auto-submit if you'd like.

Go to Top of Page

ZORRO
Starting Member

13 Posts

Posted - 12 March 2016 :  22:05:45  Show Profile
ok. The trouble is that there is no SUBMIT button on the BAN IPs admin screen. I select a country, the display field gets populated with that country name but then nothing happens and the table is not updated. It remained empty.

That is why I manually updated the table via the SSMS. I only entered the countries first IP range and country name in one record. It seems to be blocking ALL. ALL from that country or all from anywhere, I dont know, but it is effective! I'd usually have about 30 Forum membership requests from the bots from Fujian China by now and those would be from a multitude of IP blocks.

I presume then that for each row in the FORUM_BAN_IPS Table, the idea is to enter EITHER an IP range, or a COUNTRY name, but not both?

Jeff
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 13 March 2016 :  02:42:11  Show Profile
Here's a quick fix to separate the functions and make countries auto-submit. With this version, if you choose a country, it will already submit. The range will still use a CSS-generated button.

"admin_ban_ips.asp"


<%
'#################################################################################
'## Snitz Forums 2000 v3.4.07
'#################################################################################
'## Copyright (C) 2000-15 Michael Anderson, Pierre Gorissen,
'##                       Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain
'## intact in the scripts and in the HTML output.  The "powered by"
'## text/logo with a link back to http://forum.snitz.com in the
'## footer of the pages MUST remain visible when the pages are
'## viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to Free Software Foundation, Inc.
'## 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
'##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="includes/inc_sha256.asp" -->
<!--#INCLUDE FILE="includes/inc_header.asp" -->
<%
On Error Resume Next
Call ModCheck(intMod15)
If mLev < 4 Then
	scriptname = split(Request.ServerVariables("SCRIPT_NAME"),"/")
	Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname)) & "?" & Request.ServerVariables("Query_String")
End If
Response.Write	"			<table border=""0"" width=""100%"">" & vbNewLine & _
	"				<tr>" & vbNewLine & _
	"					<td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"					" & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
	"					" & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""admin_home.asp"">Admin Section</a><br />" & vbNewLine & _
	"					" & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Banned IPs<br /></font></td>" & vbNewLine & _
	"				</tr>" & vbNewLine & _
	"			</table><br><br>" & vbNewLine
strStart = "" : strEnd = ""
strMyIP = Request.ServerVariables("REMOTE_ADDR")
If strMyIP = "::1" Then strMyIP = "127.0.0.1"
If Request("IP_START") > "" Then strStart=Request("IP_START")
If Request("IP_END") > "" Then strEnd=Request("IP_END")
If Request("IP_Country") > "A" Then
	strCountry = ChkString(Request("IP_Country"),"SQLString")
	strSql = "SELECT * FROM " & strTablePrefix & "BAN_IPS WHERE IP_COUNTRY LIKE '%" & strCountry & "%'"
	Set rsCheck = my_Conn.Execute(strSql)
	If Not rsCheck.EOF Then
		Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
			"	<tr valign=""middle"">" & vbNewLine & _
			"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
			"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Already banned." & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"			</table>" & vbNewLine & _
			"		</td>" & vbNewLine & _
			"	</tr>" & vbNewLine & _
			"</table>" & vbNewLine & _
			"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
		rsCheck.Close
		Set rsCheck = Nothing
		WriteFooter
		Response.End
	Else
		Set rsCheck=Nothing
		strSql = "SELECT M_COUNTRY FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID=" & MemberID
		Set rsMC = my_Conn.Execute(strSql)
		If Not rsMC.EOF Then
			strMyC = rsMC("M_COUNTRY")
			rsMC.Close
		End If
		Set rsMC = Nothing
		If strMyC = Request("IP_COUNTRY") Then
			Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
				"	<tr valign=""middle"">" & vbNewLine & _
				"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
				"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
				"				<tr valign=""middle"">" & vbNewLine & _
				"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
				"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
				"						</font>" & vbNewLine & _
				"					</td>" & vbNewLine & _
				"				</tr>" & vbNewLine & _
				"				<tr valign=""middle"">" & vbNewLine & _
				"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
				"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>This country would ban your own connection." & vbNewLine & _
				"						</font>" & vbNewLine & _
				"					</td>" & vbNewLine & _
				"				</tr>" & vbNewLine & _
				"			</table>" & vbNewLine & _
				"		</td>" & vbNewLine & _
				"	</tr>" & vbNewLine & _
				"</table>" & vbNewLine & _
				"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
			WriteFooter
			Response.End
		End If
		strSql = "INSERT INTO " & strTablePrefix & "BAN_IPS (IP_COUNTRY) VALUES ('" & Request("IP_COUNTRY") & "')"
		my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
		Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
			"	<tr valign=""middle"">" & vbNewLine & _
			"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
			"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Added!" & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"			</table>" & vbNewLine & _
			"		</td>" & vbNewLine & _
			"	</tr>" & vbNewLine & _
			"</table>" & vbNewLine & _
			"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
		WriteFooter
		Response.End
	End If
End If
Err_IP_Start	= "You must specify the starting IP address or range."
Err_IP_End	= "You must specify the ending IP address or range."
strLead = "00"
If strStart > "" Then
	intSeg = 0
	For i = 1 To len(strStart)
		If Mid(strStart,i,1) = "." Then
			intSeg = intSeg + 1
			If intSeg = 1 Then 
				strPart1 = Right(strLead & Left(strStart,i - 1),3)
				x=i
			End If
			If intSeg = 2 Then
				strPart2 = Right(strLead & Mid(strStart,x + 1,i - x - 1),3)
				y = i
			End If
			If intSeg = 3 Then
				strPart3 = Right(strLead & Mid(strStart,y + 1,i - y - 1),3)
				strPart4 = Right((strLead & Mid(strStart,i + 1)),3)
			End If
		End If
	Next
	strStart = strPart1 & "." & strPart2 & "." & strPart3 & "." & strPart4
End If
If strEnd > "" Then
	intSeg = 0
	For i = 1 To Len(strEnd)
		If Mid(strEnd,i,1) = "." Then
			intSeg = intSeg + 1
			If intSeg = 1 Then 
				strPart1 = Right(strLead & Left(strEnd,i - 1),3)
				x=i
			End If
			If intSeg = 2 Then
				strPart2 = Right(strLead & Mid(strEnd,x + 1,i - x - 1),3)
				y = i
			End If
			If intSeg = 3 Then
				strPart3 = Right(strLead & Mid(strEnd,y + 1,i - y - 1),3)
				strPart4 = Right((strLead & Mid(strEnd,i + 1)),3)
			End If
		End If
	Next
	strEnd = strPart1 & "." & strPart2 & "." & strPart3 & "." & strPart4
End If
If Request("mode") = "delete" Then 
	Dim rsDelete
	strSql = "DELETE FROM " & strTablePrefix & "BAN_IPS"
	strSql = strSql & " WHERE BAN_ID = " & Request("Ban_ID")
	my_Conn.Execute(strSql) 
	Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
		"	<tr valign=""middle"">" & vbNewLine & _
		"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
		"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Deleted!" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"			</table>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"<meta http-equiv=""Refresh"" content=""2; URL=admin_ban_ips.asp"">" & vbNewLine
	WriteFooter
	Response.End
End If
If Request("EditBan") = "doit" Then 
	Dim rsUpdate
	strSql = "UPDATE " & strTablePrefix & "BAN_IPS"
	strSql = strSql & " Set IP_START = '" & strStart & "', IP_END='" & strEnd & "' WHERE BAN_ID = " & Request("Ban_ID")
	If Request("IP_START") = "" Then
		Response.Write	"<p align=""center""><font color=""red"" size=""1""><b>" & Err_IP_Start & "</b>" & vbNewLine &_
			"<br><br>" & vbNewLine &_
			"<a href=""javascript:history.go(-1)"">Go Back</a></font></p>"
		WriteFooter
		Response.End	
	End If
	Set rsUpdate = my_Conn.Execute(strSql)
	Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
		"	<tr valign=""middle"">" & vbNewLine & _
		"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
		"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Updated!" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"			</table>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
	WriteFooter
	Response.End
End If
If Request("mode") = "add" Then
	If strStart > "" Then
		Err.Clear
		strSqlIP = "SELECT IPCOUNTRY FROM " & strTablePrefix & "IPTOCOUNTRY WHERE IPSTART <= '" & strStart & "' AND IPEND >= '" & strStart & "'"
		Set rsCheck = my_Conn.Execute(strSqlIP)
		If rsCheck.EOF Then
			Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
				"	<tr valign=""middle"">" & vbNewLine & _
				"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
				"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
				"				<tr valign=""middle"">" & vbNewLine & _
				"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
				"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
				"						</font>" & vbNewLine & _
				"					</td>" & vbNewLine & _
				"				</tr>" & vbNewLine & _
				"				<tr valign=""middle"">" & vbNewLine & _
				"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
				"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>IP address not found in Country IP list." & vbNewLine & _
				"						</font>" & vbNewLine & _
				"					</td>" & vbNewLine & _
				"				</tr>" & vbNewLine & _
				"			</table>" & vbNewLine & _
				"		</td>" & vbNewLine & _
				"	</tr>" & vbNewLine & _
				"</table>" & vbNewLine & _
				"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
			rsCheck.Close
			Set rsCheck = Nothing
			WriteFooter
			Response.End
		Else
			strSqlIP2 = "SELECT IP_COUNTRY FROM " & strTablePrefix & "BAN_IPS WHERE IP_COUNTRY='" & rsCheck("IPCountry") & "'"
			Set rsCheck2 = my_Conn.Execute(strSqlIP2)
			If Not rsCheck2.EOF Then
				Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
					"	<tr valign=""middle"">" & vbNewLine & _
					"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
					"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
					"				<tr valign=""middle"">" & vbNewLine & _
					"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
					"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
					"						</font>" & vbNewLine & _
					"					</td>" & vbNewLine & _
					"				</tr>" & vbNewLine & _
					"				<tr valign=""middle"">" & vbNewLine & _
					"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
					"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Already banned by country:  <b>" & rsCheck("IPCountry") & "</b>" & vbNewLine & _
					"						</font>" & vbNewLine & _
					"					</td>" & vbNewLine & _
					"				</tr>" & vbNewLine & _
					"			</table>" & vbNewLine & _
					"		</td>" & vbNewLine & _
					"	</tr>" & vbNewLine & _
					"</table>" & vbNewLine & _
					"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
				rsCheck2.Close
				Set rsCheck2 = Nothing
				rsCheck.Close
				Set rsCheck = Nothing
				WriteFooter
				Response.End
			End If
			Set rsCheck2 = Nothing
			rs.Close
		End If
		Set rs = Nothing
	End If	
	strSql = "SELECT * FROM " & strTablePrefix & "BAN_IPS WHERE (IP_START < '" & strStart & "' AND IP_END > '" & strStart & "') OR IP_START='" & strStart & "' OR IP_END='" & strStart & "'"
	Set rsCheck = my_Conn.Execute(strSql)
	If Not rsCheck.EOF Then
		Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
			"	<tr valign=""middle"">" & vbNewLine & _
			"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
			"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Already banned in range:  " & rsCheck("IP_START") & "-" & rsCheck("IP_END") & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"			</table>" & vbNewLine & _
			"		</td>" & vbNewLine & _
			"	</tr>" & vbNewLine & _
			"</table>" & vbNewLine & _
			"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
		rsCheck.Close
		Set rsCheck = Nothing
		WriteFooter
		Response.End
	End If
	Set rsCheck = Nothing
	If Len(Request("IP_Country")) < 2 Then
		strIPCountry = ""
	Else
		strIPCountry = ChkString(Request("IP_Country"),"SQLString")
	End If
	intSeg = 0
	For i = 1 To Len(strMyIP)
		If Mid(strMyIP,i,1)="." Then
			intSeg = intSeg + 1
			If intSeg = 1 Then 
				strPart1 = Right(strLead & Left(strMyIP,i - 1),3)
				x = i
			End If
			If intSeg = 2 Then
				strPart2 = Right(strLead & Mid(strMyIP,x + 1,i - x - 1),3)
				y = i
			End If
			If intSeg = 3 Then
				strPart3 = Right(strLead & Mid(strMyIP,y + 1,i - y - 1),3)
				strPart4 = Right((strLead & Mid(strMyIP,i + 1)),3)
			End If
		End If
	Next
	strMyIP = strPart1 & "." & strPart2 & "." & strPart3 & "." & strPart4
	If strMyIP >= strStart And strMyIP <= strEnd Then
		Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
			"	<tr valign=""middle"">" & vbNewLine & _
			"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
			"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"				<tr valign=""middle"">" & vbNewLine & _
			"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>This range would ban your own connection." & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine & _
			"			</table>" & vbNewLine & _
			"		</td>" & vbNewLine & _
			"	</tr>" & vbNewLine & _
			"</table>" & vbNewLine & _
			"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
		WriteFooter
		Response.End
	End If	
	strSql = "INSERT INTO " & strTablePrefix & "BAN_IPS (IP_START,IP_END,IP_COUNTRY) VALUES ('" & chkString(strStart,"SqlString") & "', '" & chkString(strEnd,"SqlString") & "', '" & strIPCountry & "')"
	my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
	Response.Write	"<table align=""center"" width=""50%"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """ border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
		"	<tr valign=""middle"">" & vbNewLine & _
		"		<td align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """>" & vbNewLine & _
		"			<table align=""center"" width=""100%"" bgColor=""" & strPopUpBorderColor & """ border=""1"" cellpadding=""4"" cellspacing=""1"" style=""border-collapse:collapse;"">" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strCategoryCellColor & """ colspan=""4"">" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize+1 & """ color=""" & strCategoryFontColor & """><b>IP Bans</b>" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"				<tr valign=""middle"">" & vbNewLine & _
		"					<td align=""center"" width=""100%"" bgColor=""" & strForumCellColor & """>" & vbNewLine & _
		"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>Added!" & vbNewLine & _
		"						</font>" & vbNewLine & _
		"					</td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"			</table>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"<meta http-equiv=""Refresh"" content=""4; URL=admin_ban_ips.asp"">" & vbNewLine
	WriteFooter
	Response.End
End If
If Request.QueryString("mode") = "edit" Then
	Response.Write "<form action=""admin_ban_ips.asp?Ban_ID=" & Request.QueryString("Ban_ID") & """ method=""post"">" & vbNewLine & _
		"	<input type=""hidden"" name=""EditBan"" value=""doit"">" & vbNewLine & _
		"	<table border=""0"" width=""800px;"" cellspacing=""0"" cellpadding=""0"" align=""center"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """>" & vbNewLine & _
		"		<tr>" & vbNewLine & _
		"			<td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
		"				<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _
		"					<tr valign=""middle"">" & vbNewLine & _
		"						<td colspan=""3"" align=""center"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strCategoryFontSize & """ color=""" & strCategoryFontColor & """> <b>Edit Ban</b> </font></td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr valign=""middle"">" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""45%"">" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>IP Start</b>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""45%"">" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>IP End</b>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""10%"">" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>Tools</b>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine
	strSql = "SELECT * FROM " & strTablePrefix & "BAN_IPS WHERE Ban_ID=" & Request("Ban_ID")
	Set rsBan = my_Conn.Execute(strSql)
	intban = 0
	If Not rsBan.EOF Then
		intban = 1
		Response.Write	"					<tr valign=""middle"">" & vbNewLine & _
			"						<td align=""center"" bgcolor=""" & strForumCellColor & """ width=""45%"">" & vbNewLine & _
			"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
			"								<input style=""text-align:center; font-weight:bold; bgcolor:lightblue; color:navy;"" type=""text"" name=""IP_START"" size=""30"" maxlength=""255"" value=""" & rsBan("IP_START")&""">" & vbNewLine & _
			"							</font>" & vbNewLine & _
			"						</td>" & vbNewLine & _
			"						<td align=""center"" bgcolor=""" & strForumCellColor & """ width=""45%"">" & vbNewLine & _
			"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
			"								<input style=""text-align:center; font-weight:bold; bgcolor:lightblue; color:navy;"" type=""text"" name=""IP_END"" size=""30"" maxlength=""255"" value=""" & rsBan("IP_END")&""">" & vbNewLine & _
			"							</font>" & vbNewLine & _
			"						</td>" & vbNewLine & _
			"						<td align=""center"" bgcolor=""" & strForumCellColor & """ width=""10%"">" & vbNewLine & _
			"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """> " & vbNewLine & _
			"							</font>" & vbNewLine & _
			"						</td>" & vbNewLine & _
			"					</tr>" & vbNewLine
		rsBan.Close
	Else
		Response.Write	"					<tr valign=""middle""><td colspan=""3"" align=""center"" bgcolor=""" & strForumCellColor & """>Not found!</td></tr>"
	End If
	Set rsBan = Nothing
	Response.Write	"				</table>" & vbNewLine & _
		"			</td>" & vbNewLine & _
		"		</tr>" & vbNewLine
	If intBan Then
		Response.Write	"		<tr valign=""top"">" & vbNewLine & _
			"			<td align=""center"" width=""100%"" bgcolor=""transparent"" style=""line-height:50%;""><br />" & vbNewLine
		Response.Write	"                <input type=""Submit"" class=""btn"" name=""submit"" value=""Submit"" />" & vbNewLine
		Response.Write	"			</td>" & vbNewLine & _
			"		</tr>" & vbNewLine
	End If
	Response.Write	"	</table>" & vbNewLine & _
		"</form>" & vbNewLine
	WriteFooter
	Response.End
End If
Response.Write "	<table border=""0"" width=""800px;"" cellspacing=""0"" cellpadding=""0"" align=""center"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """>" & vbNewLine & _
	"		<tr>" & vbNewLine & _
	"			<td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
	"				<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""2"">" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td colspan=""2"" align=""center"" bgcolor=""" & strCategoryCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strCategoryFontSize & """ color=""" & strCategoryFontColor & """> <b>Add Ban</b> </font></td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"					<form id=""BanIPs"" name=""BanIPs"" action=""admin_ban_ips.asp?mode=add"" method=""get"">" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ colspan=""2"" width=""100%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>Country</b>" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strForumCellColor & """ colspan=""2"" width=""100%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
	"								<select style=""text-align:left; background-color:lightblue; color:navy;"" name=""IP_Country"" onchange=""document.BanIPs.submit();"">" & vbNewLine & _
	"									<option selected value=""."">--Choose--</option>"
%>
<!--#INCLUDE FILE="countries.asp"-->
<%
Response.Write	"								</select>" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"					</form>" & vbNewLine & _
	"					<form action=""admin_ban_ips.asp?mode=add"" method=""post"">" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""45%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>IP Start</b>" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"						<td align=""center"" bgcolor=""" & strHeadCellColor & """ width=""45%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """><b>IP End</b>" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"					<tr valign=""middle"">" & vbNewLine & _
	"						<td align=""right"" bgcolor=""" & strForumCellColor & """ width=""45%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
	"								<input style=""width:99%; text-align:center; font-weight:bold; background-color:lightblue; color:navy;"" type=""text"" name=""IP_START"" size=""30"" maxlength=""255"" value=""" & Request.Form("IP_START")&""">" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"						<td align=""left"" bgcolor=""" & strForumCellColor & """ width=""45%"">" & vbNewLine & _
	"							<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
	"								<input style=""width:99%; text-align:center; font-weight:bold; background-color:lightblue; color:navy;"" type=""text"" name=""IP_END"" size=""30"" maxlength=""255"" value=""" & Request.Form("IP_END")&""">" & vbNewLine & _
	"							</font>" & vbNewLine & _
	"						</td>" & vbNewLine & _
	"					</tr>" & vbNewLine & _
	"				</table>" & vbNewLine & _
	"			</td>" & vbNewLine & _
	"		</tr>" & vbNewLine & _
	"		<tr valign=""top"">" & vbNewLine & _
	"			<td align=""center"" width=""100%"" bgcolor=""transparent"" style=""line-height:50%;""><br />" & vbNewLine & _
	"       <input type=""Submit"" style=""color:" & strDefaultFontColor & "; padding:0px 3px 1px 3px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; text-decoration:none; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; box-shadow:3px 1.5px 1.5px rgba(96,96,96, 0.6); background:" & strPopUpTableColor & ";"" name=""submit"" value=""Submit"" />" & vbNewLine & _
	"			</td>" & vbNewLine & _
	"		</tr>" & vbNewLine & _
	"	</table>" & vbNewLine & _
	"</form><br />" & vbNewLine & _
	"<table border=""0"" width=""800px;"" cellspacing=""0"" cellpadding=""0"" align=""center"" style=""border-radius: 25px; padding-top:20px; padding-left:10px; padding-right:10px; padding-bottom:10px; box-shadow:10px 5px 5px rgba(96,96,96, 0.8);"" bgcolor=""" & strPopupTableColor & """>" & vbNewLine & _
	"	<tr>" & vbNewLine & _
	"		<td bgcolor=""" & strPopUpBorderColor & """>" & vbNewLine & _
	"			<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine
strSql = "SELECT * FROM " & strTablePrefix & "BAN_IPS ORDER BY IP_START ASC"
Set rsBan = my_Conn.Execute(strSql)
If Not rsBan.EOF Then
	intI = 0
	rsBan.MoveFirst
	Do While Not rsBan.EOF
		If Len(rsBan("IP_START")) > 1 Then
			IPLookup
		Else
			strIPT = rsBan("IP_COUNTRY")
		End If
		If intI = 0 Then CColor = strForumFirstCellColor Else CColor = strAltForumCellColor
		Response.Write	"				<tr valign=""middle"">" &  vbNewLine & _
			"					<td bgColor=""" & CColor & """ width=""25%"" align=""center"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & rsBan("IP_START") & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"					<td bgColor=""" & CColor & """ width=""25%"" align=""center"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & rsBan("IP_END") & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"					<td bgColor=""" & CColor & """ width=""40%"" align=""center"">" & vbNewLine & _
			"						<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & strIPT & vbNewLine & _
			"						</font>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"					<td bgColor=""" & CColor & """ width=""10%"" align=""center"">" & vbNewLine & _
			"						<a href=""admin_ban_ips.asp?mode=edit&Ban_ID="&rsBan("Ban_ID")&"""" & dWStatus("Edit Ban") & "><acronym style=""border:none; text-decoration:none"" title=""Edit Ban""><img src="""& strImageURL &"icon_pencil.gif"" style=""border:none"" alt=""Edit Ban"" hspace=""0"" style=""text-decoration:none;""></acronym></a>" & vbNewLine & _
			"						<a href=""admin_ban_ips.asp?mode=delete&Ban_ID="&rsBan("Ban_ID")&"""" & dWStatus("Delete Ban") & "><acronym style=""border:none; text-decoration:none"" title=""Delete Ban""><img src="""& strImageURL &"icon_trashcan.gif"" style=""border:none"" alt=""Delete Ban"" hspace=""0"" style=""text-decoration:none;""></acronym></a>" & vbNewLine & _
			"					</td>" & vbNewLine & _
			"				</tr>" & vbNewLine
		rsBan.MoveNext
		inI = 1 - intI
	Loop
	rsBan.Close
End If
Set rsBan = Nothing
Response.Write	"				</tr>" & vbNewLine & _
	"			</table>" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"</table>" & vbNewLine
WriteFooter

Function IPLookup
	strSqlIP = "SELECT IPCOUNTRY FROM " & strTablePrefix & "IPTOCOUNTRY WHERE IPSTART <= '" & rsBan("IP_START") & "' AND IPEND >= '" & rsBan("IP_START") & "'"
	Set rsLocale = my_Conn.Execute(strSqlIP)
	If NOT (rsLocale.BOF or rsLocale.EOF) Then
		strIPT = rsLocale("IPCOUNTRY")
		rsLocale.Close
	End If
	Set rsLocale = Nothing
End Function
%>

Edited by - Carefree on 23 March 2016 19:41:54
Go to Top of Page

ZORRO
Starting Member

13 Posts

Posted - 13 March 2016 :  04:44:35  Show Profile
Wow! This rendition works flawlessly. I can now add an IP range or a country and the table is updated via the admin screen. When I select a country, then the table places NULLs in the IP range and the country name in the country field. Awesome.

Thanks Carefree!

Jeff
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 23 March 2016 :  19:40:18  Show Profile
You're welcome.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.49 seconds. Powered By: Snitz Forums 2000 Version 3.4.07