Forums
This topic is locked
Replace text probs!
Posted 23 years ago
1
has voted
23 years ago Joe Utichi posted:
Hi,I have a bit of code used for swearing and emoticon validation used on my discussion forums, but in putting it in - I have lost my paragraph validation which was integrated before, into the tag. here is what I have:
<%
MessageContent = ForumRS4.Fields.Item("MessCont"

MessageContent = Replace(MessageContent,"<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>","<img src = boards/dbase/smilies/001.gif>"

MessageContent = Replace(MessageContent,"<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>","<img src = boards/dbase/smilies/002.gif>"

MessageContent = Replace(MessageContent,":eek:","<img src = boards/dbase/smilies/003.gif>"

MessageContent = Replace(MessageContent,"<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>","<img src = boards/dbase/smilies/004.gif>"

%>
It goes on - but I won't put the swear stuff in.
and then in printing the message : <%= MessageContent %>
Can anyone tell me, how, using that system, I can put in a thing that replaces a keyboard carriage return with a br tag on that page? cheers.
If that is not possible with that code, is there a way of changing it before it is posted to the database on the add message page?
Replies
Replied 23 years ago
23 years ago Joel Martinez replied:
If I'm understanding this correctly, you just need to add another one:
<pre id=code><font face=courier size=2 id=code>MessageContent = Replace(MessageContent,vbcrlf,"<br>"
</font id=code></pre id=code>
Joel Martinez
----------
Is this thing on?....
<pre id=code><font face=courier size=2 id=code>MessageContent = Replace(MessageContent,vbcrlf,"<br>"

Joel Martinez
----------
Is this thing on?....
Replied 23 years ago
23 years ago Joe Utichi replied:
You've got it - thanks very much - thats been irritating me <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>