Code2Design.com

User login

The Layout

Programming

Graphic Design

Resources

Navigation

C2D Projects

Unsystematic Affiliates

Tutorials Live Photoshop Lab AOM Designs Christian Cosmos 

Change Language

Who's online

There are currently 0 users and 10 guests online.

adding smileys

After this....

<?php
if (isset($_POST['text'])) {

   
///////////////////////////////////////
    // Clean the text from HTML, PHP, and Cussing
   
$text strip_tags(trim($_POST['text']));
   
$badwords = array("sucks""damn""#!@?""ASP");
   
$text str_replace($badwords"****""$text");


?>

add the following....

<?php

// put the smile keys(the symbols people type for smileys)into an array 

$smilekey = array(":)"":P"";)"); 

/*
put the url's of your smile images and html format to display them into
an array, making sure they are in the same sequence as the smile keys.
Change the url to wherever you have your images stored.
*/

$smilereplacement = array("<img src=images/smiley.gif>",
 
"<img src=images/tongue.gif>""<img src=images/wink.gif>");

// replace the symbols in the message with the html & urls

$text str_replace($smilekey$smilereplacement$text);

// end of added code


   
?>


Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <br /> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use BBCode tags in the text, URLs will be automatically converted to links
More information about formatting options



Like what you see?

Why not add more? C2D is looking for other Christian Web Masters who would like to help write articles for this site. If you have expericance in FLASH, CSS/HTML, PHP/MySQL, PhotoShop/GIMP, Blender, Javascript, or just General Design - our users would love to hear what you have to say. Contact Us

delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   technorati