<%
theArticle = Request("Article")
'*
'***** GET AUTHORS AND TITLE
'*
sqlstr="Select TblArticle.ID,TblArticle.Name,TblArticle.MentorID,TblArticle.MentorID2,TblArticle.File as thefile,TblArticle.DateAdded,TblArticle.CategoryID,TblArticle.Image as ArticleImage,TblArticle.PubMonth,TblMentor.ID as MentorId,TblMentor.Fname,TblMentor.Lname,TblMentor.Title as theTitle,TblMentor.image as mentorimage,TblCategory.Name AS ArtName,TblCategory.ID as CatID From TblArticle,TblMentor,TblCategory Where (TblArticle.MentorID=TblMentor.ID OR TblArticle.MentorID2=TblMentor.ID) AND TblArticle.CategoryID=TblCategory.ID AND TblArticle.ID='" & theArticle & "'"
rs = connect.execute(sqlstr)
theTitle = (rs("theTitle").value)
Fname = (rs("Fname"))
Lname = (rs("Lname"))
ArtName = (rs("ArtName"))
'Dim thename = (Server.HtmlEncode(rs("name").value ))
thename = (rs("name").value)
CatId = (rs("CatId"))
MentorId = (rs("MentorId"))
MentorID2 = (rs("MentorID2").value)
'Response.Write (thename)
'Dim thenamemeta as string
thenamemeta = thename
'Dim RegExStr As String = “<[^>]*>”
' Dim R As New Regex(RegExStr)
' thenamemeta = R.Replace(thenamemeta, ” “)
'Response.Write ("
" & thenamemeta & "
")
'*
'***** CHECK FOR NULL SECOND AUTHOR
'*
Men2 = "Not Null"
If Men2 = "" Then
Men2 = ("Null")
Else
Men2 = ("Not Null")
End If
'Response.Write ("MentorID2 is " & Men2)
if Men2 = "Not Null" then
MentorId2 = (rs("MentorId2"))
end if
authorstr = Fname & " " & Lname
'Response.Write ("By: "& Fname &" "& Lname)
If rs("MentorID2")<>"" Then'write out the second author
Set SecAuthRS = Server.CreateObject("ADODB.Recordset")
Set SecAuthRS.ActiveConnection=Connect
SecAuthRS.Source ="Select Title,Fname,Lname from TblMentor Where ID="&rs("MentorID2")
'Response.Write SQLSource&"
"
SecAuthRS.Open
authorstr = authorstr & " and " &SecAuthRS("Title")&" "&SecAuthRS("Fname")&" "&SecAuthRS("Lname")
'Response.Write " and "&SecAuthRS("Title")&" "&SecAuthRS("Fname")&" "&SecAuthRS("Lname")
SecAuthRS.Close
Set SecAuthRS=nothing
End IF'end test for second author
'*
'***** REMOVE HTML FROM STRING
'*
stoploop = 0
Do until stoploop = 5
l = (Len(thenamemeta))
lp = (instr(thenamemeta,"<"))
rp = (instr(thenamemeta,">"))
'Response.Write (l)
'Response.Write ("
lp: " & lp)
'Response.Write ("
rp: " & rp)
if lp <> 0 then
lthenamemeta = (left(thenamemeta,lp-1))
'Response.Write ("
left: " & lthenamemeta)
end if
if rp <> 0 then
rthenamemeta = (right(thenamemeta,l-rp))
'Response.Write ("
right: " & rthenamemeta)
end if
if lp <> 0 and rp <> 0 then
thenamemeta = lthenamemeta & " " & rthenamemeta
end if
stoploop = stoploop + 1
'Response.Write ("
thenamemeta: " & thenamemeta)
loop
'Response.Write ("
stoploop: " & stoploop)
'Response.Write ("
Author: " & authorstr)
'Response.Write ("
Article Title: " & thenamemeta)
'Response.Write ("
Article: " & theArticle)
Response.Redirect "article.aspx?author=" & authorstr &"&title=" & thenamemeta & "&Article=" & theArticle
%>