[BETA] Geshi highlighter for phpBB

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning

[BETA] Geshi highlighter for phpBB

Postby Amator » Fri Aug 05, 2011 1:08 pm

Modification Name: Geshi highlighter for phpBB
Author: Amator

Modification Description: This modification adds GeSHi highlighting to posts in phpBB. Mod is based on GeSHi in phpBB3 (3.0.1) einbinden
Modification Version: 0.3 Beta

Changes from 0.2 Beta:
  • Added line numbers

Changes from 0.1 Beta:
  • Two small fixes

Screenshots: http://imageshack.us/photo/my-images/94/81666196.jpg/
http://imageshack.us/photo/my-images/94/93419774.jpg/
http://imageshack.us/photo/my-images/811/45912519.jpg/

Modification Download: http://forum.computerhelp.org.ua/mods/G ... _phpBB.zip
Last edited by Amator on Mon Aug 08, 2011 11:16 am, edited 4 times in total.
Amator
Registered User
 
Posts: 66
Joined: Mon May 31, 2010 5:19 pm

Re: [BETA] Geshi highlighter for phpBB

Postby Amator » Sat Aug 06, 2011 4:32 pm

Updated to 0.2 Beta
Amator
Registered User
 
Posts: 66
Joined: Mon May 31, 2010 5:19 pm

Re: [BETA] Geshi highlighter for phpBB

Postby Amator » Mon Aug 08, 2011 8:38 am

Added screenshots.
Amator
Registered User
 
Posts: 66
Joined: Mon May 31, 2010 5:19 pm

Re: [BETA] Geshi highlighter for phpBB

Postby Amator » Mon Aug 08, 2011 11:18 am

Updated to 0.3 Beta, changelog in first message.
Amator
Registered User
 
Posts: 66
Joined: Mon May 31, 2010 5:19 pm

Re: [BETA] Geshi highlighter for phpBB

Postby ivancp » Wed Aug 31, 2011 2:03 pm

I getting a error message when language parameter of code is empty

Code: Select all
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 2020: array_keys() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 2020: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 2392: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3345: implode(): Argument must be an array
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3368: array_keys() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3368: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3409: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3461: array_keys() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3461: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3606: array_keys() expects parameter 1 to be array, null given
[phpBB Debug] PHP Notice: in file /includes/geshi/geshi.php on line 3606: Invalid argument supplied for foreach()
ivancp
Registered User
 
Posts: 12
Joined: Mon Apr 16, 2007 12:05 am

Re: [BETA] Geshi highlighter for phpBB

Postby ivancp » Wed Aug 31, 2011 2:17 pm

You must change the include path to this:

Code: Select all
      global $phpbb_root_path;
      //...
      $geshi_path = $phpbb_root_path.'includes/geshi/geshi.php';


When I call the function from outsite forum I get an error message.
ivancp
Registered User
 
Posts: 12
Joined: Mon Apr 16, 2007 12:05 am

Re: [BETA] Geshi highlighter for phpBB

Postby Amator » Wed Aug 31, 2011 2:26 pm

Not really understood your problem. I'm using it on forum without any problems. In the last version I've provided a fix, so if user doesn't input any language JS inserts there just [code=text].
Amator
Registered User
 
Posts: 66
Joined: Mon May 31, 2010 5:19 pm

Re: [BETA] Geshi highlighter for phpBB

Postby ivancp » Wed Aug 31, 2011 3:04 pm

Amator wrote:Not really understood your problem. I'm using it on forum without any problems. In the last version I've provided a fix, so if user doesn't input any language JS inserts there just [code=text].

That messages shows when I try to see the old posts with code tags.
ivancp
Registered User
 
Posts: 12
Joined: Mon Apr 16, 2007 12:05 am

Re: [BETA] Geshi highlighter for phpBB

Postby Amator » Wed Aug 31, 2011 3:09 pm

Yes, there is such problem, but I still don't have any solution or idea how to fix it.
Amator
Registered User
 
Posts: 66
Joined: Mon May 31, 2010 5:19 pm

Re: [BETA] Geshi highlighter for phpBB

Postby ivancp » Wed Aug 31, 2011 3:13 pm

Amator wrote:Yes, there is such problem, but I still don't have any solution or idea how to fix it.

Can you give me the line code to make "text" language as default when language type is empty?
ivancp
Registered User
 
Posts: 12
Joined: Mon Apr 16, 2007 12:05 am

Re: [BETA] Geshi highlighter for phpBB

Postby Amator » Wed Aug 31, 2011 3:16 pm

It's already in mod. If user clicks on button without inputing any characters it automatically inputs [code=text]
Amator
Registered User
 
Posts: 66
Joined: Mon May 31, 2010 5:19 pm

Re: [BETA] Geshi highlighter for phpBB

Postby ivancp » Wed Aug 31, 2011 3:20 pm

Amator wrote:It's already in mod. If user clicks on button without inputing any characters it automatically inputs [code=text]


Yes, but I can't make it in old posts, I need to modify your source code to make "text" as default language to display old posts with code tag.
ivancp
Registered User
 
Posts: 12
Joined: Mon Apr 16, 2007 12:05 am

Re: [BETA] Geshi highlighter for phpBB

Postby Amator » Wed Aug 31, 2011 3:46 pm

All sources are in mod instructions, can't understand what else do you need)
Amator
Registered User
 
Posts: 66
Joined: Mon May 31, 2010 5:19 pm

Re: [BETA] Geshi highlighter for phpBB

Postby ivancp » Wed Aug 31, 2011 3:54 pm

I fix the error messages, I changed your code:
Code: Select all
   function bbcode_second_pass_code($type, $code)
   {
      // Originally created by jb (nebler.org), tested and modifyed by Amator (forum.computerhelp.org.ua)
      // when using the /e modifier, preg_replace slashes double-quotes but does not
      // seem to slash anything else
      global $phpbb_root_path;
      $code = str_replace('\"', '"', $code);

      if(strlen($type) == 0)
          $type = "text"; //fix warning messages for old posts
     
      //including Geshi parser
      $geshi_path = $phpbb_root_path.'includes/geshi/geshi.php';
ivancp
Registered User
 
Posts: 12
Joined: Mon Apr 16, 2007 12:05 am

Re: [BETA] Geshi highlighter for phpBB

Postby Amator » Wed Aug 31, 2011 3:58 pm

Thanks a lot! I'll add this to instructions.
Amator
Registered User
 
Posts: 66
Joined: Mon May 31, 2010 5:19 pm

Next

Return to [3.0.x] MODs in Development

Who is online

Users browsing this forum: JaMiskater and 46 guests