Panjabel Posted June 6, 2007 Share Posted June 6, 2007 Hello What do you use for chat to show smiles and text, i tried with textarea's but it doesn't work. Please advice Thanks Quote Link to comment https://forums.phpfreaks.com/topic/54399-chat-textarea-or-what/ Share on other sites More sharing options...
pocobueno1388 Posted June 6, 2007 Share Posted June 6, 2007 I really can't understand what you are asking...explain it a little more. Quote Link to comment https://forums.phpfreaks.com/topic/54399-chat-textarea-or-what/#findComment-268993 Share on other sites More sharing options...
MasterACE14 Posted June 6, 2007 Share Posted June 6, 2007 I'm guessing what you mean is, "How can you put 'graphic' smilies in a text area". I have no idea lol, pocobueno1388 might be able to help now. Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/54399-chat-textarea-or-what/#findComment-268997 Share on other sites More sharing options...
pocobueno1388 Posted June 6, 2007 Share Posted June 6, 2007 To do that you need to find if they put a smiley in their text, then replace it with the image to the smiley. So say everytime someone put this You would want to replace it with a smiley. <?php $pattern = ""; $replacement = "<img src=\"path/smiley.jpg\">"; //This would be the path to the smiley pic $string = "Hello "; //This would be whatever text you wanted to put a smiley in echo preg_replace($pattern, $replacement, $string); ?> Quote Link to comment https://forums.phpfreaks.com/topic/54399-chat-textarea-or-what/#findComment-269206 Share on other sites More sharing options...
taith Posted June 6, 2007 Share Posted June 6, 2007 nope! still cant... textareas only show raw text... you cant put any images into a textbox... it'd just show the <img> now... with ie... the <div> can have a attrib of contenteditable... which would show images... but i dont think ff does support that... Quote Link to comment https://forums.phpfreaks.com/topic/54399-chat-textarea-or-what/#findComment-269211 Share on other sites More sharing options...
pocobueno1388 Posted June 6, 2007 Share Posted June 6, 2007 No! Of course images are not going to show up in the textarea. You take the raw text, insert it into the database, then perform the code I gave you above to display it to the screen. I'm still confused on exactly what you are trying to do, so if you give me some more detail I can help you more. If you don't want it in the textarea, why don't you just echo the text to the screen using echo or print? Quote Link to comment https://forums.phpfreaks.com/topic/54399-chat-textarea-or-what/#findComment-269214 Share on other sites More sharing options...
AV1611 Posted June 6, 2007 Share Posted June 6, 2007 enter the text in a textbox, display the text in an iframe They both look the same, at least with a little css... or if you don't like iframes, then use a table cell, but iframe will let you use scrollbars like the textbox will Quote Link to comment https://forums.phpfreaks.com/topic/54399-chat-textarea-or-what/#findComment-269223 Share on other sites More sharing options...
dbillings Posted June 7, 2007 Share Posted June 7, 2007 clicky clicky http://dennisbillings.com/smiley.php What you'll need to understand http://weblogtoolscollection.com/regex/regex.php - regular expressions http://w3schools.com/html/default.asp - HTML http://php.net/ - PHP syntax and predefined functions Patience.... <?php IF(ISSET($_REQUEST['submit'])){ $string= $_REQUEST['text']; $pattern = "/:\)/"; $replacement = "<img src=\"images/tongue.gif\">"; //This would be the path to the smiley pic echo preg_replace($pattern, $replacement, $string); } ?> <form method="post" action="<?PHP $_SERVER['PHP_SELF']; ?>"> <textarea name="text"></textarea><br /> <input type="submit" name="submit" value="Submit"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/54399-chat-textarea-or-what/#findComment-269676 Share on other sites More sharing options...
fert Posted June 7, 2007 Share Posted June 7, 2007 He wants to know how to make a WYSIWYG editor this should help you http://www.devguru.com/features/tutorials/wysiwyg/wysiwyg1.html Quote Link to comment https://forums.phpfreaks.com/topic/54399-chat-textarea-or-what/#findComment-269686 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.