mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-25 04:02:41 +00:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
d5f72165fd
5 changed files with 20 additions and 17 deletions
1
boot.php
1
boot.php
|
@ -783,6 +783,7 @@ class App {
|
|||
public static $content;
|
||||
public static $data = array();
|
||||
public static $error = false;
|
||||
public static $emojitab = false;
|
||||
public static $cmd;
|
||||
public static $argv;
|
||||
public static $argc;
|
||||
|
|
|
@ -66,19 +66,6 @@ function bb_unspacefy_and_trim($st) {
|
|||
}
|
||||
|
||||
|
||||
function bb_emoji($mtch) {
|
||||
$s = strtolower($mtch[1]);
|
||||
if(strpos($s,'x')) {
|
||||
$e = substr($s,strpos($s,'x')+1);
|
||||
if(file_exists('images/emoji/' . $e . '.png')) {
|
||||
return '<img width="24" height="24" src="' . z_root() . '/images/emoji/' . $e . '.png" alt="emoji" />';
|
||||
}
|
||||
else {
|
||||
return $mtch[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bb_extract_images($body) {
|
||||
|
||||
$saved_image = array();
|
||||
|
@ -1014,7 +1001,6 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false)
|
|||
$Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_unspacefy_and_trim', $Text);
|
||||
}
|
||||
|
||||
$Text = preg_replace_callback('/\[\&\;([#a-z0-9]+)\;\]/', 'bb_emoji', $Text);
|
||||
$Text = preg_replace('/\[\&\;([#a-z0-9]+)\;\]/', '&$1;', $Text);
|
||||
|
||||
// fix any escaped ampersands that may have been converted into links
|
||||
|
|
|
@ -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'], 'type' => termtype($term['type']));
|
||||
$ret[] = array('tag' => $term['term'], 'url' => $term['url'], 'type' => termtype($term['ttype']));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 height="16" width="16" src="images/emoji/' . $e['unicode'] . '.png' . '" alt="' . $e['name'] . '" />';
|
||||
}
|
||||
}
|
||||
|
||||
$params = array('texts' => $texts, 'icons' => $icons);
|
||||
call_hooks('smilie', $params);
|
||||
|
||||
|
|
1
library/emoji.json
Normal file
1
library/emoji.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue