I need a programmer who can help add smileys to my message board. It is not a forum board so keep that in mind. Right now, the message board allows only text so if I typed in : ) , it will display : ) I want it so when the person types in : ) , it will display (smiley face gif) in their message. And if they typed in : ( , it will display (sad face gif), etc.... At the same time, if the user is too lazy to type in the ascii code of the smiley, I want an option of the smileys displayed underneath the message box so the user can just select the smiley face they want to use and it will display the smiley pic in their message (exactly the way Digital Point has theirs setup). The message board file is below. Can what I want be done without the need to modify the database? Is there a quick easy way of doing this by modifying the file below. Please message me or post in this thread if you can help me. Thanks in advance <? include("../headers.php"); if(!$session[id]){ header("Location: index.php"); } if($send == yes){ if(!$message){ $attempt=msg; } elseif(fetch("SELECT id FROM $tab[contact] WHERE player='$pid' AND contact='$session[id]' AND status='4';")){ $attempt=ignore; } else{ $session['online']=$time; mysql_query("UPDATE $tab[player] SET messages=messages+1, reset='1' WHERE id='$pid';"); mysql_query("UPDATE $tab[player] SET online='$session[online]' WHERE id='$session[id]';"); $message=filter($message); mysql_query("INSERT INTO $tab[mail] (src,dest,msg,time,type) VALUES ('$session[id]','$pid','$message','$time',0);"); $attempt=success; $showbox=no; } } $player = mysql_fetch_array(mysql_query("SELECT name FROM $tab[player] WHERE id='$pid';")); gameheader("messenging $player[name]"); ?> <form method="post" action="message.php?pid=<?=$pid?>&return=<?=$return?>"> <?if($attempt==ignore){?><b><font color="#FFCC00">This kingdom has you on his ignore list, message not sent!</font></b><br><?}?> <?if($attempt==msg){?><b><font color="#FFCC00">You cannot send a blank message</font></b><br><?}?> <?if($attempt==success){?><br><br>message sent to <a href="player.php?pid=<?=$pid?>"><?=$player['name']?></a> (<font color="white">#<?=$pid?></font>)<br><br><a href="<?=$return?>">click here to go back</a><br><?}?> <?if($showbox != no){?> <br>send message to <a href="player.php?pid=<?=$pid?>"><?=$player['name']?></a> (<font color="white">#<?=$pid?></font>) <table align="center" width="60%"> <tr> <td align="center"> <textarea class="input" cols="57" rows="6" name="message" onKeyDown="limitText(this.form.message,this.form.countdown,500);" onKeyUp="limitText(this.form.message,this.form.countdown,500);"></textarea> <br>You have <input readonly type="text" name="countdown" size="1" value="500" style="border: 0;background-color: #000000;color: #FFFFFF;font-size:10pt;">characters left. <input type="hidden" name="send" value="yes"><input class="button" type="submit" value="send message"> </td> </tr> </table> </form> <?}?> <br> <br> <?=bar()?> <br> <?
I think you'll also need a programmer to clean up all the errors in your script and the security vulnerabilities present Just saying Anyway, this should be in the hire section.
YOu want to use preg_replace_callback , preg_replace , or str_replace and use a regex to find the smilies and run there $_POST data threw it. That would be the logic. pseudo Example Code: preg_replace_callback('#:)#s','EMOTES',$input); function EMOTES($input){ return = "<img src=\"images/smile.gif\" />"; } PHP: