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?

bbcode in news

Asked Modified Viewed 3,992 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

Will be in version 9.2 solutions bbCode "code" for NEWS & ARTICLES?
Enabled BB Codes only works for messages.
Thanks!
0 replies

13 posts

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

Right now I believe not supporting yet, but I will try to see what I can do. Please make an issue in Github.
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

If it's not in the core 9. The Mods community may add BBCodes support to it in the near future.
0 replies
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
answered
Senior Member

Hi Craig:
I know your solution from Version 7.2 such as:
// BB Codes For Mod News - Fangree_Craig
if ((file_exists (INCLUDES. "na_bbcodes_settings.php")) && $ settings [ 'tinymce_enabled']! == 1) {
require_once INCLUDES. "na_bbcodes_settings.php";
}

The question is perhaps only to be implemented into infusions, where they are now and NEWS ARTICLES.
Edited by Kvido on 12-10-2016 16:08,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Anyone think before if we implement Markdown BBCode?

You see if I were to create a BBCode table....

[table]
[thead]
[tr]
[td]head 1[/td][td]head 2[/td]
[/tr]
[/thead]
[code]

It's gonna be very tough...

[code]
| head 1 | head 2|
|---|---|


Very fast..

So, I'm thinking if we add markdown capability to both PF's bbcode & html modes...

As for <code > tag....to print in letters, it's like this:

 <?php echo $code; ?>


to execute, i've made in carousel widget, it's like this
{eval}
<?php
$code;
?>
{/eval}

I'll give some thoughts on this before finalizing on this matter.
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Guys try out the code bbcode on git 9.02 branch
Both code and
 code 


----

For this issue I propose an embedded bbcode in HTML and use a <bbcode> tag so everything inside translated into bbcode?

@Kvido, i think dont do just code bbcode, implement all if we do this.
0 replies
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
answered
Senior Member

WORKS bbCode editor, see. picture.
After saving but no display brands. This code is inserted:
<bbCode>
<pre>
echo „&lt;script type=’text/javascript’ src=’“.INCLUDES.“drag.js’&gt;&lt;/script&gt;n“;
</pre>
</bbCode>

Do stránky theme.php (své šablony vzhledu, kterou používáte) poté dáme následující kód-zápis:

<bbCode>
<pre>
echo „
 &lt;div id=’i1&#8242; style=’position:absolute; top:5px; left:750px; width:250px; height:300px; z-index: 11;’&gt;
 &lt;table width=’250&#8242; height=’300&#8242;border=’0&#8242;&gt;
 &lt;tr&gt;&lt;td&gt;&lt;img src=’../../images/xxxx.png’&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
 &lt;/div&gt;
 &lt;script language=’javascript’&gt;
 new dragElement(‘i1&#8242;);
 &lt;/script&gt;n“;
</pre>
</bbCode>


The code can be seen in b&#345;lánku:
https://www.pc-politika.cz/news/8323/Vkladame-objekt-na-stranku

I note that the Administration bbCode I turned + Geshi.

]In Articles bbCode works perfectly !!!
https://www.pc-politika.cz/articles/1...es,-test-1
Edited by Kvido on 14-10-2016 08:19,
Kvido attached the following file:
phpf-902_bbcode_test1_in-editor.png [No information available / 207 Downloads]
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

The News Text :

https://github.com/PHPFusion/PHPFusion/blob/9.02/infusions/news/classes/news/news.php#L271

 $news_text = $data['news_extended'] ? parse_textarea("<p>".$data['news_news']."</p><p>".$data['news_extended']."</p>") : parse_textarea("<p>".$data['news_news']."</p>");


From what I can tell, it should be converting ASCII texts to HTML code, and is BBCode Supported already. So my thoughts are telling me that parse_textarea() is not working 'as intended'.

I'm thinking maybe:

https://github.com/PHPFusion/PHPFusion/blob/9.02/includes/core_functions_include.php#L674-L675

These both lines switch, decode first, then parseubb. Please try.

WRONG:
$data = $bbcode ? parseubb($data) : $data;
    $data = $decode ? html_entity_decode(stripslashes($data), ENT_QUOTES, $locale['charset']) : $data;


FIX:
$data = $decode ? html_entity_decode(stripslashes($data), ENT_QUOTES, $locale['charset']) : $data;
$data = $bbcode ? parseubb($data) : $data;


If ok, i'll make the amends on Github.
0 replies
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
answered
Senior Member

OK, I'm on it.
I made those adjustments.
I made those adjustments.
Once the code editor appears entities - &lt;
&gt; is not stored inside the enrollment ...

https://www.pc-politika.cz/news/8336/...od-do-HTML

Miss something like this (the markdown):
# Remove UTF-8 BOM and marker character in input, if present.
      $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text);

      # Standardize line endings:
      #   DOS to Unix and Mac to Unix
      $text = preg_replace('{\r\n?}', "\n", $text);


There was indented 4 spaces. And entities appear !!!


<code>
<pre>
echo < p >There was indented 4 spaces. And entities appear !!! < / p >
<p>This has been indented 4 spaces.</p>
</pre>
</code>


It should work even when [bbcode]
@Chan Is the problem solved?
https://www.pc-politika.cz/news/8336/...od-do-HTML
Sample code is properly embedded here:
https://www.pc-politika.cz/news/8323/...na-stranku

/*
 * Adds a rule to
 (markdown) to translate to <code>
 */
$mcode_count = substr_count($text, "
[code] "); // obtained


Solutions for manual editing of the news.
The best course would be to automatically adjust the bbCode icon #code. Seeking how?
Edited by Kvido on 16-10-2016 14:36,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

What is the source code change?
0 replies
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
answered
Senior Member

I expressed inaccurately.
I TEXT source code that inserts + characters [code] ... [/ code].
In short - all examples of encoders encoding we want to put across to the news editor Adminiostrace.
Edited by Kvido on 17-10-2016 04:21,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

The problem is when it saves, we parsed the bbcode become HTML already saved into SQL. That is wrong if we want to use bbcode tags in the news. [strong][underline][color][code][quote].. We store the tags as is into SQL.

The fix was simply like this:

https://github.com/PHPFusion/PHPFusion/commit/ec644b50b87c39a4b6e1f62e6b2339dc1031709c

Then,

https://github.com/PHPFusion/PHPFusion/commit/76a2b9e94c182ed64fdc8eca3fc3de97fdcb7048

---
Edited by Chan on 17-10-2016 23:35,
0 replies
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
answered
Senior Member

I see, wow!
Entities are automatically entered! It works!
There is therefore no need to activate the "#", therefore it is not in the News Editor.

That surprised me! Definitely a good solution for source code examples in text documents.

We just have to put spaces before and after - for example brackets - and will be replaced as HTML entities. Who wants to emphasize that it is the code that's wrapped in <pre> ... </ pre>
Edited by Kvido on 17-10-2016 18:50,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Great it did help.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 13 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
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,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet