*/
function smileybutton_install() {
//Register hooks
register_hook('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button');
logger("installed smileybutton");
}
function smileybutton_uninstall() {
//Delet registered hooks
unregister_hook('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button');
logger("removed smileybutton");
}
function show_button($a, &$b) {
// Disable if theme is quattro
// TODO add style for quattro
if (current_theme() == 'quattro')
return;
// Disable for mobile because most mobiles have a smiley key for ther own
if ($a->is_mobile || $a->is_tablet)
return;
/**
*
* I have copied this from /include/text.php, removed doubles
* and escaped them.
*
*/
$texts = array(
'<3',
'</3',
':-)',
';-)',
':-(',
':-P',
':-X',
':-D',
':-O',
'\\\\o/',
'O_o',
":\'(",
":-!",
":-/",
":-[",
"8-)",
':beer',
':coffee',
':facepalm',
':like',
':dislike',
'~friendica',
'red#'
);
$icons = array(
'',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
',
'
'
);
// Call hooks to get aditional smileies from other addons
$params = array('texts' => $texts, 'icons' => $icons, 'string' => ""); //changed
call_hooks('smilie', $params);
//Generate html for smiley list
$s = "
" . $icon . " | "; if (($x+1) % (sqrt(count($params['texts']))+1) == 0) { $s .= "