Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function run_geshi_filter(array $params = array())
- {
- //If line numbers is explicitely turned on
- if (in_array('line_numbers_on', $params))
- $this->line_numbers_on = TRUE;
- //If line numbers is explicitely turned off (this one wins, if both defined)
- if (in_array('line_numbers_off', $params))
- $this->line_numbers_on = FALSE;
- //Get the output from CI
- $ci_output = $this->ci->output->get_output();
- //If there are <sourcecode>..</sourcecode> tags, process them
- if (strpos($ci_output, "<sourcecode"))
- {
- //Tried to use REGEX, but there were bugs! Arg!
- $begin_searching_at = 0;
- while (strpos($ci_output, "<sourcecode", $begin_searching_at))
- {
- $begin = strpos($ci_output, "<sourcecode", $begin_searching_at);
- $end = strpos($ci_output, "</sourcecode>", $begin_searching_at) + strlen("</sourcecode>");
- //Test
- $ci_output = substr($ci_output, 0, $begin) . @$this->_set_geshi_content(substr($ci_output, $begin, $end-$begin)) . substr($ci_output, $end);
- $begin_searching_at = $end;
- }
- echo $ci_output;
- }
- else
- echo $ci_output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement