<%
' # THIS BLOCK IS USED TO SET HOW THE LINKS PAGE IS DISPLAYED.
' # PUT THIS ENTIRE CODE IN THE AREA YOU WANT THE DATA TO BE DISPLAYED.

' # DO NOT MODIFY THESE VARIABLES!
Dim SiteKey
Dim PageName
Dim nCols
Dim nPerPage
Dim NewWindow
Dim strPost
Dim strQuery
Dim ShowSearch
Dim strError
Dim strResult
Dim Cat
Dim strLan

' # YOU CAN MODIFY THE VARIABLES BELOW TO CUSTOMISE HOW THE CATALOG AND LINKS PAGES ARE DISPLAYED:

' # This sets the number of columns on the categories page.
' # Values between 1 and 10.
nCatCols = 2

' # This sets the number of columns on the links page.
' # Values either 1 and 2.
nLinksCols = 1

' # This vaiable sets the number of links on a page.
' # Values between 10 and 100.
nPerPage = 25

' # This variable controls whether a link opens in a new page.
' # Values are [1 = Yes, 0 = No]
NewWindow = 1

' # This search feature is not yet implemented
' # This vaiable controls whether a search box is displayed.
' # Values are [1 = Yes, 0 = No]
ShowSearch = 0

' # !!! IT IS IMPORTANT THAT NOTHING BELOW THIS LINE IS MODIFIED IN ANY WAY !!!
' -----------------------------------------------------------------------------
' # The following variables are sent to freelinkers.com to create the page
PageName = Request.ServerVariables("SCRIPT_NAME")
SiteKey = "ce26a0e3-3492-41af-ad1b-3f18f29014f1"
strLan ="ASP"

' # Create the data to post to the freelinkers.com server
strPost = "&SiteKey=" & SiteKey
strPost = strPost & "&PageName=" & PageName
strPost = strPost & "&nLinksCols=" & nLinksCols
strPost = strPost & "&nCatCols=" & nCatCols
strPost = strPost & "&nPerPage=" & nPerPage
strPost = strPost & "&NewWindow=" & NewWindow
strPost = strPost & "&ShowSearch=" & ShowSearch
strPost = strPost & "&Lan=" & strLan

' # pass through any querystring data to freelinkers to allow paging
strQuery = Request.QueryString
Cat = Request.QueryString("cat")
' ---------------------------------------------------------------------------------

Function GetData(strQuery, strPost, ByRef strResponse, ByRef strError)
Dim hObj
Dim ComponentString

Set hObj = Nothing
On Error Resume Next
Set hObj = CreateObject("WinHttp.WinHttpRequest.5.1")
ComponentString = "<!-- Using WinHTTP.WinHttpRequest.5.1 //-->" & vbCrLf
On Error Resume Next
If hObj Is Nothing Then
Set hObj = CreateObject("WinHttp.WinHttpRequest.5")
ComponentString = "<!-- Using WinHTTP.WinHttpRequest.5 //-->" & vbCrLf
End If
On Error Resume Next
If hObj Is Nothing Then
If UseMSXML(strQuery, strPost, strResponse, strError) Then
' the MSXML function will return the data
GetData = True
Else
' we don't need to supply error information, since the error string
' is passed ByRef, the MSXML function will supply the data
GetData = False
End If
Else
hObj.Open "GET", "http://localhost/mylinks/port.aspx?" & strQuery & strPost, False
hObj.Send

If hObj.Status <> 200 Then
strError = "Error: Status=" & hObj.Status & " Text=" & hObj.ResponseText
GetData = False
Else
strResponse = ComponentString & hObj.responseText
GetData = True
End If
End If
End Function
Function UseMSXML(strQuery, strPost, ByRef strResponse, ByRef strError)
Dim hObj
Set hObj = Nothing
' let's see if the server supports the XMLHTTP component, various versions
On Error Resume Next
Set hObj = CreateObject("Msxml2.ServerXMLHTTP")
ComponentString = "<!-- Using Msxml2.ServerXMLHTTP //-->" & vbCrLf
On Error Resume Next
If hObj Is Nothing Then
Set hObj = CreateObject("Msxml2.ServerXMLHTTP.4.0")
ComponentString = "<!-- Using Msxml2.ServerXMLHTTP.4.0 //-->" & vbCrLf
End If
On Error Resume Next
If hObj Is Nothing Then
Set hObj = CreateObject("Microsoft.XMLHTTP")
ComponentString = "<!-- Using Microsoft.XMLHTTP //-->" & vbCrLf
End If
On Error Resume Next
If hObj Is Nothing Then
strError = "No support for HTTP requests found."
UseMSXML = False
Else
' # Open connection to freelinkers.com, sending the WebsiteGuid information via POST
' # Also, pass through the querystring information (contains Cat, link information)
hObj.open "GET", "http://localhost/mylinks/port.aspx?" & strQuery & strPost, false
hObj.Send

If hObj.status <> 200 Then
' # there was an error!
strError = "Error: Status=" & hObj.status & " Text='" & hObj.responseText & "'"
UseMSXML = False
Else
strResponse = ComponentString & hObj.responseText
UseMSXML = True
End If
Set hObj = Nothing
End If
End Function
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE><%=Request.ServerVariables("SERVER_NAME")%>&nbsp;<%=Cat%>&nbsp;Link Exchange </TITLE>
<META NAME="Author" CONTENT="freelinkers.com">
<META NAME="Description" CONTENT="Exchange links with other
<%=Cat%> web sites. Get instant links from other similar web sites in your category.">
<META NAME="Keywords" CONTENT="<%=Cat%> Link Partners,Link Exchange,Instant Links,Reciprocal Links,Link Directory">

<STYLE type="text/css" media="screen">
.CatTable
{
BORDER:1px solid black;
WIDTH: 700px;
}
.OurPageNav
{
font-family: Verdana, Arial;
font-size: 10pt;
}
.OurPageNav
{
font-family: Verdana, Arial;
font-size: 10pt;
}
.LinksPageNav
{
font-family: Verdana, Arial;
font-size: 10pt;
}
.LinksPageHeader
{
font-family: Verdana, Arial;
font-size: 10pt;
}
TABLE.LinksTable
{
font-family: Verdana, Arial;
font-size: 10pt;
}
TD.LinksCell
{
font-family: Verdana, Arial;
font-size: 10pt;
}
.LinksLink
{
font-family: Verdana, Arial;
font-size: 10pt;
}
.LinkDesc
{
font-family: Verdana, Arial;
font-size: 10pt;
}
.LinksBottomNav
.LinkDesc
{
font-family: Verdana, Arial;
font-size: 10pt;
}
.LinksBottomNavLarge
{
font-family: Verdana, Arial;
font-size: 12pt;
}
.CategoryPageHeader
{
font-family: Verdana, Arial;
font-size: 10pt;
}
TABLE.CategoryTable
{
font-family: Verdana, Arial;
font-size: 10pt;
}
TD.CategoryCell
{
font-family: Verdana, Arial;
font-size: 10pt;
}
.CategoryLink
{
font-family: Verdana, Arial;
font-size: 10pt;
}
</STYLE>
</HEAD>
<BODY>
<%
If GetData(strQuery, strPost, strResult, strError) Then
Response.Write strResult
Else
' Error info in to the page. You may clean this up to
Response.Write strError
End If
%>

</BODY>
</HTML>