Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Remove Textstring in page and Replace with Image Icon

    Just look at it like this BB:

    when I write to a member of my site I place the text of let say a :thumsup (would be a thumbs up image) and when the message is sent off and the person recieves and reads it vouila there is the just like it should be. I have a script that waits for the page to finish loading now I need one to look for my preset textstrings (:thumbsup) and when ever it finds one it will replace that text with the image that cortresponds to it. Does that make more sence? thanks for looking but I think I wasnt clear enough.

    Thanks all
    J
    Last edited by adultfile; 04-12-2005 at 10:14 PM. Reason: I wasnt clear enough in first posting I dont believe

  • #2
    New Coder
    Join Date
    Apr 2005
    Location
    Burnaby, BC, Canada
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    With Javascript you can do something like this.

    Code:
    <script language="javascript">
    
    message = "HI THERE :)";
    
    next_pos= message.indexOf(":)");
    
    while ( next_pos != -1)
    {
    	message = message.replace (":)", "<img src='%%imageswww%%smile.gif'");
    	next_pos=message.indexOf(":)", next_pos+1);
    }
    
    alert (message);
    </script>
    Though you may want to do a similar thing with CGI instead.
    'Programming is the only artform that fights back!'

  • #3
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Remove Textstring and Replace with Image Icon

    Just look at it like this BB:

    when I write to a member of my site I place the text of let say a :thumsup (would be a thumbs up image) and when the message is sent off and the person recieves and reads it vouila there is the just like it should be. I have a script that waits for the page to finish loading now I need one to look for my preset textstrings (:thumbsup) and when ever it finds one it will replace that text with the image that cortresponds to it. Does that make more sence? thanks for looking but I think I wasnt clear enough.

    Thanks all
    J

  • #4
    New Coder
    Join Date
    Mar 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would use php to accomplish this. very simply done too


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •