ändå inget BR :(

ASP

5 svar · 198 visningar · startad av MoonCow

Medlem sedan juni 2001223 inlägg
Trådstart#1

Tjena! :) Jag hade tänkt att ens presentation på min community skulle ha stöd för radbrytningar men ändå inte HTML.. gjorde så här:

<%
textish = Server.HTMLEncode(RecSet("presentation"))
textish = Replace(textish, ":)", "<img src='smiley.gif'>")
textish = Replace(textish, ":-)", "<img src='smiley.gif'>")
textish = Replace(textish, "=)", "<img src='smiley.gif'>")
textish = Replace(textish, ";)", "<img src='skamta.gif'>")
textish = Replace(textish, ";-)", "<img src='skamta.gif'>")
textish = Replace(textish, ":D", "<img src='stortsmajl.gif'>")
textish = Replace(textish, ":-D", "<img src='stortsmajl.gif'>")
textish = Replace(textish, ":(", "<img src='sad.gif'>")
textish = Replace(textish, ":-(", "<img src='sad.gif'>")
textish = Replace(textish, ":p", "<img src='tongue.gif'>")
textish = Replace(textish, ":-p", "<img src='tongue.gif'>")
textish = Replace(textish, "vbcrlf", "<br>")
textish = Replace(textish, "VBCR", "<br>") 

%>
<%=textish%>

men ändå inga radbrytningar (smilisarna fungerar dock)
är inte så haj på VBCR och vad det heter.. möjligt att dom är fel men nån som vet?

Medlem sedan mars 20007 896 inlägg
#2

Det ska inte vara några dubbelfnuttar runt vbCrLf.

textish = Replace(textish, vbcrlf, "<br>")
textish = Replace(textish, VBCR, "<br>")
Medlem sedan dec. 19998 577 inlägg
#3

vbcrlf är en konstant och skall inte ha snuffar runt sig:

textish = Replace(textish, vbcrlf, "<br>")

vbcr behöver du inte ha med...

Medlem sedan okt. 20005 273 inlägg
#4

<%
textish = Replace(Server.HTMLEncode(RecSet("presentation"), vbcrlf, "<br>" & vbcrlf)
textish = Replace(textish, ":)", "<img src='smiley.gif'>")
textish = Replace(textish, ":-)", "<img src='smiley.gif'>")
textish = Replace(textish, "=)", "<img src='smiley.gif'>")
textish = Replace(textish, ";)", "<img src='skamta.gif'>")
textish = Replace(textish, ";-)", "<img src='skamta.gif'>")
textish = Replace(textish, ":D", "<img src='stortsmajl.gif'>")
textish = Replace(textish, ":-D", "<img src='stortsmajl.gif'>")
textish = Replace(textish, ":(", "<img src='sad.gif'>")
textish = Replace(textish, ":-(", "<img src='sad.gif'>")
textish = Replace(textish, ":p", "<img src='tongue.gif'>")
textish = Replace(textish, ":-p", "<img src='tongue.gif'>")
%>
<%=textish%>

Medlem sedan juni 2001223 inlägg
#5

U guys :r I lub u! tack! :)

Medlem sedan mars 20014 214 inlägg
#6

Såg bara att Vide har haft lite otur.
på dom 2 sista replace trådarna har han tre gånger lyckats svara 2a i samma minut som föregående, och samma sak :e

252 ms totalt · 4 externa anrop · v20260731065814-full.d34c6d5a
118 ms — deklarationer (db)
0 ms — hämta statistik (cache)
128 ms — hämta tråd, inlägg och bilagor (db)
121 ms — ändringar (db)