smiley filter

This commit is contained in:
Friendika 2010-12-08 17:05:51 -08:00
parent 4d0f0f9a94
commit eb13833d2a
20 changed files with 24 additions and 3 deletions

View file

@ -1589,4 +1589,25 @@ if(! function_exists('linkify')) {
function linkify($s) { function linkify($s) {
$s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$1" >$1</a>', $s); $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$1" >$1</a>', $s);
return($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);
}} }}

BIN
images/smiley-cool.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

BIN
images/smiley-cry.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
images/smiley-frown.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

BIN
images/smiley-innocent.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

BIN
images/smiley-kiss.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

BIN
images/smiley-laughing.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

BIN
images/smiley-sealed.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

BIN
images/smiley-smile.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

BIN
images/smiley-surprised.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

BIN
images/smiley-undecided.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

BIN
images/smiley-wink.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

BIN
images/smiley-yell.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

View file

@ -249,7 +249,7 @@ function display_content(&$a) {
'$osparkle' => $osparkle, '$osparkle' => $osparkle,
'$thumb' => $profile_avatar, '$thumb' => $profile_avatar,
'$title' => $item['title'], '$title' => $item['title'],
'$body' => bbcode($item['body']), '$body' => smilies(bbcode($item['body'])),
'$ago' => relative_date($item['created']), '$ago' => relative_date($item['created']),
'$lock' => $lock, '$lock' => $lock,
'$location' => $location, '$location' => $location,

View file

@ -292,7 +292,7 @@ function network_content(&$a, $update = 0) {
'$osparkle' => $osparkle, '$osparkle' => $osparkle,
'$sparkle' => $sparkle, '$sparkle' => $sparkle,
'$title' => $item['title'], '$title' => $item['title'],
'$body' => bbcode($item['body']), '$body' => smilies(bbcode($item['body'])),
'$ago' => relative_date($item['created']), '$ago' => relative_date($item['created']),
'$lock' => $lock, '$lock' => $lock,
'$location' => $location, '$location' => $location,

View file

@ -388,7 +388,7 @@ function profile_content(&$a, $update = 0) {
'$thumb' => $profile_avatar, '$thumb' => $profile_avatar,
'$sparkle' => $sparkle, '$sparkle' => $sparkle,
'$title' => $item['title'], '$title' => $item['title'],
'$body' => bbcode($item['body']), '$body' => smilies(bbcode($item['body'])),
'$ago' => relative_date($item['created']), '$ago' => relative_date($item['created']),
'$lock' => $lock, '$lock' => $lock,
'$location' => $location, '$location' => $location,