aboutsummaryrefslogtreecommitdiffstats
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
parent4d0f0f9a9413ae7826c8eb1573eb4e5873c0ed3a (diff)
downloadvolse-hubzilla-eb13833d2a81dbe3bc11039061f718846e7f5be9.tar.gz
volse-hubzilla-eb13833d2a81dbe3bc11039061f718846e7f5be9.tar.bz2
volse-hubzilla-eb13833d2a81dbe3bc11039061f718846e7f5be9.zip
smiley filter
-rw-r--r--boot.php21
-rw-r--r--images/smiley-cool.gifbin0 -> 354 bytes
-rw-r--r--images/smiley-cry.gifbin0 -> 329 bytes
-rw-r--r--images/smiley-embarassed.gifbin0 -> 331 bytes
-rw-r--r--images/smiley-foot-in-mouth.gifbin0 -> 344 bytes
-rw-r--r--images/smiley-frown.gifbin0 -> 340 bytes
-rw-r--r--images/smiley-innocent.gifbin0 -> 336 bytes
-rw-r--r--images/smiley-kiss.gifbin0 -> 338 bytes
-rw-r--r--images/smiley-laughing.gifbin0 -> 344 bytes
-rw-r--r--images/smiley-money-mouth.gifbin0 -> 321 bytes
-rw-r--r--images/smiley-sealed.gifbin0 -> 325 bytes
-rw-r--r--images/smiley-smile.gifbin0 -> 345 bytes
-rw-r--r--images/smiley-surprised.gifbin0 -> 342 bytes
-rw-r--r--images/smiley-tongue-out.gifbin0 -> 328 bytes
-rw-r--r--images/smiley-undecided.gifbin0 -> 337 bytes
-rw-r--r--images/smiley-wink.gifbin0 -> 351 bytes
-rw-r--r--images/smiley-yell.gifbin0 -> 336 bytes
-rw-r--r--mod/display.php2
-rw-r--r--mod/network.php2
-rw-r--r--mod/profile.php2
20 files changed, 24 insertions, 3 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
diff --git a/images/smiley-cool.gif b/images/smiley-cool.gif
new file mode 100644
index 000000000..ba90cc36f
--- /dev/null
+++ b/images/smiley-cool.gif
Binary files differ
diff --git a/images/smiley-cry.gif b/images/smiley-cry.gif
new file mode 100644
index 000000000..74d897a4f
--- /dev/null
+++ b/images/smiley-cry.gif
Binary files differ
diff --git a/images/smiley-embarassed.gif b/images/smiley-embarassed.gif
new file mode 100644
index 000000000..963a96b8a
--- /dev/null
+++ b/images/smiley-embarassed.gif
Binary files differ
diff --git a/images/smiley-foot-in-mouth.gif b/images/smiley-foot-in-mouth.gif
new file mode 100644
index 000000000..16f68cc1e
--- /dev/null
+++ b/images/smiley-foot-in-mouth.gif
Binary files differ
diff --git a/images/smiley-frown.gif b/images/smiley-frown.gif
new file mode 100644
index 000000000..716f55e16
--- /dev/null
+++ b/images/smiley-frown.gif
Binary files differ
diff --git a/images/smiley-innocent.gif b/images/smiley-innocent.gif
new file mode 100644
index 000000000..334d49e0e
--- /dev/null
+++ b/images/smiley-innocent.gif
Binary files differ
diff --git a/images/smiley-kiss.gif b/images/smiley-kiss.gif
new file mode 100644
index 000000000..4efd549ed
--- /dev/null
+++ b/images/smiley-kiss.gif
Binary files differ
diff --git a/images/smiley-laughing.gif b/images/smiley-laughing.gif
new file mode 100644
index 000000000..1606c119e
--- /dev/null
+++ b/images/smiley-laughing.gif
Binary files differ
diff --git a/images/smiley-money-mouth.gif b/images/smiley-money-mouth.gif
new file mode 100644
index 000000000..ca2451e10
--- /dev/null
+++ b/images/smiley-money-mouth.gif
Binary files differ
diff --git a/images/smiley-sealed.gif b/images/smiley-sealed.gif
new file mode 100644
index 000000000..b33d3cca1
--- /dev/null
+++ b/images/smiley-sealed.gif
Binary files differ
diff --git a/images/smiley-smile.gif b/images/smiley-smile.gif
new file mode 100644
index 000000000..e6a9e60d5
--- /dev/null
+++ b/images/smiley-smile.gif
Binary files differ
diff --git a/images/smiley-surprised.gif b/images/smiley-surprised.gif
new file mode 100644
index 000000000..cb99cdd91
--- /dev/null
+++ b/images/smiley-surprised.gif
Binary files differ
diff --git a/images/smiley-tongue-out.gif b/images/smiley-tongue-out.gif
new file mode 100644
index 000000000..2075dc160
--- /dev/null
+++ b/images/smiley-tongue-out.gif
Binary files differ
diff --git a/images/smiley-undecided.gif b/images/smiley-undecided.gif
new file mode 100644
index 000000000..bef7e2573
--- /dev/null
+++ b/images/smiley-undecided.gif
Binary files differ
diff --git a/images/smiley-wink.gif b/images/smiley-wink.gif
new file mode 100644
index 000000000..9faf1aff8
--- /dev/null
+++ b/images/smiley-wink.gif
Binary files differ
diff --git a/images/smiley-yell.gif b/images/smiley-yell.gif
new file mode 100644
index 000000000..648e6e879
--- /dev/null
+++ b/images/smiley-yell.gif
Binary files differ
diff --git a/mod/display.php b/mod/display.php
index ec036de62..369161619 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -249,7 +249,7 @@ function display_content(&$a) {
'$osparkle' => $osparkle,
'$thumb' => $profile_avatar,
'$title' => $item['title'],
- '$body' => bbcode($item['body']),
+ '$body' => smilies(bbcode($item['body'])),
'$ago' => relative_date($item['created']),
'$lock' => $lock,
'$location' => $location,
diff --git a/mod/network.php b/mod/network.php
index c52bb74fc..43c55b8e3 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -292,7 +292,7 @@ function network_content(&$a, $update = 0) {
'$osparkle' => $osparkle,
'$sparkle' => $sparkle,
'$title' => $item['title'],
- '$body' => bbcode($item['body']),
+ '$body' => smilies(bbcode($item['body'])),
'$ago' => relative_date($item['created']),
'$lock' => $lock,
'$location' => $location,
diff --git a/mod/profile.php b/mod/profile.php
index d09e0187b..a431f4bdd 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -388,7 +388,7 @@ function profile_content(&$a, $update = 0) {
'$thumb' => $profile_avatar,
'$sparkle' => $sparkle,
'$title' => $item['title'],
- '$body' => bbcode($item['body']),
+ '$body' => smilies(bbcode($item['body'])),
'$ago' => relative_date($item['created']),
'$lock' => $lock,
'$location' => $location,