- ipv "Code:" moet er "PHP:" komen te staan.
- "list=" button vervangen door een "PHP" button.
Roy

eviL<3 schreef:First of all you need to install this, and unfortunateley phpbb.com is downramon fincken schreef:Hi Igor,
did you by any chance have that PHP bbcode highliting code for me?
Ramon: http://www.phpbb.com/phpBB/viewtopic.php?t=119512
Here you are:
open:
includes/bbcode.php
find:After, add:Code: Selecteer alles
$bbcode_tpl = null;
Replace the bbencode_second_pass_php function with this:Code: Selecteer alles
// GeSHi include($phpbb_root_path.'includes/geshi.php');
Code: Selecteer alles
// Start add - PHP Syntax Highlighter BBCode MOD /** * PHP MOD * Original code/function by phpBB Group * Modified by JW Frazier / Fubonis < php_fubonis@yahoo.com > */ function bbencode_second_pass_php($text, $uid, $bbcode_tpl) { $code_start_html = $bbcode_tpl['php_open']; $code_end_html = $bbcode_tpl['php_close']; // First, do all the 1st-level matches. These need an htmlspecialchars() run, // so they have to be handled differently. $match_count = preg_match_all("#\[php:1:$uid\](.*?)\[/php:1:$uid\]#si", $text, $matches); // To change the colors of the syntax, uncomment the 6 lines above and // change the color codes. IF your host php settings allow ini_set() the // colors will be changed. If ini_set() is disallowed, nothing will change. // @ini_set('highlight.string', '#DD0000'); // @ini_set('highlight.comment', '#FF9900'); // @ini_set('highlight.keyword', '#007700'); // @ini_set('highlight.bg', '#FFFFFF'); // @ini_set('highlight.default', '#0000BB'); // @ini_set('highlight.html', '#000000'); for ($i = 0; $i < $match_count; $i++) { $before_replace = $matches[1][$i]; $after_replace = ltrim(rtrim($matches[1][$i]), "\n\r\x0B"); // Prepare the code for highlight_string() $after_replace = undo_htmlspecialchars($after_replace); // Add the php tags if needed to let highlight_string() works /*if (preg_match('/^<\?.*?\?>$/si', $after_replace) <= 0) //if ( ! preg_match ( '#(?:\<\?php|\<\?)#is', $string, $match ) ) { $after_replace = "<?php\n\n" . $after_replace . "\n\n?>"; $added = TRUE; } else*/ { $added = FALSE; } // Highlight the php code /*if(strcmp('4.2.0', phpversion()) > 0) { ob_start(); highlight_string($after_replace); $after_replace = ob_get_contents(); ob_end_clean(); } else { $after_replace = highlight_string($after_replace, TRUE); }*/ // GeSHi $after_replace = stripslashes($after_replace); $geshi =& new GeSHi($after_replace, 'php'); $geshi->set_header_type(GESHI_HEADER_NONE); //$geshi->enable_classes(); //$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 5); //$geshi->set_overall_style('color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', true); //$geshi->set_line_style('font: normal normal 95% \'Courier New\', Courier, monospace; color: #003030;', 'font-weight: bold; color: #006060;', true); //$geshi->set_code_style('color: #000020;', 'color: #000020;'); //$geshi->set_link_styles(GESHI_LINK, 'color: #000060;'); //$geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;'); //$geshi->set_header_content('GeSHi © 2004, Nigel McNie. View source of example.php for example of using GeSHi'); //$geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;'); //$geshi->set_footer_content('Parsed in <TIME> seconds, using GeSHi <VERSION>'); //$geshi->set_footer_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;'); $after_replace = $geshi->parse_code(); // Remove the php tags if added to let highlight_string() works /*if ($added == TRUE) { $after_replace = substr_replace($after_replace, '', '<?php '); $after_replace = substr_replace($after_replace, '', '?>'); } // Remove the <code> tag added by highlight_string() not to force the text size $after_replace = str_replace('<code>', '', $after_replace); $after_replace = str_replace('</code>', '', $after_replace);*/ // Remove the new lines added by highlight_string() $after_replace = str_replace("\n", '', $after_replace); // Replace ":", "(" & ")" by their HTML codes to prevent smilies replacements $code_entities_match = array('#:#', '#\(#', '#\)#'); $code_entities_replace = array(':', '(', ')'); $after_replace = preg_replace($code_entities_match, $code_entities_replace, $after_replace); // Replace <font color=...> by <span style="color:...> to be HTML 4 compliant and not to force the text size too //$after_replace = preg_replace('/<font color="(.*?)">/si', '<span style="color: \\1;">', $after_replace); $after_replace = preg_replace('/<font color="([a-fA-F0-9*]){3,6}">/si', '<span style="color: \\1;">', $after_replace); $after_replace = str_replace('</font>', '</span>', $after_replace); $str_to_match = "[php:1:$uid]" . $before_replace . "[/php:1:$uid]"; $replacement = $code_start_html; $replacement .= $after_replace; $replacement .= $code_end_html; $text = str_replace($str_to_match, $replacement, $text); } // Now, do all the non-first-level matches. These are simple. $text = str_replace("[php:$uid]", $code_start_html, $text); $text = str_replace("[/php:$uid]", $code_end_html, $text); return $text; } // bbencode_second_pass_code_php() // End add - PHP Syntax Highlighter BBCode MOD
Oh, de vraag was waar het vandaan moet komen, ik dacht dat de vraag was waar het naartoe moest!Ramon Fincken schreef:pin me daar "even" nogniet op vast, ik wacht op een reply van evil<3 waar we dat bestand vandaan gaan halen ....
Ramon Fincken schreef:Hier een quote, al is me niet duidelijk waar dat geshi bestand nu moet, ik zoek dat even uit ...