https://www.icyphoenix.com/viewtopic.php?f=28&t=4740&p=32270#p32270
-----------------------------------
Mighty Gorgon
Fri 26 Sep, 2008 13:16

Re: PHP Based Code To HTML With BBcode
-----------------------------------
Try to add your code here:
[codeblock]				$php_syntax = false;
				if(isset($item['params']['syntax']))
				{
					if ($item['params']['syntax'] == 'php')
					{
						$html = strtr($text, array_flip(get_html_translation_table(HTML_ENTITIES)));
						$html = highlight_string($html, true);
						$html_search = array('<code>', '</code>', '<font color="', '</font', '&nbsp;', '<code style="color:#0000BB"></code>', '<code style="color:#0000BB"> </code>');
						$xhtml_replace = array('', '', '<code style="color:', '</code', ' ', '', '');
						$html = str_replace ($html_search, $xhtml_replace, $html);
						$php_syntax = true;
					}
				}[/codeblock]

Add an elseif statement to check the syntax you want to apply, and then just apply the function to $html var.

Remember that we are in linenumbers = false now... but first try to apply the code there just to check if it works, then we will try to extend it to other parts.


