Skip to content

Commit

Permalink
#1655 Remove smilies
Browse files Browse the repository at this point in the history
  • Loading branch information
Studio384 committed Jun 10, 2018
1 parent ba24dc0 commit cb7e1de
Show file tree
Hide file tree
Showing 22 changed files with 59 additions and 184 deletions.
139 changes: 25 additions & 114 deletions backstage/features.php

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions db_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ function stripslashes_array($array)
build_config(1, 'o_board_statistics', '1');
build_config(1, 'o_code_name', Version::LUNA_CODE_NAME);
build_config(1, 'o_copyright_type', '0');
build_config(1, 'o_custom_copyright');
build_config(1, 'o_emoji', '1');
build_config(1, 'o_custom_copyright');;
build_config(1, 'o_emoji_size', '16');
build_config(1, 'o_first_run_backstage', '0');
build_config(0, 'o_forum_new_style');
Expand Down Expand Up @@ -730,7 +729,10 @@ function stripslashes_array($array)
$db->add_field('comments', 'admin_note', 'MEDIUMTEXT', true) or error('Unable to admin note field to comments', __FILE__, __LINE__, $db->error());

$db->query('UPDATE ' . $db->prefix . 'groups SET g_moderator=1 WHERE g_id=1') or error('Unable to update group permissions for admins', __FILE__, __LINE__, $db->error());
$db->alter_field('users', 'activate_string', 'VARCHAR(128)', true) or error('Unable to change activate_string type', __FILE__, __LINE__, $db->error());
$db->alter_field('users', 'activate_string', 'VARCHAR(128)', true) or error('Unable to change activate_string type', __FILE__, __LINE__, $db->error());

// Luna 2.1 upgrade support
build_config(0, 'o_emoji')

break;

