Replacement Tag: Smilies
Posted: Sat 22. Oct 2005, 11:57
Smilies Replacement Tag
The following replacement tag lets you insert smilies into your articles. Here's an overview of the concurrent smilies included:

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":
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
The following replacement tag lets you insert smilies into your articles. Here's an overview of the concurrent smilies included:

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';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