ASP problem (skriva html i nyheten)|Programmering / Grafisk formgivning|Forum|Nordichardware

Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
The forums are currently locked and only available for read only access
sp_Feed sp_TopicIcon
ASP problem (skriva html i nyheten)
MadComputer
It’s a first time for everybody
Medlem
Forum Posts: 12
Member Since:
August 21, 2002
sp_UserOfflineSmall Offline
1
January 2, 2003 - 1:53 pm
sp_Permalink sp_Print

Hejsan,
Vad ska jag lägga till/ta bort i koden så jag kan skriva html kod i nyheterna? Tack på förhand!


<%
NyhetPerSida = 200
URL = "nyheter.asp"
db = Server.MapPath("/db/news.mdb")
Width = "200"
%>
<%Function Link(strText) Set regExp = New regexp regExp.Global = true
regExp.IgnoreCase = true

regExp.Pattern = "(http://|www)([S]*)"
strText = regExp.Replace(strText,"$1$2")

regExp.Pattern = "(ftp://)([S]*)"
strText = regExp.Replace(strText,"$1$2")

regExp.Pattern = "([S]*@[S]*[.se|.com|.nu|.net|.org])"
strText = regExp.Replace(strText,"$1")

regExp.Pattern = "([.|,|!|?|:|;|)||&]]*) "
strText = regExp.Replace(strText,"$1 ")

regExp.Pattern = "([.|,|!|?|:|;|)||&]]*)"" target=""_blank"">([^<]*)"
strText = regExp.Replace(strText,""">$2")

strText = Replace(Trim(strText),vbCrLf, "
")

Link = strText ' Skriver ut texten, uppdelad och fin!

End Function%>

<%Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db

If Request.QueryString("ID") = "" Then

Set RecSet = Server.CreateObject("ADODB.Recordset")
Sidan = Request.QueryString("sida")
If Sidan = "" then
sida = 1
Else
sida = Sidan
End If

With RecSet
.CursorLocation = 3
.CacheSize = NyhetPerSida
End With

SQL = "SELECT * FROM news Order By id desc"
RecSet.Open SQL, Conn

If RecSet.EOF Then%>

<%Else With RecSet
.MoveFirst
.PageSize = NyhetPerSida
.AbsolutePage = sida
End With

Sidor = RecSet.PageCount
x = 0
Do While Not RecSet.EOF And x < RecSet.PageSize%>

<%x=x+1
RecSet.MoveNext
Loop
RecSet.Close
If Sidor > 1 Then%>

<%End If
End If
End If
If Request.QueryString("ID") <> "" Then
Set RS=Conn.Execute("Select * From news Where id=" & Request.QueryString("ID"))%>

<%If RS("bild") <> "" Then%>

<%End If%>

<%End If%>

Inga nyheter för år2003 inlagda!
<%=FormatDateTime(RecSet("datum"),2)%> - ?ID=<%=RecSet(">">[b]<%=RecSet("rubrik")%>
<%For Sid = 1 To Sidor
If (Int(Sid)) = (Int(sida)) Then%><%=Sid%><%Else%> ?sida=<%=Sid%>"><%=Sid%> <%End If
Next%>
[Image Can Not Be Found]" border="1" width="<%=Width%>"> [Image Can Not Be Found] <%=RS("rubrik")%> - <%=FormatDateTime(RS("datum"),2)%>
<%=Link(RS("nyhet"))%>

">« Tillbaka !
[/b]
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1030
Currently Online:
Guest(s) 303
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Andreas Galistel: 16287
Jonas Klar: 15897
ilg@dd: 10810
Nyhet: 10607
Mind: 10550
Ctrl: 10355
Gueno: 9881
Guest: 9344
Snorch: 8881
Callister: 8468
Newest Members:
PetrbonFU PetrbonFU
Karine Bembry
Dolores Mcdaniels
Anibal McLeish
Francisca Alt
Alfie Everhart
Lester Huitt
Orlando Jorgensen
Mikki Lundgren
Dakota Kozlowski
Forum Stats:
Groups: 11
Forums: 59
Topics: 146630
Posts: 1300967

 

Member Stats:
Guest Posters: 2
Members: 79425
Moderators: 0
Admins: 11
Administrators: nordicadmin, Henrik Berntsson, Anton Karmehed, Carl Holmberg, Joel Oscarsson, Mikael Linnér, Mikael Schwartz, Andreas Paulsson, Nickebjrk, Mattias Pettersson, EmxL