Using PHP inside BBCodes With PHPBB3 GeShi
Posted: Tue Feb 28, 2012 9:49 pm
Hi guys, soo I really want to use GeSHi inside of my BBCodes. But it's not loading right. I have uploaded GeSHi to my website and tried to create BBCodes to access but its not working. Is any form of PHP allowed in BBCodes? I know they are generally HTML codes but still?
Here is what I've tried.
BBCode usage:
HTML replacement:
In my post I put this:
[php]$code = str_replace("\t", ' ', $code);
$code = str_replace(' ', ' ', $code);
$code = str_replace(' ', ' ', $code);
$code = str_replace("\n ", "\n ", $code);[/php]
It outputs this instead of what I want:
$code = str_replace(' ', ' ', $code);
$code = str_replace(' ', ' ', $code);
$code = str_replace("\n ", "\n ", $code);; $language = 'php'; $geshi = new GeSHi($source, $language); echo $geshi->parse_code(); ?>
Any ideas on how to make this work without a mod if possible?
Edit
--
Well I've discovered that using that full link for some reason effects it and it wont load..
Here is what I've tried.
BBCode usage:
Code: Select all
[PHP]{TEXT}[/PHP]
Code: Select all
<?php
include_once 'http://myfullwesbiteurlstuff4/geshi/geshi.php';
$source = {TEXT};
$language = 'php';
$geshi = new GeSHi($source, $language);
echo "$geshi->parse_code()";
?>
[php]$code = str_replace("\t", ' ', $code);
$code = str_replace(' ', ' ', $code);
$code = str_replace(' ', ' ', $code);
$code = str_replace("\n ", "\n ", $code);[/php]
It outputs this instead of what I want:
$code = str_replace(' ', ' ', $code);
$code = str_replace(' ', ' ', $code);
$code = str_replace("\n ", "\n ", $code);; $language = 'php'; $geshi = new GeSHi($source, $language); echo $geshi->parse_code(); ?>
Any ideas on how to make this work without a mod if possible?
Edit
--
Well I've discovered that using that full link for some reason effects it and it wont load..