PHP bbcode

Get help developing custom BBCodes or request one.
User avatar
</Solidjeuh>
Registered User
Posts: 1732
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

PHP bbcode

Post by </Solidjeuh> » Mon Jan 02, 2017 3:49 pm

Hello,

Is there a special bbcode for adding PHP and HTML code structure?
Like this one: https://www.phpbb.com/support/docs/en/3 ... gphp-file/

Image

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7663
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: PHP bbcode

Post by JimA » Mon Jan 02, 2017 3:51 pm

That has always been built into phpBB by default (but has been removed in 3.2 though).
If you're using phpBB 3.1, you can use the [code=php][/code] structure. :)
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

User avatar
</Solidjeuh>
Registered User
Posts: 1732
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: PHP bbcode

Post by </Solidjeuh> » Mon Jan 02, 2017 3:53 pm

JimA wrote: ↑
Mon Jan 02, 2017 3:51 pm
That has always been built into phpBB by default (but has been removed in 3.2 though).
If you're using phpBB 3.1, you can use the structure. :)
Ooooow I didn't know that :D Thank you!
Then I'm gonna need bbcode in phpbb 3.2 soon ...

User avatar
3Di
Former Team Member
Posts: 14372
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: PHP bbcode

Post by 3Di » Mon Jan 02, 2017 4:20 pm

That's for 3.2.x, a syntax highlighter.

https://github.com/s9e/phpbb-ext-highlighter/releases
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
</Solidjeuh>
Registered User
Posts: 1732
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: PHP bbcode

Post by </Solidjeuh> » Mon Jan 02, 2017 4:58 pm

3Di wrote: ↑
Mon Jan 02, 2017 4:20 pm
That's for 3.2.x, a syntax highlighter.

https://github.com/s9e/phpbb-ext-highlighter/releases
Thank you !! Tried on test forum, works perfect! :D

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21676
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: PHP bbcode

Post by Mick » Mon Jan 02, 2017 6:09 pm

JimA wrote: ↑
Mon Jan 02, 2017 3:51 pm
but has been removed in 3.2 though
Really? Any idea why? I always thought that was a very cool feature.
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7663
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: PHP bbcode

Post by JimA » Mon Jan 02, 2017 6:16 pm

Mick wrote: ↑
Mon Jan 02, 2017 6:09 pm
JimA wrote: ↑
Mon Jan 02, 2017 3:51 pm
but has been removed in 3.2 though
Really? Any idea why? I always thought that was a very cool feature.
It was a side-effect from introducing the new BBcode parser. Author JoshyPHP did in turn develop the extension that 3Di linked to, so anyone who wants to can still have the feature on their board. :)
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

User avatar
JoshyPHP
Code Contributor
Posts: 1046
Joined: Mon Jul 11, 2011 12:28 am

Re: PHP bbcode

Post by JoshyPHP » Mon Jan 02, 2017 6:23 pm

Syntax highlighting in phpBB <= 3.1 used highlight_string() at posting time, which required the text be stored as a mix of HTML and other markup such as BBCodes. That's not the case anymore and re-implementing this feature on the server was not worth it considering there are better alternatives on the client.
I wrote the thing that does BBCodes in 3.2.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21676
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: PHP bbcode

Post by Mick » Mon Jan 02, 2017 6:36 pm

Thanks both.
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
</Solidjeuh>
Registered User
Posts: 1732
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: PHP bbcode

Post by </Solidjeuh> » Mon Jan 02, 2017 6:39 pm

So if i use [code=php] now, the code will be broken in phpBB 3.2 ? :cry:
Then I need to edit all those posts

User avatar
3Di
Former Team Member
Posts: 14372
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: PHP bbcode

Post by 3Di » Mon Jan 02, 2017 10:56 pm

Froddelaar wrote: ↑
Mon Jan 02, 2017 6:39 pm
So if i use [code=php] now, the code will be broken in phpBB 3.2 ? :cry:
Then I need to edit all those posts
Did you realise how many times this bbcode has been used here at .com?
I don't see any broken post as for now, though. And we are on 3.2.x now here.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
</Solidjeuh>
Registered User
Posts: 1732
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: PHP bbcode

Post by </Solidjeuh> » Mon Jan 02, 2017 11:24 pm

Yes correct! :) it just removes =php from the code, so it becomes a normal [code]

Code: Select all

<?php
// phpBB 3.0.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'mysql'; //database type it may not be mysql
$dbhost = 'database host/domain';
$dbport = 'database port if not default';
$dbname = 'database name';
$dbuser = 'database user name';
$dbpasswd = 'database password';

$table_prefix = 'database table prefix';
$acm_type = 'file';
$load_extensions = '';

@define('PHPBB_INSTALLED', true);
//@define('DEBUG', true);
//@define('DEBUG_EXTRA', true);
?>

LavIgor
Registered User
Posts: 541
Joined: Mon Apr 28, 2014 1:47 pm

Re: PHP bbcode

Post by LavIgor » Tue Jan 17, 2017 3:51 pm

JoshyPHP wrote: ↑
Mon Jan 02, 2017 6:23 pm
That's not the case anymore and re-implementing this feature on the server was not worth it considering there are better alternatives on the client.
But there's no built-in alternative anymore.
BTW how to highlight the code here at phpbb.com now? :roll:
And why was it considered impossible to still use highlight_string() for codes with php parameter?
Because e.g. quotes having parameters are correctly parsed.

User avatar
JoshyPHP
Code Contributor
Posts: 1046
Joined: Mon Jul 11, 2011 12:28 am

Re: PHP bbcode

Post by JoshyPHP » Tue Jan 17, 2017 4:12 pm

Posts used to be stored as HTML and that's not the case anymore. highlight_string() doesn't fit in that workflow.
I wrote the thing that does BBCodes in 3.2.

LavIgor
Registered User
Posts: 541
Joined: Mon Apr 28, 2014 1:47 pm

Re: PHP bbcode

Post by LavIgor » Tue Jan 17, 2017 11:42 pm

JoshyPHP wrote: ↑
Tue Jan 17, 2017 4:12 pm
Posts used to be stored as HTML and that's not the case anymore. highlight_string() doesn't fit in that workflow.
Why cannot it be applied after posts are fetched from the database before displaying?
Just like quotes as I've said in my previous message.

Post Reply

Return to “Custom BBCode Development and Requests”