Page 1 of 1

Replacement Tag: Smilies

Posted: Sat 22. Oct 2005, 11:57
by Cassiel
Smilies Replacement Tag

The following replacement tag lets you insert smilies into your articles. Here's an overview of the concurrent smilies included:
Image

Step 1
Put the file info.cassiel.smilies.php into the folder "/phpwcms_template/inc_script/frontend_render/"

Step 2
Add the following code to "/config/phpwcms/conf.template_default.inc.php":

Code: Select all

// Smilies replacement tag
$template_default["smilies"]["basedir"]         = 'img/smilies/';   // Base directory for smiley graphics
$template_default["smilies"]["imgtag"]          = '<img src="%s" %s alt="%s" border="0" valign="middle" />';

$template_default["smilies"]["smile"]           = 'smile.png';      // search needle and replacement
$template_default["smilies"]["wink"]            = 'wink.png';       // see above
$template_default["smilies"]["tongue"]          = 'tongue.png';     // ...
$template_default["smilies"]["sad"]             = 'sad.png';
$template_default["smilies"]["eek"]             = 'eek.png';
$template_default["smilies"]["biggrin"]         = 'biggrin.png';
$template_default["smilies"]["cool"]            = 'cool.png';
$template_default["smilies"]["mad"]             = 'mad.png';
$template_default["smilies"]["clown"]           = 'clown.png';
$template_default["smilies"]["confused"]        = 'confused.png';
$template_default["smilies"]["rolleyes"]        = 'rolleyes.png';
$template_default["smilies"]["love"]            = 'love.png';
$template_default["smilies"]["evil"]            = 'evil.png';
$template_default["smilies"]["sleep"]           = 'sleep.png';
Of course you can edit smilies that already exists or add new smilies. Just copy & paste the last line and edit the values. Be careful while editing the $template_default["smilies"]["imgtag"] entry within this code. There are multiple placeholders (%s): The second one generates the complete width- and height-parameters for the HTML tag "img". There's no need to add these parameters manually.

Step 3
Download and extract the file smilies_sample.zip to your computer and upload the complete directory "smilies" into the subdirectory "img/" to your website. If you're going to upload the directory somewhere else to your website, please edit the $template_default["smilies"]["basedir"] entry within Step 2.

Syntax of the replacement tag
{SMILEY:smile}

- The first value defines which graphic to use for the smiley. This value can be one of the entries "$template_default['smilies']" added in Step 2 above, except "basedir" and "imgtag". This way you can use the following replacement tags, e.g.:

{SMILEY:tongue}
{SMILEY:cool}
{SMILEY:confused}
{SMILEY:love}
etc.

Extras
To let you create your own smilies with your own colors and moods, please use the following photoshop documents, export as GIF or PNG, upload them and edit thefile "template_default.inc.php" like in Step 2 (if necessary).

- smilies_standard.psd
- smilies_extended.psd

Both files are released under public domain license, but please respect the copyright. Hope you like it - any feedback appreciated! :)

Happy tagging,
Cassiel

Posted: Sat 22. Oct 2005, 12:30
by Fulvio Romanin
nice idea! :D
wcms is getting more and more complete... :D

Posted: Sat 22. Oct 2005, 16:53
by frold
FCKeditor got a smilie insert function included....

Posted: Sat 22. Oct 2005, 21:40
by Cassiel
For sure, but there are still people out there who aren't using WYSIWYG editors or just aren't using HTML content parts. So where's the problem? -If you don't like it, don't use it. But stop bothering me.

Posted: Sat 22. Oct 2005, 21:55
by frold
Cassiel wrote:For sure, but there are still people out there who aren't using WYSIWYG editors or just aren't using HTML content parts. So where's the problem? -If you don't like it, don't use it. But stop bothering me.
It was just to inform you .... You might use htmlarea or spaw...

plz relax..