Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Bbcodes in news textarea

@Chan
Greetings cordially !!
We have worked in the past to add bbcod "code" in the news-textarea.
Now in the version Andromeda 9.03.50 the addition of "code" in the comments in the section NEWS and BLOG works perfectly.
However, the problem is in the news editor - textarea. There is no link to "code". So you cannot add the source code in the original to the text of the article.
The problem will probably be here:
Filename: html_buttons_include.php
| Author: PHP-Fusion Development Team
*******
CodeDownload  

$res = "";
 if ($html) {
 $res .= "<div class='btn-group'>\n";
 $res .= "<button type='button' value='b' title='".$locale['html_000']."' class='btn btn-sm btn-default m-b-10 button' onclick=\"addText('".$textarea."', '<b>', '</b>', '".$formname."');\"><i class='fa fa-bold'></i></button>\n";
 $res .= "<button type='button' value='i' title='".$locale['html_001']."' class='btn btn-sm btn-default m-b-10 button' onclick=\"addText('".$textarea."', '<i>', '</i>', '".$formname."');\"><i class='fa fa-italic'></i></button>\n";
 $res .= "<button type='button' value='u' title='".$locale['html_002']."' class='btn btn-sm btn-default m-b-10 button' onclick=\"addText('".$textarea."', '<u>', '</u>', '".$formname."');\"><i class='fa fa-underline'></i></button>\n";
 $res .= "<button type='button' value='strike' title='".$locale['html_003']."' class='btn btn-sm btn-default m-b-10 button' onclick=\"addText('".$textarea."', '<del>', '</del>', '".$formname."');\"><i class='fa fa-strikethrough'></i></button>\n";
 $res .= "<button type='button' value='blockquote' title='".$locale['html_004']."' class='btn btn-sm btn-default m-b-10 button' onclick=\"addText('".$textarea."', '<blockquote>', '</blockquote>', '".$formname."');\"><i class='fa fa-quote-right'></i></button>\n";
 $res .= "<button type='button' value='hr' title='".$locale['html_005']."' class='btn btn-sm btn-default m-b-10 button' onclick=\"addText('".$textarea."', '<hr/>', '', '".$formname."');\"><i class='fa fa-arrows-alt-h'></i></button>\n";
 $res .= "</div>\n";



I guess the link to is missing
CodeDownload  
$res .= "<button type='button' value='??????????' title='".$locale['???????????']."'


Possible solutions, add???
CodeDownload  
$locale['html_021'] = "code";


Would you have a solution, please?
Kvido attached the following image:
bbcode_in_comments_blog.png bbcode_in_news_editor2.png
Good idea, can you wait for commit? We will inform you when it's there.
Yes, thanks I'll wait
The code works by adding:
CodeDownload  
<pre><code>code<code> </pre>

I'm almost done:
CodeDownload  

$res .= "<button type='button' class='btn btn-default btn-sm button m-b-10' value='code' title='".$locale['html_021']."' onclick=\"insertText('".$textarea."', '<pre><code/><code></pre>', '".$formname."');\"></button>\n";


CodeDownload  


A better solution would be to add:
src = "/ includes / bbcodes / images / code.svg

Quote

I'm almost done:
CodeDownload  

$res .= "<button type='button' class='btn btn-default btn-sm button m-b-10' value='code' title='".$locale['html_021']."' onclick=\"insertText('".$textarea."', '<pre><code/><code></pre>', '".$formname."');\"></button>\n";


It remains to change the button in the textarea editor


You know I tried this out and it doesn't quite work as is, until I made a couple of changes thusly:
CodeDownload  
$res .= "<button type='button' class='btn btn-default btn-sm button m-b-10' value='code' title='".$locale['html_021']."' onclick=\"insertText('".$textarea."', '&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;', '".$formname."');\">&lt;/&gt;</button>\n";



You had the 'code and end code' backwards; also I removed the 'br' at the end of the line.
Thanks for your interest.
The "code" button did not appear for your edit. My button is a little bad.
The best solution so far is here:
https://nekecamweb.cz/news/10/Test-in...insert-kod
CodeDownload  

$res .= "<button type='button' class='btn btn-default btn-sm button m-b-10' value='code' title='".$locale['html_021']."' onclick=\"insertText('".$textarea."', '<pre><code></code></pre>', '".$formname."');\">< / ></button>\n";


A better solution would be to add:
src = "/ includes / bbcodes / images / code.svg
So far, the solution code is a replacement. We'll see what Chan says
Kvido attached the following image:
bbcode_in_news_editor2_1.png
Thread Information
Author
Replies
6 posts
Views
67 times
Last Post
Last updated on 1 day ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Kvido, Chan, Grimloch