<%
pid=request("pid")
set rs=server.createobject("ADODB.Recordset")
rs.open "Select * from MainPages where mp_id="& pid, database
if rs.eof then
response.write "Page Error"
else
strTitle=rs("mp_title")
response.write ""& rs("mp_title") &""
response.write "
"
if session("username")="" AND pid="4" then
response.write "Please log in to read full text
"
end if
if rs("mp_image")<>"" then
response.write ""
end if
if rs("mp_text")<>"" Then
if session("username")<>"" then
response.write replace(rs("mp_text"), Chr(13), "")
elseif pid="4" then
response.write left(replace(rs("mp_text"), Chr(13), " "),150) & "....."
else
response.write replace(rs("mp_text"), Chr(13), " ")
end if
else
response.write "Awaiting Content "
end if
end if
rs.close
set rs=nothing
set trs=server.createobject("ADODB.Recordset")
trs.open "Select * from MainPageSubcategories where MPS_mp_id="& pid &" order by orderby Asc", database
if trs.eof then
else
response.write "
"
response.write "Sub-sections within "& strTitle &" "
do while not trs.eof
response.write ""& trs("Title") &" "
trs.movenext
loop
end if
trs.close
set trs=nothing
%> |