Social Web CMS
February 09, 2010, 06:43:01 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: We have reinvented SocialWebCMS as HotaruCMS, which is available to download from http://hotarucms.org.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Smilies Module - version 0.1 Beta Release  (Read 1655 times)
Nick
Administrator
Hero Member
*****
Offline Offline

Posts: 668



View Profile WWW
« on: September 04, 2008, 04:51:50 am »

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.)

Installation
1. Unzip and upload the smilies folder to /modules.
2. Open libs/comment.php
3. Find...

Code:
function fill_smarty($smarty){

4. Replace...

      
Code:
$smarty->assign('comment_content', save_text_to_html($this->content));


with...

Code:
$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.

* smilies.zip (9.97 KB - downloaded 85 times.)
« Last Edit: September 20, 2008, 09:35:45 pm by longcountdown » Logged

Reinventing SWCMS at HotaruCMS.org - testers, designers and developers wanted!
davemackey
Administrator
Sr. Member
*****
Offline Offline

Posts: 271



View Profile WWW
« Reply #1 on: September 04, 2008, 09:12:59 am »

Sweet. Thanks Nick!
Dave.
Logged

- http://www.informednetworker.com/ - Informed Networker - Social News for IT Professionals.
toritaiyo
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #2 on: September 08, 2008, 04:59:37 pm »

Good to see you figured it out, mate. 
Can't wait to smilie my heart out  Grin
Logged
Ash
Administrator
Sr. Member
*****
Offline Offline

Posts: 358



View Profile
« Reply #3 on: September 10, 2008, 01:00:48 pm »

Version 0.2 is available here... http://socialwebcms.com/forum/index.php?topic=130.0

thanks to longcountdown for the module.
Logged
nothingman
Full Member
***
Offline Offline

Posts: 111


View Profile
« Reply #4 on: September 29, 2008, 06:44:45 am »

As a suggestion: It'd be great to have clickable icons above the comment input box so that users don't have to figure out what character to use for a particular smiley Smiley
« Last Edit: October 03, 2008, 01:18:08 am by nothingman » Logged

I don't know, that's why I ask...
Ash
Administrator
Sr. Member
*****
Offline Offline

Posts: 358



View Profile
« Reply #5 on: September 29, 2008, 12:56:29 pm »

As a suggestion: It'd be great to have clickable icons above of the comment input box so that users don't have to figure out what character to use for a particular smiley Smiley

v0.2 was written so that something like that could be added into it without too much trouble. I haven't had time yet to make a v0.3 with that in it. Smiley
Logged
Geoserv
Global Moderator
Jr. Member
*****
Offline Offline

Posts: 65



View Profile WWW
« Reply #6 on: October 16, 2008, 03:54:51 am »

Very nice, will be adding to my site today.

Geoserv
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!