garydt Posted December 2, 2007 Share Posted December 2, 2007 I've made a forum and I want to be able use icon faces in it like but I've got no idea how to go about it. Do i put the symbols into an array and use 'str_replace'? What about the face images, where do they go? Thanks. Quote Link to comment Share on other sites More sharing options...
Wes1890 Posted December 2, 2007 Share Posted December 2, 2007 you coded an entire forum and you cant figure out this simple thing?.. wow just do str_replace("","<img src='smilie_url' />"); Quote Link to comment Share on other sites More sharing options...
garydt Posted December 2, 2007 Author Share Posted December 2, 2007 Thanks. I did think it might be str_replace. One other thing. When writing a post and you click on a face icon, how do you make the symbol appear instantly in the post? Quote Link to comment Share on other sites More sharing options...
trq Posted December 2, 2007 Share Posted December 2, 2007 That would be Javascript, not php. Quote Link to comment Share on other sites More sharing options...
garydt Posted December 3, 2007 Author Share Posted December 3, 2007 Here's what I've tried but the symbols aren't going into the textarea. <form action="<?php echo $loginFormAction; ?>" method="POST" name="form1" id="form1"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <td> <a href="javascript:;" onClick="document.form1.post.value="""><img src="../smiley.gif" border="0" /></a></td> <td ><br /> <strong>Enter post</strong><br /> <textarea name="post" cols="60" rows="7"><?php echo $edit; ?></textarea><p> <input name="Preview" type="submit" id="Preview" value="Preview" /> <input type="submit" name="Submit" value="Submit" /><p> <input type="hidden" name="MM_insert" value="form1"> </td> Quote Link to comment Share on other sites More sharing options...
revraz Posted December 3, 2007 Share Posted December 3, 2007 If it matters, they are called smilies. You may have better luck on searching for that instead of faces. Quote Link to comment Share on other sites More sharing options...
garydt Posted December 3, 2007 Author Share Posted December 3, 2007 i'm still having difficulties. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 3, 2007 Share Posted December 3, 2007 i'm still having difficulties. http://www.scriptygoddess.com/archives/2002/08/16/add-smileys-to-text/ That adds the smiley to your textarea, make sure you edit that script to fit your own needs. Then download the smileys Example = images/smileys/happy.gif ..etc Quote Link to comment Share on other sites More sharing options...
garydt Posted December 3, 2007 Author Share Posted December 3, 2007 Thanks. I did what the site said and i put- <form action="<?php echo $loginFormAction; ?>" method="POST" name="form1" id="form1"> <script language=”javascript”> <!– function writeImgTag(code) { var cache = document.form1.post.value; this.code = code; document.form1.post.value = cache + ” <img src=’../smileys/” + code + “.gif’> “; document.form1.post.focus(); } //–> </script> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <td> <img src="../smileys/smiley.gif" onClick=”writeImgTag(’smiley’)” /> </td> <td ><br /> <strong>Enter post</strong><br /> <textarea name="post" cols="60" rows="7"><?php echo $edit; ?></textarea><p> <input name="Preview" type="submit" id="Preview" value="Preview" /> <input type="submit" name="Submit" value="Submit" /><p> I still get nothing in the textarea when i click the face. What have i got wrong? Quote Link to comment 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.