<br> feature... ??
Could anyone please help me get this <br> feature:function rep(this)
this = Replace(this, \"\'\", \"\'\'\")
rep = Replace(this, vbCrLf, \"<br>\")
end function
in this script:
PLEASE :-)
---::::---:::----:::---:::---::---:::---
<%@Language=VBScript %>
<%
if Session(\"Login\") <> true then
Response.Redirect(\"default.asp?failure=not\")
end if
%>
<!-- #Include file=\"adovbs.inc\" -->
<!-- #Include file=\"dsnAcces.asp\" -->
<%
id = Request.QueryString(\"id\")
mode = Request.QueryString(\"mode\")
If mode = \"add\" Then
\'***************************************************************************************
\'***************************************************************************************
Dim rsNews, strSQL, strCategory, strTitle, strTeaser, strAuthor, strNews
strCategory = Request.Form(\"Category\")
strTitle = Request.Form(\"title\")
strTeaser = Request.Form(\"teaser\")
strAuthor = Request.Form(\"author\")
strNews = Request.Form(\"news\")
Set rs = Server.CreateObject(\"ADODB.RecordSet\")
If id = \"\" Then
strSQL = \"SELECT * FROM News WHERE (ID = 0)\"
Else
strSQL = \"SELECT * FROM News WHERE id =\"& request(\"id\")
End If
rs.Open strSQL, Conn, adOpenKeyset, adLockOptimistic
If (rs.BOF Or rs.EOF) Then
rs.AddNew
End If
rs(\"Title\") = strTitle
rs(\"Category\") = strCategory
rs(\"Teaser\") = strTeaser
rs(\"Author\") = strAuthor
rs(\"News\") = strNews
rs.Update
rs.Close
Set rs = Nothing
Response.Redirect \"edit_other.asp\"
End If
If request(\"mode\") = \"edit\" Then
strSQL = \"SELECT * FROM News WHERE id =\"& request(\"id\")
SET rs = Conn.Execute( strSQL )
strEditTitle = rs(\"Title\")
strEditCategory = rs(\"Category\")
strEditTeaser = rs(\"Teaser\")
strEditAuthor = rs(\"Author\")
strEditNews = rs(\"News\")
rs.Close
SET rs = Nothing
visInput = False
End IF
If Request(\"mode\") = \"delete\" Then
strSQL = \"DELETE FROM News WHERE id =\"& request(\"id\")
Conn.Execute (strSQL)
End If
%>
<HTML>
<HEAD>
<META NAME=\"GENERATOR\" Content=\"Microsoft Visual Studio 6.0\">
</HEAD>
<BODY link=\"#003300\" vlink=\"#006600\" alink=\"#0000CC\">
<%
\'************************************* Start Lister Other
Dim MyQuote
MyQuote = Chr(34)
strSQL = \"SELECT ID, Title, Category, Teaser FROM News WHERE Category = \'Other\' ORDER BY Dated DESC\"
SET rs = Conn.Execute( strSQL )
Response.Write(\"<TABLE Width=\'500\' cellpadding=\'3\' Cellspacing=\'0\' Border=\'0\'>\")
Response.Write(\"<TR>\")
Response.Write(\"<TD colspan=\'4\'><B>\" & rs(\"Category\") & \":</B><br><br><br></TD>\")
Response.Write(\"</TR>\")
do while not rs.eof
on error resume next
Response.Write(\"<TR bgcolor=\'d9dceo\'>\")
Response.Write(\"<TD><B><A HREF=\'edit_other.asp?id=\" & rs(\"ID\") & \"&mode=delete\' \" & \"onClick=\" & MyQuote & \"return confirm(\'Are you sure you want to delete this news ?\');\" & MyQuote & \"><font face=\'verdana, arial, helvetica\' size=\'1\' color=\'#014A65\'>Delete</font></A></B></TD>\")
Response.Write(\"<TD><font face=\'verdana, arial, helvetica\' size=\'1\' color=\'#000000\'><b>\" & rs(\"Title\") & \"<b></font></TD>\")
Response.Write(\"<TD><font face=\'verdana, arial, helvetica\' size=\'1\' color=\'#000000\'>\" & rs(\"Teaser\") & \"</font></TD>\")
Response.Write(\"<TD><B><A HREF=\'edit_other_edit.asp?id=\" & rs(\"ID\") & \"&mode=edit\' \" & \"onClick=\" & MyQuote & \"return confirm(\'Are you sure you want to edit this news ?\');\" & MyQuote & \"><font face=\'verdana, arial, helvetica\' size=\'1\' color=\'#014A65\'>Edit</font></A></B></TD>\")
Response.Write(\"</TR>\")
Response.Write(\"<TR><TD colspan=\'4\'> </TD></TR>\")
rs.movenext
loop
Response.Write(\"</TABLE>\")
%>
<p> </p><br>
<TR><TD><a href=\"news_edit.asp\"><B><font face=\'verdana, arial, helvetica\' size=\'2\' color=\'#014A65\'>- BACK -</font></B></a></TD></TR>
<br>
</BODY>
</HTML>