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.

Bbcode in news

Will be in version 9.2 solutions bbCode "code" for NEWS & ARTICLES?
Enabled BB Codes only works for messages.
Thanks!
Right now I believe not supporting yet, but I will try to see what I can do. Please make an issue in Github.
If it's not in the core 9. The Mods community may add BBCodes support to it in the near future.
Hi Craig:
I know your solution from Version 7.2 such as:
CodeDownload  
// 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.
Anyone think before if we implement Markdown BBCode?

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

[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.
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.
WORKS bbCode editor, see. picture.
After saving but no display brands. This code is inserted:
CodeDownload  
<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
Kvido attached the following file:
phpf-902_bbcode_test1_in-editor.png [63.19kB / 81 Downloads]
The News Text :

https://github.com/php-fusion/PHP-Fusion/blob/9.02/infusions/news/classes/news/news.php#L271

CodeDownload  
 $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/php-fusion/PHP-Fusion/blob/9.02/includes/core_functions_include.php#L674-L675

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

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



FIX:
CodeDownload  
$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.
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):
CodeDownload  
# 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 !!!

CodeDownload  

<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

CodeDownload  
/*
 * 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?
What is the source code change?
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.
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/php-fusion/PHP-Fusion/commit/ec644b50b87c39a4b6e1f62e6b2339dc1031709c

Then,

https://github.com/php-fusion/PHP-Fusion/commit/76a2b9e94c182ed64fdc8eca3fc3de97fdcb7048

---
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>
Great it did help.
Thread Information
Author
Replies
14 posts
Views
2,079 times
Last Post
Last updated on 3 years 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: Craig, Kvido, Chan