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
322 stars 214 forks source link

quote functionality in forum is not working #4706

Closed Jimmi08 closed 2 years ago

Jimmi08 commented 2 years ago

Bug Description

when you use quote in a forum, it should be visibly different.

This is not working: $text = $tp->toText("[quote={$quoteName}]\n".$post."\n[/quote]\n",true);

Not sure why, but maybe because of this detection for bbcode use?

$bbsearch = array('[/img]', '[/h]', '[/b]', '[/link]', '[/right]', '[/center]', '[/flash]', '[/code]', '[/table]');

How to Reproduce

Steps to reproduce the behavior:

  1. Try to quote any post in forum with 2.3.1 with tinymce editor
Jimmi08 commented 2 years ago

Somehow it started to work (parse quote)

But this is code inserted in tinymce:

[html]<div class="indent bbcode-quote"><em> LAN_WROTE</em> ...<br>test</div>[/html]

Normally it should be:

if(deftrue('BOOTSTRAP'))
{
    return '<blockquote class="blockquote">
      <p>'.$code_text.'</p>
      <small><cite title="'.$parm.'">'.$parm.'</cite></small>
    </blockquote>';
}

return "<div class='indent {$class}'><em>$parm ".LAN_WROTE."</em> ...<br />$code_text</div>";

I switched to bootstrap3 theme and tested this constant. Result:

string(9) "BOOTSTRAP"

Jimmi08 commented 2 years ago

The solution above is not perfect but it works.

Example of using for bootstrap5:

.bbcode-quote {
@extend blockquote;
@extend .blockquote;
@extend .bg-info;
@extend .bg-opacity-25;
@extend .p-2;
}
.bbcode-quote-source {
@extend .blockquote-footer;
}

Example for bootstrap4 without sass:

.bbcode-quote {
background-color: rgb(0 153 218 / 25%) !important;
padding: 0.5rem !important;
margin-bottom: 1rem;
font-size: inherit;

}
.bbcode-quote p {
opacity: 0.75;
}
.bbcode-quote-source {
margin-top: -1rem;
margin-bottom: 1rem;
font-size: 0.875em;
color: #6c757d;
opacity: 0.75;
}
Jimmi08 commented 2 years ago

I fixed the main issue. (BOOTSTRAP not defined and deprecated LAN file being loaded) . PR no longer needed.

Excellent. Your way is always welcome. Thanks

Just a few notes (after synced with latest git):

Forum post output:

[html]<blockquote>
<p>any text  </p>
<small><cite title=""></cite></small></blockquote>[/html]

[blockquote]code: return "<blockquote class='indent {$class}'>{$code_text}</blockquote>";