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

{EMAIL_ITEM=} fails in bootstrap5 #4705

Open Jimmi08 opened 2 years ago

Jimmi08 commented 2 years ago

Bug Description

file: shortcodes/email_item.sc

shortcode works but nothing is displayed because this test

if(deftrue('BOOTSTRAP'))
{
    $img = "<span class='glyphicon glyphicon-envelope' aria-hidden='true'></span>";
}

Output: <a href="***" title="Email"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span></a>

It should be replaced by glyph or something like that.

Thanks

Jimmi08 commented 2 years ago

Or this is another solution:

    function sc_emailitem()
    {

        if(is_null($this->postInfo['thread_start'])) {
            return "<a class='e-tip btn btn-default btn-info' href='" . e_HTTP . "email.php?plugin:forum." . $this->var['thread_id'] . "'>".e107::getParser()->toGlyph('fas-envelope')."</a>";
        }

        if(!empty($this->postInfo['thread_start']))
        {
            return "<a class='e-tip btn btn-default btn-info' href='" . e_HTTP . "email.php?plugin:forum." . $this->postInfo['thread_id'] . "'>".e107::getParser()->toGlyph('fas-envelope')."</a>";
            //return e107::getParser()->parseTemplate("{EMAIL_ITEM=" . LAN_FORUM_2044 . "^plugin:forum.{$this->postInfo['post_thread']}}");
        }
    }

that first test is there because this should be displayed outside the thread itself f.e. {EMAILITEM} {TRACK} {BUTTONSX}

image

and adding class parameter or special class like btn-forum-email ...
thanks