Emoji picker and theme updates
This commit is contained in:
@ -64,6 +64,41 @@ function emojify($string, $emojis, $size = 40) {
|
||||
}
|
||||
|
||||
|
||||
function emoji_list($val){
|
||||
$emojilist = api_get("/custom_emojis");
|
||||
$c = 0;
|
||||
foreach ($emojilist as $emoji){
|
||||
if (starts_with($emoji['shortcode'],$val) && $c < 50){
|
||||
$return .= "<img style='margin:1px;' src='".$emoji['static_url']."' class='emoji' title='".$emoji['shortcode']."' height=40>";
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
if ($c < 50){
|
||||
foreach ($emojilist as $emoji){
|
||||
if ((contains($emoji['shortcode'],$val) && !starts_with($emoji['shortcode'],$val)) && $c < 50){
|
||||
$return .= "<img style='margin:1px;' src='".$emoji['static_url']."' class='emoji' title='".$emoji['shortcode']."' height=40>";
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
function starts_with($string,$search){
|
||||
if (substr($string,0,strlen($search)) == $search){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function contains($string,$search){
|
||||
if (is_numeric(strpos($string,$search))){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* this function fetches the context (the previous posts and replies) of a specified post
|
||||
$post = ID of the post.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user