@al3bed:
Yeah, that's what I said. X3 And yeah, I also said I hard-refreshed (Ctrl+Shift+R in FireFox, loads page ignoring cache). Adding a php.ini file inside the forum directory shouldn't do anything--my webserver is set to use only one php.ini file, after all. XD
@ForumsMods:
No, the options are uncommented (semicolon removed from the start of the line). As I said, the changes
did take in the test PHP file, but did
not take in the vBulletin forum.
I'm not sure if I am using post cache. Where can I find out about that?
--------------- Added [DATE]1296890277[/DATE] at [TIME]1296890277[/TIME] ---------------
Solved. Kind of.
First, I downloaded GeSHi.
http://qbnz.com/highlighter/
I uploaded the
geshi folder to my
includes directory, along with the
geshi.php file.
I created a custom BBCode,
PHPS.
I added a new plugin at
bbcode_create with the following:
PHP Code:
$this->tag_list['no_option']['phps'] = array ();
$this->tag_list['no_option']['phps']['callback'] = 'handle_external';
$this->tag_list['no_option']['phps']['external_callback'] = 'handle_geshi_php';
if (!function_exists ('handle_geshi_php'))
{
function handle_geshi_php(&$theobj, &$value, &$option)
{
require_once(DIR . '/includes/geshi.php');
$geshi = new GeSHi($value, 'php');
return '<div class="bbcode_container"><div class="bbcode_description">PHP Code:</div><pre style="height:300px;" class="bbcode_code">'.$geshi->parse_code().'</pre></div>';
}
}
I'll likely use this for JavaScript and several things that vBulletin does not support by default.
I recommend it to you other Admins that need syntax highlighting, too. :>
--------------- Added [DATE]1296893984[/DATE] at [TIME]1296893984[/TIME] ---------------
THough it was "solved" above, I learned that I was having trouble with some HTML entities.
Below is the complete PHP for the bbcode_create hook which eliminates all those problems.
PHP Code:
$this->tag_list['no_option']['phps'] = array ();
$this->tag_list['no_option']['phps']['callback'] = 'handle_external';
$this->tag_list['no_option']['phps']['external_callback'] = 'handle_geshi_php';
if (!function_exists ('handle_geshi_php'))
{
function handle_geshi_php(&$theobj, &$value, &$option)
{
require_once(DIR . '/includes/geshi.php');
if (!is_array($codefind1))
{
$codefind1 = array('<br>','<br />');
$codereplace1 = array('','');
$codefind2 = array('>','<','"','&','[',']',);
$codereplace2 = array('>','<','"','&','[',']',);
}
$code = rtrim(str_replace($codefind1, $codereplace1, $value));
$code = str_replace($codefind2, $codereplace2, $code); // finish replacements
$geshi = new GeSHi($code, 'php');
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
$code = $geshi->parse_code();
$code = preg_replace('/&#([0-9]+);/', '&#$1;', $code);
$code = str_replace(array('[', ']'), array('[', ']'), $code);
return '<div class="bbcode_container"><div class="bbcode_description">PHP Code:</div><div style="height: 300px;" class="bbcode_code">'.$code.'</div></div>';
}
}
Yay