e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
323 stars 214 forks source link

Forum Smileys #2059

Open Aaronsss opened 8 years ago

Aaronsss commented 8 years ago

When posting on a forum, if the first thing in the post is a smiley it just displays the text not the actual smiley. It works fine aslong as there is something else before it.

Also the newforumposts menu does not display smileys

Moc commented 8 years ago

Confirmed.

CaMer0n commented 8 years ago

Also the newforumposts menu does not display smileys

This part was intentional. It starts to look really messy with emoticons in a menu. An option could be added if there's demand for it.

Aaronsss commented 8 years ago

The option would be nice thought not essential, some of my smileys are used as a way of accepting, rejecting or closing things for example and the raw text looks ugly :)

Moc commented 5 years ago

@CaMer0n

Regarding the 'emoticon' as first part of the post entry not being parsed, I think the issue is in this check:

foreach($tmp as $code)
{
    $img                = "<img class='e-emoticon' src='".$fileloc."' alt=\"".$alt."\"  />";

    $this->search[]     = "\n".$code;
    $this->replace[]    = "\n".$img;

    $this->search[]     = " ".$code;
    $this->replace[]    = " ".$img;

    $this->search[]     = ">".$code; // Fix for emote within html.
    $this->replace[]    = ">".$img;

    $this->singleSearch[] = $code;
    $this->singleReplace[] = $img;

}

I think we may need to add something like this:

$this->search[]     = $code;
$this->replace[]    = $img;

but I am not sure if this breaks other things. Also, I cannot figure out the purpose of the singleSearch/Replace...