<?php

// 	Script: Copyright 2003 Janice Heinold, jmhdesign@att.net or
// 	heinold@falcon.tamucc.edu. Contributions (to ++ version) Copyright
// 	2003 Anthony Liekens, anthony@liekens.net

//	Installation

// 	To make this script work, put the smileys++.php in "local". Then add
// 	the following line to local.php: include("local/smileys++.php");

//	Usage

//	You can now use any of :), :(, :p, :D, ... You can also use {cool},
//	{confused}, {eek}, {angry}, {rolleyes} like in the original
//	smileys.php cookbook. But you can now also use "{:name:}" for
//	printing the smiley where "name.gif" is in the smileys directory.
//	There are over 680 smileys in the directory. If you use your browser
//	to point to the "index.php" in the smileys directory, it gives you a
//	list of all available smileys for smileys++.

// 	Configuration 

//	By default, this script looks for the smiley images in a directory
// 	called "smileys" in the root directory for pmwiki. If your smiley
// 	images are elsewhere, you can set the path to the directory the
// 	smileys are in. It should end with the name of the directory with no
// 	ending slash. For example, you can set:
// 	$SmileysDir = "http://www.yourdomain.com/smileys/gif";

	$SmileysDir = "/smileys";

	$Smileys = array (
		"/\{:(.*?):\}/" => "<img src='$SmileysDir/\$1.gif' border='0' alt='smiley'/>",
		"/\{?:-?\)/" => "<img src='$SmileysDir/happy.gif' border='0' width='15' height='15' alt='happy smiley'>",
		"/\{?;-?\)/" => "<img src='$SmileysDir/wink.gif' border='0' width='15' height='15' alt='winking smiley'>",
		"/\{?:-?\(/" => "<img src='$SmileysDir/sad.gif' border='0' width='15' height='15' alt='frowning smiley'>",
		"/\{?:-?p/" => "<img src='$SmileysDir/tongue.gif' border='0' width='15' height='15' alt='laughing smiley'>",
		"/\{?:-?o/" => "<img src='$SmileysDir/redface.gif' border='0' width='15' height='15' alt='embarrassed smiley'>",
		"/\{?:-?D/" => "<img src='$SmileysDir/biggrin.gif' border='0' width='15' height='15' alt='grinning smiley'>",
		
		// the following ones are merely here to keep backward compatibility with the smileys cookbook
		
		"/\{cool\}/" => "<img src='$SmileysDir/cool.gif' border='0' width='15' height='15' alt='cool smiley'>",
		"/\{confused\}/" => "<img src='$SmileysDir/confused.gif' border='0' width='15' height='22' alt='confused smiley'>",
		"/\{eek\}/" => "<img src='$SmileysDir/eek.gif' border='0' width='15' height='15' alt='shrieking smiley'>",
		"/\{angry\}/" => "<img src='$SmileysDir/mad.gif' border='0' width='15' height='15' alt='angry smiley'>",
		"/\{rolleyes\}/" => "<img src='$SmileysDir/rolleyes.gif' border='0' width='15' height='15' alt='rolling eyes smiley'>"
	);
	
	$InlineReplacements = array_merge_recursive ($InlineReplacements, $Smileys);
?>