GeSHi in phpBB3 (3.0.1) einbinden

In diesem Forum können Mod-Autoren ihre Mods vorstellen, die sich noch im Entwicklungsstatus befinden. Der Einbau in Foren im produktiven Betrieb wird nicht empfohlen.
Forumsregeln
phpBB 3.0 hat das Ende seiner Lebenszeit überschritten
phpBB 3.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 3.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf die neuste phpBB-Version, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
cyberghost66
Mitglied
Beiträge: 2
Registriert: 12.03.2009 10:37

Re: GeSHi in phpBB3 (3.0.1) einbinden

Beitrag von cyberghost66 »

Ehm... Änderungen in den Styles? Welche wären das denn? :oops:
Xarkam
Mitglied
Beiträge: 1
Registriert: 16.03.2009 12:16

Re: GeSHi in phpBB3 (3.0.1) einbinden

Beitrag 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.
Antworten

Zurück zu „[3.0.x] Mods in Entwicklung“