diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/features.php | 1 | ||||
-rwxr-xr-x | include/items.php | 6 | ||||
-rw-r--r-- | include/text.php | 21 |
3 files changed, 21 insertions, 7 deletions
diff --git a/include/features.php b/include/features.php index 38700f9f5..6d38bcfb4 100644 --- a/include/features.php +++ b/include/features.php @@ -94,6 +94,7 @@ function get_features($filtered = true) { t('Post/Comment Tools'), array('commtag', t('Community Tagging'), t('Ability to tag existing posts'),false,get_config('feature_lock','commtag')), array('categories', t('Post Categories'), t('Add categories to your posts'),false,get_config('feature_lock','categories')), + array('emojis', t('Emoji Reactions'), t('Add emoji reaction ability to posts'),true,get_config('feature_lock','emojis')), array('filing', t('Saved Folders'), t('Ability to file posts under folders'),false,get_config('feature_lock','filing')), array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments'),false,get_config('feature_lock','dislike')), array('star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator'),false,get_config('feature_lock','star_posts')), diff --git a/include/items.php b/include/items.php index f473b2bac..93385c6e6 100755 --- a/include/items.php +++ b/include/items.php @@ -1183,7 +1183,7 @@ function encode_item_terms($terms,$mirror = false) { if($terms) { foreach($terms as $term) { if(in_array($term['ttype'],$allowed_export_terms)) - $ret[] = array('tag' => $term['term'], 'url' => $term['url'], 'ttype' => termtype($term['type'])); + $ret[] = array('tag' => $term['term'], 'url' => $term['url'], 'type' => termtype($term['ttype'])); } } @@ -1240,11 +1240,9 @@ function decode_tags($t) { $ret = array(); foreach($t as $x) { $tag = array(); - if(array_key_exists('type',$x)) - $x['ttype'] = $x['type']; $tag['term'] = htmlspecialchars($x['tag'], ENT_COMPAT, 'UTF-8', false); $tag['url'] = htmlspecialchars($x['url'], ENT_COMPAT, 'UTF-8', false); - switch($x['ttype']) { + switch($x['type']) { case 'hashtag': $tag['ttype'] = TERM_HASHTAG; break; diff --git a/include/text.php b/include/text.php index 834eec920..1bc19da34 100644 --- a/include/text.php +++ b/include/text.php @@ -1115,8 +1115,8 @@ function list_smilies() { ':coffee', ':facepalm', ':like', - ':dislike' - + ':dislike', + ':hubzilla' ); $icons = array( @@ -1152,9 +1152,24 @@ function list_smilies() { '<img class="smiley" src="' . z_root() . '/images/smiley-facepalm.gif" alt=":facepalm" />', '<img class="smiley" src="' . z_root() . '/images/like.gif" alt=":like" />', '<img class="smiley" src="' . z_root() . '/images/dislike.gif" alt=":dislike" />', + '<img class="smiley" src="' . z_root() . '/images/hz-16.png" alt=":hubzilla" />', ); + $x = get_config('feature','emoji'); + if($x === false) + $x = 1; + if($x) { + if(! App::$emojitab) + App::$emojitab = json_decode(file_get_contents('library/emoji.json'),true); + foreach(App::$emojitab as $e) { + if(strpos($e['shortname'],':tone') === 0) + continue; + $texts[] = $e['shortname']; + $icons[] = '<img class="smiley emoji" height="16" width="16" src="images/emoji/' . $e['unicode'] . '.png' . '" alt="' . $e['name'] . '" />'; + } + } + $params = array('texts' => $texts, 'icons' => $icons); call_hooks('smilie', $params); @@ -1473,7 +1488,7 @@ function prepare_body(&$item,$attach = false) { if($is_photo) { - $object = json_decode($item['object'],true); + $object = json_decode($item['obj'],true); // if original photo width is <= 640px prepend it to item body if($object['link'][0]['width'] && $object['link'][0]['width'] <= 640) { |