...

View Full Version : Remove Textstring in page and Replace with Image Icon



adultfile
04-11-2005, 11:40 PM
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

diablo2_v
04-12-2005, 02:51 AM
With Javascript you can do something like this.



<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.

adultfile
04-12-2005, 11:10 PM
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 :thumbsup: 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

koinu
04-12-2005, 11:36 PM
I would use php to accomplish this. very simply done too



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum