<%
Dim nPageNo
Dim oRs
Dim oCmd
Dim myconn
Dim sThumbImage
sThumbImage = "images/Img9.gif"
if Request.QueryString("pageno") then
nPageNo = CInt(Request.QueryString("pageno"))
else
nPageNo = 1
end if
Set oRs = Server.CreateObject("ADODB.Recordset")
Set myconn = GetConnection("passwords/")
Set oCmd = Server.CreateObject("ADODB.Command")
Set oCmd.ActiveConnection = myconn
oCmd.CommandType = 1
oCmd.CommandText = "SELECT * FROM Directory INNER JOIN Members ON Directory.MemberID = Members.MemberID WHERE Directory.Status = 2 ORDER BY UserName, UserCompany"
oRs.Open oCmd
Dim nPageSize
Dim nRecordCount
if bTwoCol then
nPageSize = nMaxRows*2
else
nPageSize = nMaxRows
end if
if oRs.RecordCount <> -1 then
nRecordCount = oRs.RecordCount
else
nRecordCount = GetDirectoryCount()
end if
fMaxPages = nRecordCount / nPageSize
nMaxPages = Int(fMaxPages)
if fMaxPages <> nMaxPages then
nMaxPages = nMaxPages + 1
end if
if not oRs is NOTHING and not oRs.eof then
' skip ahead?
if nPageNo > 1 then oRs.Move((nPageNo-1) * nPageSize)
width = "250"
row = 0
col = 0
bDone = false
do while not oRs.eof and not bDone
Response.Write "| | " & vbCrLf
' Show thumbnail?
if bShowThumbs then
sImage = oRs("Thumbnail")
if IsNull(sImage) or Len(sImage) = 0 then
sImage = sThumbImage
end if
Response.Write "![]() | "
end if
' Write the record
Dim sDirHead
Dim sEmail
sEmail = oRs("UserEmail")
if (bShowName and not IsNull(oRs("UserName"))) then
sDirHead = oRs("UserName")
elseif (bShowCompany and not IsNull(oRs("UserCompany"))) then
sDirHead = oRs("UserCompany")
elseif (bShowEmail and not IsNull(sEmail)) then
sDirHead = sEmail
end if
Dim sDirSubHead
Dim bAddBR
sDirSubHead = ""
bAddBR = False
if (bShowName2 and not IsNull(oRs("UserName")) and Len(oRs("UserName")) > 0) then
if (bAddBR = True) then sDirSubHead = sDirSubHead & " "
sDirSubHead = sDirSubHead & oRs("UserName")
bAddBR = True
end if
if (bShowCompany2 and not IsNull(oRs("UserCompany")) and Len(oRs("UserCompany")) > 0) then
if (bAddBR = True) then sDirSubHead = sDirSubHead & " "
sDirSubHead = sDirSubHead & oRs("UserCompany")
bAddBR = True
end if
if (bShowEmail2 and not IsNull(sEmail) and Len(sEmail) > 0) then
if (bAddBR = True) then sDirSubHead = sDirSubHead & " "
sDirSubHead = sDirSubHead & sEmail
end if
Response.Write "" & sDirFont
Response.Write "" & sDirHead & "" & sDirFontEnd & " "
Response.Write sDirSubFont & sDirSubHead & sDirSubFontEnd & " "
Response.Write " | | " & vbCrLf
oRs.MoveNext
row = row + 1
if row = nMaxRows then
if bTwoCol and col = 0 then
row = 0
col = 1
Response.Write " | " & vbCrLf
else
bDone = true
end if
end if
loop
' Pad the extra spaces
if not bDone then
bDone = false
do while not bDone
Response.Write "| | "
if bShowThumbs then
Response.Write " | "
end if
Response.Write "" & sDirFont & " " & sDirFontEnd
Response.Write " " & sDirSubFont & " " & sDirSubFontEnd & " | "
Response.Write " | " & vbCrLf
row = row + 1
if row = nMaxRows then
if bTwoCol and col = 0 then
row = 0
col = 1
Response.Write " | " & vbCrLf
else
bDone = true
end if
end if
loop
end if
else
' Write a message that the directory is empty?
end if
%>
|