Seite 3 von 3

Re: GeSHi in phpBB3 (3.0.1) einbinden

Verfasst: 14.03.2009 11:42
von test_nick
Hallo,

hast du alle änderrungen in den styles gemacht?!?!

Re: GeSHi in phpBB3 (3.0.1) einbinden

Verfasst: 14.03.2009 14:05
von cyberghost66
Ehm... Änderungen in den Styles? Welche wären das denn? :oops:

Re: GeSHi in phpBB3 (3.0.1) einbinden

Verfasst: 16.03.2009 12:23
von Xarkam
hi!
Sorry my post is only in english. (I speek french and english)

If the code bbcode tag language is not defined, then this error occurs on my board:

Code: Alles auswählen

[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 1885: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 1885: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 2238: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3187: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3239: implode() [function.implode]: Argument must be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3270: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3270: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3313: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3313: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3458: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3458: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 1885: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 1885: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 2238: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3187: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3239: implode() [function.implode]: Argument must be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3270: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3270: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3313: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3313: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3458: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3458: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 1885: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 1885: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 2238: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3187: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3239: implode() [function.implode]: Argument must be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3270: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3270: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3313: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3313: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3458: array_keys() [function.array-keys]: The first argument should be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3458: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3760: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3762: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3763: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3764: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
To resolve this error, I modified the bbcode.php file as follows:

Code: Alles auswählen

    /**
    * Second parse code tag
    */
    function bbcode_second_pass_code($type, $code)
    {
        // when using the /e modifier, preg_replace slashes double-quotes but does not
        // seem to slash anything else
        $code = str_replace('\"', '"', $code);
// ------------------------------------------------------------------------------------
      // edited by jb (nebler.org)
      // including geshi
      
      // geshipfad, relativ zum haupt-ordner (oder absolut (untested))
      $geshi_path = $phpbb_root_path . 'includes/geshi/geshi.php';

        if (empty($type))
        {
            $code = str_replace("\t", '   ', $code);
                $code = str_replace('  ', '  ', $code);
                $code = str_replace('  ', '  ', $code);

                // remove newline at the beginning
                if (!empty($code) && $code[0] == "\n")
                {
                    $code = substr($code, 1);
                }
        }
        else if(!include_once( $geshi_path ) ) { // include = zur laufzeit, requier zum start
            echo 'geshi n\'a pas pu être!';
        } else 
        {
            // Es kommt nicht ursprünglicher Code an ...
            // hier die rückformatierung, vllt nicht schön aber selten ;)
            // Not the english way ... steht irgendwo im quellcode :)
            $astr_to = array('<', '>', '[', ']', '.', ':','"');
            $astr_from = array('<', '>', '[', ']', '.', ':','"');

            $code = str_replace($astr_from, $astr_to, $code);

            // binde geshi ein, siehe geshi-faq
            // geshi Objekt erzeugen und code erzeuegn   
            $geshi = new GeSHi( $code, $type );
            // header type setzten, siehe documentation von geshi
            $geshi->set_header_type(GESHI_HEADER_NONE);
            // code parsen und highlighten
            $code = $geshi->parse_code();   
         
            // überflüssige <br /> entfernen
            $code = str_replace( '<br />', '', $code );
      
        }
        // ------------------------------------------------------------------------------------
$code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close');

        return $code;
    }
}
 
have fun.