With smiley faces so common these days, your users might be surprised if the
colon-bracket they type into a SWCMS comment doesn't get converted into a smiley face. That's why, I've come up with
Smilies Module 0.1.
UPDATE: The latest version of this module is v0.2: GET IT HERE
Features: - Converts text to smilies in user comments.
- 22 standard smilies, many with multiple ways of activating them, e.g. "smile" can be
colon-bracket,
colon-dash-bracket or
colon-smile
-colon. (See the complete list of smilies and the text that activates them
here on Wordpress.org).
Limitations: - Only shows smilies in user comments on the story page (not in descriptions, sidebar comments, Live comments, etc.)
Installation1. Unzip and upload the smilies folder to /modules.
2. Open libs/comment.php
3. Find...
function fill_smarty($smarty){
4. Replace...
$smarty->assign('comment_content', save_text_to_html($this->content));
with...
$text = save_text_to_html($this->content);
$vars = array('comment_text' => $text);
check_actions('check_for_smilies', $vars);
$smarty->assign('comment_content', $vars['comment_text']);
5. Save and upload libs/comment.php
6. Install "Smilies" through the Module Management section of your admin panel.
DISCLAIMER: This is my first module and I'm just a PHP novice. I'm not familiar with proper coding conventions or the rights and wrongs of borrowing code from other open source projects - the images are from Wordpress.org and the code was influenced heavily by the smilies functions in Wordpress. I welcome all efforts to make this module better.Thanks,
Nick.