From c1a1180d1f43a430b38450cb0b64bcd74487b4ae Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 10 Sep 2018 17:22:05 +0200 Subject: Moved frontend, templates and lang to resources --- includes/sys_template.php | 55 ++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 20 deletions(-) (limited to 'includes/sys_template.php') diff --git a/includes/sys_template.php b/includes/sys_template.php index 986270b5..19b0c2fa 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -1,5 +1,7 @@ 0, and success if number == 0. @@ -450,26 +452,39 @@ function table_body($array) */ function ReplaceSmilies($msg) { - $msg = str_replace(';o))', '', $msg); - $msg = str_replace(':-))', '', $msg); - $msg = str_replace(';o)', '', $msg); - $msg = str_replace(':)', '', $msg); - $msg = str_replace(':-)', '', $msg); - $msg = str_replace(':(', '', $msg); - $msg = str_replace(':-(', '', $msg); - $msg = str_replace(':o(', '', $msg); - $msg = str_replace(':o)', '', $msg); - $msg = str_replace(';o(', '', $msg); - $msg = str_replace(';(', '', $msg); - $msg = str_replace(';-(', '', $msg); - $msg = str_replace('8)', '', $msg); - $msg = str_replace('8o)', '', $msg); - $msg = str_replace(':P', '', $msg); - $msg = str_replace(':-P', '', $msg); - $msg = str_replace(':oP', '', $msg); - $msg = str_replace(';P', '', $msg); - $msg = str_replace(';oP', '', $msg); - $msg = str_replace('?)', '', $msg); + /** @var Assets $assets */ + $assets = app('twig.extension.assets'); + + foreach ( + [ + ';o))' => 'redface', + ':-))' => 'redface', + ';o)' => 'wind', + ':)' => 'smile', + ':-)' => 'smile', + ':(' => 'sad', + ':-(' => 'sad', + ':o(' => 'sad', + ':o)' => 'lol', + ':D' => 'lol', + ';o(' => 'cry', + ';(' => 'cry', + ';-(' => 'cry', + '8)' => 'rolleyes', + '8o)' => 'rolleyes', + ':P' => 'evil', + ':-P' => 'evil', + ':oP' => 'evil', + ';P' => 'mad', + ';oP' => 'mad', + '?)' => 'question', + ] as $search => $replace + ) { + $msg = str_ireplace($search, sprintf( + '', + sprintf($assets->getAsset('emojis/%s.gif'), $replace) + ), $msg); + } return $msg; } -- cgit v1.2.3-54-g00ecf