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.
Not a member yet? Click here to register.
Forgot Password?

Bbcodes in news textarea

Asked Modified Viewed 2,931 times
K
Kvido
K
Kvido 10
Linux-Ubuntu 09.03.60, Linux/Ubuntu, PHP5, HTML5, Mozilla-Firefox 3.6.3, Opera 10.51, IE 8.0.6
https://www.nekecamweb.cz
  • Senior Member, joined since
  • Contributed 524 posts on the community forums.
  • Started 108 threads in the forums
  • Started this discussions
asked
Senior Member

@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: PHPFusion Development Team
*******

$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
$res .= "<button type='button' value='??????????' title='".$locale['???????????']."'

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

Would you have a solution, please?
Edited by Kvido on 25-05-2020 13:39,
Kvido attached the following image:
Image not found Image not found
0 replies

7 posts

C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Good idea, can you wait for commit? We will inform you when it's there.
1 reply
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Answered 2 questions
answered
Senior Member

Quote

I'm almost done:

$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:
$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.
1 reply
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

That's all.
$res .= "<button type='button' value='code' title='code' class='btn btn-sm btn-default m-b-10 button' onclick=\"addText('".$textarea."', '&lt;pre&gt;&lt;code&gt;', '&lt;/code&gt;&lt;/pre&gt;', '".$formname."');\"><i class='fa fa-code'></i></button>\n";
1 reply
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Finally had some time to look into things, and this is my input for the button.

$res .= "<button type='button' value='code' title='Format as Code' data-toggle='tooltip' class='btn btn-sm btn-default m-b-10 button' onclick=\"addText('".$textarea."', '<code>', '</code>', '".$formname."');\"><i class='far fa-code'></i></button>\n";


I do not know how you stored the code, maybe you have some entity problem. But according to your link, and a quick test file shown no errors.

I attached a file here test. Open up the file in the browser containing the testbox.

Everything is pretty standard here. I didn't need to alter anything in core except adding a html button.
Edited by Chan on 27-05-2020 06:07,
Chan attached the following file:
code-html.zip [No information available / 116 Downloads]
1 reply
Z
zizub
Z
zizub 10
  • Member, joined since
  • Contributed 156 posts on the community forums.
  • Started 29 threads in the forums
answered
Member

I tried the code that Chan published. Everything works for me.
Only the output of the icon needs to be corrected, there is a typo. Remove the letter r from class = far fa-code.
Before you copy the code from the forum, I recommend disabling the page translation if you use a translator.

If this does not help, try replacing the html_buttons_include file with a new one and paste the button code into it.
Clear your browser cache. Simple tips for an experiment in search of errors.
Edited by zizub on 27-05-2020 14:31,
zizub attached the following image:
Image not found Image not found
1 reply
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

Wait for new release (9.03.60).
1 reply
Z
zizub
Z
zizub 10
  • Member, joined since
  • Contributed 156 posts on the community forums.
  • Started 29 threads in the forums
answered
Member

Quote

4 / What version are you using, I have Andromeda 9.03.50

I tried the button code in Andromeda 9.03.50
Edited by zizub on 27-05-2020 17:06,
1 reply

Category Forum

PHPFusion Dynamics - 9

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 5 members

5 participants

K
K
Kvido 10
Linux-Ubuntu 09.03.60, Linux/Ubuntu, PHP5, HTML5, Mozilla-Firefox 3.6.3, Opera 10.51, IE 8.0.6
https://www.nekecamweb.cz
  • Senior Member, joined since
  • Contributed 524 posts on the community forums.
  • Started 108 threads in the forums
  • Started this discussions
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
G
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Answered 2 questions
Z
Z
zizub 10
  • Member, joined since
  • Contributed 156 posts on the community forums.
  • Started 29 threads in the forums
R
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet