Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - replace text by emoticons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

replace text by emoticons

 Post Reply Post Reply Page  12>
Author
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Topic: replace text by emoticons
    Posted: 10 December 2003 at 9:01am

I have a guest book reading from access database.
I want to replace every :) by <img src='Emoticons/01.gif'>
so :) be changed to  automatically...
and appears as a smile picture in the webpage.

what's the simplest way of doing so?

thanks.

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2003 at 9:19am
Replace(Request.Forum("message"), ":)", "<img src='Emoticons/01.gif'>")
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2003 at 9:46am

after a very small modification.. it worked

bravo Mart, now you are 707 posts, 1 post more than pmormr .. and sure.. not a spam post

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2003 at 9:49am
LOL
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2003 at 4:08pm

It worked but....
what If I have more than 1 emoticon???

this is the code I use:

MSN = Replace(rMSN(2), ":)", "<img src=""GfX/Emoticons/01.gif"">")

it successfuly replace :) by the emoticons,
but what if there is :) and :( and :-/ and :-0 and ...etc
how can all these be replaced.

 

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2003 at 5:44pm
You will have to have a seperate Replace statement for all emoticons possible.
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2003 at 11:17pm
Or use an array like WWF does and just loop thru the array.
FeRnAN
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 11 December 2003 at 2:30am

Quote You will have to have a seperate Replace statement for all emoticons possible.

I tried but It didn't work... something like MSN = Replace(rMSN(2), ":)", "<img src=""GfX/Emoticons/01.gif"">" & Replace(rMSN(2), ":(", "<img src=""GfX/Emoticons/02.gif"">")

it was repeated twice, I tried others but didn't work...
how can i make: replace (A by) B and (C by D) and (E by F) and (....)  in one statment...

come on.. you are the experts

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.