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.
DoctorUltra
Mitglied
Beiträge: 156
Registriert: 22.01.2008 13:35

Beitrag von DoctorUltra »

jetzt funktioniert alles, man sollte oben mal den Code anpassen
DoctorUltra
Mitglied
Beiträge: 156
Registriert: 22.01.2008 13:35

Beitrag von DoctorUltra »

Was mir noch aufgefallen ist im Board3 Portal funktioniert die anzeige nicht richtig es werden keine Farben angezeigt, es schaut aus wie der normale code?
Phisker
Mitglied
Beiträge: 5
Registriert: 11.10.2008 15:43

Beitrag von Phisker »

dgroeser hat geschrieben:Da könnte man doch einen fertigen Mod machen oder?

Vielleicht sogar diesen Mod weiter entwickeln

Mod
Also das finde ioch sinnvoller diese Fette Mod weiter zu entwickeln!
mrxcptn

Re: GeSHi in phpBB3 (3.0.1) einbinden

Beitrag von mrxcptn »

Ich habe das ganze einmal ausprobiert, funktioniert auch alles wunderbar, so lange bis man nur [ code ] als Tag angibt.
Weil ich ein bisschen php kann, google verwenden kann und gerne ein wenig bastle, hab ich den Bug behoben.
Er liegt in der bbcode.php
Das hier ist meine überarbeitete Version von dem was man einfügen muss:

Code: Alles auswählen

	/**
	* Second parse code tag
	*/
       /**
       * 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 = './includes/geshi/geshi.php';
		if(!include_once( $geshi_path))
		{
          		// include = zur laufzeit, requier zum start
          		echo 'geshi konnte nicht eingebunden werden!';
          	}
		else
		{
//------------------------------If-Schleife implementiert von mrxcptn, um Fehlermeldung zu vermeiden, 
//------------------------------wenn man nur [ code ] ohne parameter als bbcode aufruft
			if(strlen($type) > 0) //überprüfen ob der typ, der hinter dem [code= steht überhaupt vorhanden ist
                        {
   
   	          // 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 );
                          }
		}
Ich verwende übrigens phpBB 3.0.4, dort funktioniert das ohne probleme
Boecki91
Ehemaliges Teammitglied
Beiträge: 4744
Registriert: 18.06.2006 15:21

Re: GeSHi in phpBB3 (3.0.1) einbinden

Beitrag von Boecki91 »

http://code.google.com/p/phpbb3-geshi/

Das ist das was wir damals gebastelt haben, wurde aber nie veröffentlicht. Wenn das jemand nutzen will, von meiner Seite aus gerne, steht schließlich unter GPL.
Standart: Am besten mit beiden Beinen auf dem Boden
Standardmäßig antworte ich nicht auf PMs
bugses
Mitglied
Beiträge: 2
Registriert: 28.02.2009 14:05

Re: GeSHi in phpBB3 (3.0.1) einbinden

Beitrag von bugses »

DE: Ich habe ein Problem mit meinem Forum phpbb3 v3.0.4, forum.android.com.pl
Ich habe geshi auf meinem Forum und ich habe einen Fehler wie den folgenden:

EN: I have a problem with my forum phpbb3 v3.0.4, forum.android.com.pl
I have installed geshi on my forum and I have a error like this:

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)

DE: Können Sie mir helfen?
Sorry für mein Deutsch, aber ich bin aus dem Englischen zu übersetzen.

EN: Could you help me?
Sorry for my Deutsch, but I'm translate to from English.
jerikool
Mitglied
Beiträge: 106
Registriert: 14.07.2008 08:16

Re: GeSHi in phpBB3 (3.0.1) einbinden

Beitrag von jerikool »

Kann mir bitte einer erklären was GeShi ist? Was soll ein Syntax Highlighter sein? :S
bugses
Mitglied
Beiträge: 2
Registriert: 28.02.2009 14:05

Re: GeSHi in phpBB3 (3.0.1) einbinden

Beitrag von bugses »

DE: Ich habe diesen Fehler, wenn ich geshi unter phpbb3.
Ich denke, dass diese Datei auch: bbcode.php machen das Problem.

Wenn Sie PHPBB3 und Sie haben keine Probleme mit geshi, bitte senden Sie mir diese Datei, so dass ich versuchen Sie zu vergleichen mit meinem bbcode.php

EN: I have this error when I use geshi under phpbb3.
I think that this file is: bbcode.php make the problem.

If you use PHPBB3 and you do not have any problem with geshi, please send me this file, so I try to compare with my bbcode.php

Große Bilder bitte nur verlinken - KB:16 - JFooty
http://android.com.pl/blad%20geshi.jpg
Große Bilder bitte nur verlinken - KB:16 - JFooty
cyberghost66
Mitglied
Beiträge: 2
Registriert: 12.03.2009 10:37

Re: GeSHi in phpBB3 (3.0.1) einbinden

Beitrag von cyberghost66 »

Hallo zusammen...

Zumindest habe ich hier mal eine Anleitung gefunden, die (wenn man sie zu 100% befolgt) nicht das komplette Forum zerschiesst.

Allerdings habe ich trotzdem noch ein Problem, was das ganze im Endeffekt zunicht macht.

Nachdem ich alle oben genannten änderungen an den Dateien vorgenommen habe wird bei mir der KOMPLETTE Bereich überhaupt nicht mehr im Post angezeigt.... :(

Inklusive der Tags.

Dabei ist es egal, ob ich nun NUR

Code: Alles auswählen

 oder z.B. [code=php] verwende...

Woran kann das liegen...

PS: Falls mir jmd nen highlight für LSL (Linden Script Language) hat wäre ich auch dankbar :P
Antworten

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