Expand Down
Binary file removed img/smilies/angel.png
Binary file not shown.
Binary file removed img/smilies/angry.png
Binary file not shown.
Binary file removed img/smilies/big_smile.png
Binary file not shown.
Binary file removed img/smilies/cool.png
Binary file not shown.
Binary file removed img/smilies/happy.png
Binary file not shown.
Binary file removed img/smilies/happycry.png
Binary file not shown.
Binary file removed img/smilies/hmm.png
Binary file not shown.
Binary file removed img/smilies/mad.png
Binary file not shown.
Binary file removed img/smilies/neutral.png
Binary file not shown.
Binary file removed img/smilies/ohyeah.png
Binary file not shown.
Binary file removed img/smilies/roll.png
Binary file not shown.
Binary file removed img/smilies/sad.png
Binary file not shown.
Binary file removed img/smilies/smile.png
Binary file not shown.
Binary file removed img/smilies/tongue.png
Binary file not shown.
Binary file removed img/smilies/wink.png
Binary file not shown.
Binary file removed img/smilies/yikes.png
Binary file not shown.
1 change: 0 additions & 1 deletion include/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,6 @@ public static function create_database($db_type, $db_host, $db_name, $db_usernam
'o_message_per_page' => 10,
'o_max_receivers' => 5,
'o_inbox_notification' => 1,
'o_emoji' => 1,
'o_emoji_size' => 16,
'o_back_to_top' => 1,
'o_show_copyright' => 1,
Expand Down
84 changes: 25 additions & 59 deletions include/parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,60 +821,30 @@ function get_smilies()
{
global $luna_config;

// Here you can add additional smilies if you like (please note that you must escape single quote and backslash)
if ($luna_config['o_emoji'] == 1) {
$smilies = array(
':)' => '😁',
':|' => '😑',
':(' => '😩',
':d' => '😄',
':D' => '😄',
':o' => '😯',
':O' => '😯',
';)' => '😉',
':/' => '😒',
':P' => '😋',
':p' => '😋',
':lol:' => '😁',
':-))' => '😁',
':@' => '😠',
'%)' => '😆',
'b:' => '😎',
'B:' => '😎',
':hc:' => '😅',
'(A)' => '😇',
'(a)' => '😇',
'^-^' => '😏',
'^.^' => '😏',
);
} else {
$smilies = array(
':)' => 'smile.png',
':|' => 'neutral.png',
':(' => 'sad.png',
':d' => 'big_smile.png',
':D' => 'big_smile.png',
':o' => 'yikes.png',
':O' => 'yikes.png',
';)' => 'wink.png',
':/' => 'hmm.png',
':P' => 'tongue.png',
':p' => 'tongue.png',
':lol:' => 'happy.png',
':-))' => 'happy.png',
':@' => 'angry.png',
'%)' => 'roll.png',
'b:' => 'cool.png',
'B:' => 'cool.png',
':hc:' => 'happycry.png',
'(A)' => 'angel.png',
'^-^' => 'ohyeah.png',
'(a)' => 'angel.png',
'(A)' => 'angel.png',
'^-^' => 'happy.png',
'^.^' => 'happy.png',
);
}
$smilies = array(
':)' => '😁',
':|' => '😑',
':(' => '😩',
':d' => '😄',
':D' => '😄',
':o' => '😯',
':O' => '😯',
';)' => '😉',
':/' => '😒',
':P' => '😋',
':p' => '😋',
':lol:' => '😁',
':-))' => '😁',
':@' => '😠',
'%)' => '😆',
'b:' => '😎',
'B:' => '😎',
':hc:' => '😅',
'(A)' => '😇',
'(a)' => '😇',
'^-^' => '😏',
'^.^' => '😏',
);

return $smilies;
}
Expand All @@ -892,11 +862,7 @@ function do_smilies($text)

foreach ($smilies as $smiley_text => $smiley_img) {
if (strpos($text, $smiley_text) !== false) {
if ($luna_config['o_emoji'] == 1) {
$text = ucp_preg_replace('%(?<=[>\s])' . preg_quote($smiley_text, '%') . '(?=[^\p{L}\p{N}])%um', '<span class="emoji">' . $smiley_img . '</span>', $text);
} else {
$text = ucp_preg_replace('%(?<=[>\s])' . preg_quote($smiley_text, '%') . '(?=[^\p{L}\p{N}])%um', '<img src="' . luna_htmlspecialchars(get_base_url(true) . '/img/smilies/' . $smiley_img) . '" width="' . $luna_config['o_emoji_size'] . '" height="' . $luna_config['o_emoji_size'] . '" alt="' . substr($smiley_img, 0, strrpos($smiley_img, '.')) . '" />', $text);
}
$text = ucp_preg_replace('%(?<=[>\s])' . preg_quote($smiley_text, '%') . '(?=[^\p{L}\p{N}])%um', '<span class="emoji">' . $smiley_img . '</span>', $text);
}

}
Expand Down
6 changes: 3 additions & 3 deletions include/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class Version
{
const LUNA_VERSION = '2.1-alpha.2';
const LUNA_BRANCH = '2.1';
const LUNA_CORE_VERSION = '2.1.5850';
const LUNA_CORE_VERSION = '2.1.5854';
const LUNA_CODE_NAME = 'Fallow';

// The database version number, every change in the database requires this number to go one up
const LUNA_DB_VERSION = '91.26';
const LUNA_DB_VERSION = '92.00';

// The parser version number, every change to the parser requires this number to go one up
const LUNA_PARSER_VERSION = '11.4.2';
const LUNA_PARSER_VERSION = '11.5.0';

// The search index version number, every change to the search index requires this number to go one up
const LUNA_SI_VERSION = '2.0';
Expand Down
5 changes: 1 addition & 4 deletions themes/Fifteen/views/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@
$smiley_groups[$smiley_img][] = $smiley_text;

foreach ($smiley_groups as $smiley_img => $smiley_texts) {
if ($luna_config['o_emoji'] == 1)
echo "\t\t".'<div class="col-sm-3"><p><code>'.implode('</code> '.__('and', 'luna').' <code>', $smiley_texts).'</code> <span>'.__('produces', 'luna').'</span> <span class="emoji">'.$smiley_img.'</span></p></div>'."\n";
else
echo "\t\t".'<div class="col-sm-3"><p><code>'.implode('</code> '.__('and', 'luna').' <code>', $smiley_texts).'</code> <span>'.__('produces', 'luna').'</span> <img src="'.luna_htmlspecialchars(get_base_url(true)).'/img/smilies/'.$smiley_img.'" width="'.$luna_config['o_emoji_size'].'" height="'.$luna_config['o_emoji_size'].'" alt="'.$smiley_texts[0].'" /></p></div>'."\n";
echo '<div class="col-sm-3"><p><code>'.implode('</code> '.__('and', 'luna').' <code>', $smiley_texts).'</code> <span>'.__('produces', 'luna').'</span> <span class="emoji">'.$smiley_img.'</span></p></div>';
}

?>
Expand Down

0 comments on commit cb7e1de

Please sign in to comment.