aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-12-08 17:05:51 -0800
committerFriendika <info@friendika.com>2010-12-08 17:05:51 -0800
commiteb13833d2a81dbe3bc11039061f718846e7f5be9 (patch)
treeb9c5165bb39868385a5a3becb12c072a372d0688 /boot.php
parent4d0f0f9a9413ae7826c8eb1573eb4e5873c0ed3a (diff)
downloadvolse-hubzilla-eb13833d2a81dbe3bc11039061f718846e7f5be9.tar.gz
volse-hubzilla-eb13833d2a81dbe3bc11039061f718846e7f5be9.tar.bz2
volse-hubzilla-eb13833d2a81dbe3bc11039061f718846e7f5be9.zip
smiley filter
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index 451a622c0..c4bdb1187 100644
--- a/boot.php
+++ b/boot.php
@@ -1589,4 +1589,25 @@ if(! function_exists('linkify')) {
function linkify($s) {
$s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$1" >$1</a>', $s);
return($s);
+}}
+
+if(! function_exists('smilies')) {
+function smilies($s) {
+ $a = get_app();
+
+ return str_replace(
+ array( ':-)', ';-)', ':-(', ':(', ':-P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O'),
+ array(
+ '<img src="' . $a->get_baseurl() . '/images/smiley-smile.gif" alt=":-)" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-wink.gif" alt=";-)" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-frown.gif" alt=":-(" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-frown.gif" alt=":(" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-P" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-\"" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-x" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-kiss.gif" alt=":-X" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-laughing.gif" alt=":-D" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-|" />',
+ '<img src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-O" />'
+ ), $s);
}} \ No newline at end of file