function smiley_face($yourmessage) { $i = 0; $rep1 = array("<", ">", "\n"); $rep2 = array("<", ">", "<br>"); $ubb1 = array("[b]", "[B]", "[/b]", "[/B]", "[u]", "[U]", "[/u]", "[/U]", "[i]", "[I]", "[/i]", "[/I]", "[center]", "[CENTER]", "[/center]", "[/CENTER]"); $ubb2 = array("<b>", "<B>", "</b>", "</B>", "<u>", "<U>", "</u>", "</U>", "<i>", "<I>", "</i>", "</I>", "<center>", "<CENTER>", "</center>", "</CENTER>"); $sm1 = array(":?:", ":D", ":?", "8)", ":cry:", ":shock:", ":evil:", ":!:", ":frown:", ":idea:", ":arrow:", ":lol:", ":x", ":mrgreen:", ":|", ":P", ":oops:", ":roll:", ":(", ":)", ":o", ":twisted:", ":wink:"); $sm2 = array("question", "biggrin", "confused", "cool", "cry", "eek", "evil", "exclaim", "frown", "idea", "arrow", "lol", "mad", "mrgreen", "neutral", "razz", "redface", "rolleyes", "sad", "smile", "surprised", "twisted", "wink"); $sm3 = array(": ?:", ":D", ":?", "8)", ":cry:", ":shock:", ":evil:", ":!:", ":frown:", ":idea:", ":arrow:", ":lol:", ":x", ":mrgreen:", ":|", ":P", ": oops :", ":roll:", ":(", ":)", ":o", ":twisted:", ":wink:"); // Disable HTML Code in message body --------------------------------------------------------------- // Replacing Brackets to disable the insertion of HTML in the Guestbook and breaking long words $yourmessage = wordbreak($yourmessage, 40); for ($i = 0; $i <= 2; $i++) { $yourmessage = str_replace($rep1[$i], $rep2[$i], $yourmessage); } // UBB Code Insertion --------------------------------------------------------------------------------- // Replacing UBB tags with the appropriate HTML tag for ($i = 0; $i <= 15; $i++) { $yourmessage = str_replace($ubb1[$i], $ubb2[$i], $yourmessage); } // Inserting smiley faces for guestbook users for ($i = 0; $i <= 22; $i++) { $yourmessage = str_replace($sm1[$i], "<img src=\"images/icon_{$sm2[$i]}.gif\" ALT=\"{$sm3[$i]}\">", $yourmessage); } return $yourmessage; }
function clean_message($yourmessage) { $i = 0; $rep1 = array("<", ">", "\n", "'"); $rep2 = array("<", ">", "<br>", "'"); // Disable HTML Code in message body --------------------------------------------------------------- // Replacing Brackets to disable the insertion of HTML in the Guestbook and breaking long words $yourmessage = wordbreak($yourmessage, 40); for ($i = 0; $i <= 2; $i++) { $yourmessage = str_replace($rep1[$i], $rep2[$i], $yourmessage); } $yourmessage = str_replace('"', '"', $yourmessage); return $yourmessage; }
if ($error == "") { // Disable HTML Code in message body --------------------------------------------------------------- // Check for http in front of the link ---------------------------------------------------- if ($yourlink != "") { if (strtolower(substr($yourlink, 0, 7)) != "http://") { $yourlink = "http://" . $yourlink; } # Add http:// to link if not there if (strtolower(substr($yourlink, 0, 14)) == "http://http://") { $yourlink = substr($yourlink, 7); } # Remove "double" http:// } # End If - Check for URL // Replacing Brackets to disable the insertion of HTML in the Links Page by Users $yourmessage = wordbreak($yourmessage, 25); $yourmessage = str_replace("<", "<", $yourmessage); $yourmessage = str_replace(">", ">", $yourmessage); $yourmessage = str_replace("\n", "<br>", $yourmessage); // Smiley face insertion into the message ------------------------------------------------------------ // Inserting smiley faces for links users $yourmessage = str_replace(":)", "<img src=images/smile.gif>", $yourmessage); $yourmessage = str_replace(":D", "<img src=images/happy.gif>", $yourmessage); $yourmessage = str_replace(":(", "<img src=images/sad.gif>", $yourmessage); $yourmessage = str_replace(":p", "<img src=images/tongue.gif>", $yourmessage); $yourmessage = str_replace(":o", "<img src=images/bored.gif>", $yourmessage); $yourmessage = str_replace("8)", "<img src=images/cool.gif>", $yourmessage); // Give Confirmation that the Guestbook Entry was written echo "<p>Following Message was added to the Links Page on "; echo $date; echo "<br><br>";