התחלתי לכתוב ואין לי כח אם מישהו רוצה לפתח ( WYSIWYG )
הנה איך שזה נראה עד עכשיו ...
http://sorya.seoz.net/logs/site/wys/
אני עייף ...
אז הנה הקוד ...
PHP קוד:
<html dir="rtl"> <head> <SCRIPT language=JavaScript> function add_simle(smaili) { xxx = smaili; switch (xxx) { case 1: textura_value = form.x.value + " :p"; break; case 2: textura_value = form.x.value + " :boom:"; break; default: textura_value = form.x.value + " :o"; } form.x.value = textura_value; form.x.focus(); } function add_style(style) { xxx = style; switch (xxx) { case 1: textura_value = form.x.value + "<b></b>"; break; default: textura_value = form.x.value + "<i></i>"; } form.x.value = textura_value; form.x.focus(); } </SCRIPT> </head> <body> <? if ($_POST['x']) { echo "<p>-----------------------------------------</p>"; $textura_value=$_POST['x']; $textura_value = str_replace ( ':p', '<img src="images/smile.jpg" />' , $textura_value ); $textura_value = str_replace ( ':o', '<img src="images/sad.jpg" />' , $textura_value ); $textura_value = str_replace ( ':boom:', '<img src="images/boom.jpg" />' , $textura_value ); echo nl2br($textura_value); echo "<br /><p>-----------------------------------------</p><br />"; } ?> <form name="form" action="<?=$PHP_SELF ?>" method="post"> <table> <tr> <td colspan="2"> <img src="images/bold.gif" border="0" onClick="add_style(1);" /> <img src="images/italic.gif" border="0" onClick="add_style();" /> </td> </tr> <tr> <td> <img src="images/smile.jpg" border="0" onClick="add_simle(1);" /> <img src="images/boom.jpg" border="0" onClick="add_simle(2);" /> <img src="images/sad.jpg" border="0" onClick="add_simle();" /> </td> <td> <TEXTAREA rows="10" cols="100" name="x" style="text-align:right;"></TEXTAREA> </td> </tr> <tr> <td colspan="2"> <INPUT type="submit" name="submit1" value="שלח"> </td> </tr> </table> </form> </body> </html>
מי שיש לו כח פה להמשיך מוזמן .....
ד"א הנה הקוד להורדה : http://sorya.seoz.net/logs/site/wys/down.rar
תהנו ...
|