%
Dim strVolumeNo, strIssueNo, strRestoreText, Tempstr, c, d, dbemptyflag
strVolumeNo = Request.QueryString("vol")
strIssueNo = Request.QueryString("issue")
dbemptyflag = 1
if strVolumeNo = "" or strIssueNo = "" then
SQLstr = "SELECT Max(VolumeNo) AS MaxVolume, Max(IssueNo) AS MaxIssue FROM Archives"
objRS.Open SQLstr,objConn,1
strVolumeNo = objRS("MaxVolume")
strIssueNo = objRS("MaxIssue")
objRS.Close
if not isnull(strVolumeNo) and not isnull(strIssueNo) then
SQLstr = "SELECT Text FROM Newsletters WHERE VolumeNo = " & strVolumeNo & " AND IssueNo = " & strIssueNo
end if
else
SQLstr = "SELECT Text FROM Newsletters WHERE VolumeNo = " & strVolumeNo & " AND IssueNo = " & strIssueNo
end if
objRS.Open SQLstr,objConn,1
if not objRS.EOF then
strRestoreText = objRS("Text") & vbcrlf & "#EOF#"
dbemptyflag = 0
end if
objRS.Close
objConn.Close
if dbemptyflag = 0 then
if session("username") <> "" then%>
Edit this issue
Delete this issue
<%end if
strRestoreText = replace(strRestoreText,vbcrlf,"
")
c = instr(1,strRestoreText,"In this issue:",1)
c = instr(c,strRestoreText,"
",1)
c = c+8
d = instr(c,strRestoreText,"
",1)
i = 0
Tempstr = strRestoreText
while d > c
d = d + 14 + len(i)
i = i+1
Tempstr = left(Tempstr,c-1) & "" & mid(Tempstr,c)
c = instr(c,Tempstr,"
",1)
Tempstr = left(Tempstr,c-1) & "" & mid(Tempstr,c)
c = instr(c,Tempstr,"
",1)
c = c+4
wend
i = 1
Tempstr = left(Tempstr,d-1) & "" & mid(Tempstr,d)
c = d+60
d = len(Tempstr)
while d > c and c > 0
c = instr(c,Tempstr,"------------------------------
Date:",1)
if c > 0 then
if mid(Tempstr,c-1,1)<>"-" then
i = i+1
Tempstr = left(Tempstr,c-1) & "return to top
" & mid(Tempstr,c)
c = c + 80
else
c=c+5
end if
end if
wend
strRestoreText = Tempstr
if instr(1,strRestoreText,chr(92)&chr(34),1) > 0 then
strRestoreText = replace(strRestoreText,chr(92)&chr(34),chr(34))
end if
if instr(1,strRestoreText,chr(92)&"'",1) > 0 then
strRestoreText = replace(strRestoreText,chr(92)&chr(39),chr(39))
end if
Response.Write strRestoreText
else
%>