Thread subject: Official Home of the PHPFusion CMS :: Can I add a BBCODE for [?php], and how to do it?

Posted by MotyerJM on 03-05-2022 22:58
#1

Hello, all.

I have a handful of sites running PHP-Fusion 7 ( upgraded to run on PHP 8 & MySQL 8 cool ).

Some of my custom pages on those sites are identical, so rather than keeping those pages updated on the individual sites, in the custom pages I just have a single line, such as:

Quote

<?php include 'D:Webcommondocument1.php';?>

Those documents are basically just html files containing a bunch of tables <table>, <tr>, <td>, <font>, <img>, etc.

I would like to start using PHP-Fusion 9, and have just installed 9.10.20.

I would like to use those same <php> links in my PHP-Fusion v9.

I've seen some threads here about creating new bbcodes, such as RobiNN's reply to someone for adding a paragraph bbcode, but I'm not sure if I can do the same for [?php], and if it's possible, how exactly to modify an existing bbcode's files.

Any suggestions would be greatly appreciated.

Thanks in advance & have yourselves a great day.

Regards & be safe,

John

Edited by MotyerJM on 03-05-2022 23:11

Posted by Falk on 04-05-2022 12:38
#2

You can enable PHP Execution under Settings > Security.

Posted by MotyerJM on 04-05-2022 12:55
#3

Thanks for getting back to me, Falk.

I must be missing something. I'm in Settings > Security, on the Security Settings page, but I don't see anything related to enabling PHP Execution, or anything else related to PHP.

Posted by Falk on 04-05-2022 15:36
#4

My misstake, the option was removed in later revisions. Best method is to make a new file with your custom content and create a link to it.

Code
<?php
require_once "maincore.php";
require_once THEMES.'templates/header.php';

// Your content.

require_once THEMES.'templates/footer.php';

Posted by MotyerJM on 04-05-2022 20:27
#5

Great idea, except 9.10.20 is crashing due to every <>, like <table>, <tr>, <td>, <font>, <img>, etc.

Code
Parse error: syntax error, unexpected '<', expecting end of file....

Would you by any chance recall what the last approximate version of PHP-Fusion 9 was that I would still be able to enable PHP Execution under Settings > Security?

I don't mind going back a few versions of PHP-Fusion 9... hell, I've been happily running my sites flawlessly for the past decade on PHP-Fusion 7 cool, but as I do every couple of years, thought I would try to bring better security to my sites with PHP-Fusion 9, as long as I can get it to work & look (almost) identical to PHP-Fusion 7, but it appears it can't. And without a similar theme as Gillette's default theme for v7, it doesn't even come close.

Don't get me wrong, I am NOT bashing v9, it looks great smile, it just doesn't suit my needs.

Thanks anyway for your help & suggestions, Falk, I sincerely appreciated you taking the time to reply.

Regards,
John

Posted by Falk on 05-05-2022 00:41
#6

If you only use HTML, terminate the PHP and enable it again.
Code

<?php
require_once "maincore.php";
require_once THEMES.'templates/header.php';
?>

// Your content.

<?php
require_once THEMES.'templates/footer.php';