[ABD] Codebox Plus

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
tlem
Registered User
Posts: 97
Joined: Sun Jan 24, 2016 4:47 pm
Location: France
Name: Thierry
Contact:

Re: [RC] Codebox Plus

Post by tlem » Fri Feb 05, 2016 8:28 pm

Hi o0johntam0o, thank you for your help.

I have enable the option "Display expanded", so now I can show by default the first 8 lines of a code, but impossible to scroll down (no scroll bar), and if I expand the box, when I collapse it, I again a box on one line (not too severe, but disconcerting).

If it's too complicated too made what I wish, do you know how I can keep the original behavior of Prosilver theme (a codebox with scroll bar but with colored code)?


Edit :
When I want to use the download button, I have this message returned by the server :
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

User avatar
tlem
Registered User
Posts: 97
Joined: Sun Jan 24, 2016 4:47 pm
Location: France
Name: Thierry
Contact:

Re: [RC] Codebox Plus

Post by tlem » Sat Feb 06, 2016 2:46 pm

My goal partially reaches by replacing in file ext\o0johntam0o\codeboxplus\event\main_listener.php :
$re .= '<div><div style="display: ' . (($lang != 'NULL' && !$this->expanded) ? 'none' : 'inline') . ';">';
by
$re .= '<div><div style="display: ' . (($lang != 'NULL' && !$this->expanded) ? 'none' : 'block') . '; height: 250px; overflow:auto;">';

and after activated the option "Display expanded" in the ACP.

With that, I have by default a CodeBox partialy "expanded" that show only 13 lines with scroll bar if code is more long.

Now maybe it can be interesting to add this modification in ACP and options to enable/disable line number and the interline (to show the code like a standard codebox).

It just remains to solve the problem of the download button

Great thanks to o0johntam0o for is help.

User avatar
o0johntam0o
Registered User
Posts: 228
Joined: Thu Sep 23, 2010 3:53 pm
Location: Viet Nam
Name: Tam
Contact:

Re: [RC] Codebox Plus

Post by o0johntam0o » Sat Feb 06, 2016 3:31 pm

Hi tlem, that's a general error on the server that you working on, you may want to visit this page to get a solution http://pcsupport.about.com/od/findbyerr ... rerror.htm

Regard

User avatar
tlem
Registered User
Posts: 97
Joined: Sun Jan 24, 2016 4:47 pm
Location: France
Name: Thierry
Contact:

Re: [RC] Codebox Plus

Post by tlem » Sat Feb 06, 2016 7:23 pm

I searched a bit in the server log files , but my knowledge is limited, so for now , I have chosen to disable this option.

Tanks


Edit :
After installing another extension (forum rules) , I had the same problem (Error 500). After searching , I realized that this was related to the URL rewriting functionality of the phpBB forum.

So to sum up , this extension (as well as "Forum rules") is not compatible with the URL Rewrite option in the server settings in the ACP.

Area53
Registered User
Posts: 1
Joined: Wed Feb 10, 2016 8:22 am

Re: [RC] Codebox Plus

Post by Area53 » Wed Feb 10, 2016 8:50 am

[phpBB Debug] PHP Warning: in file [ROOT]/ext/o0johntam0o/codeboxplus/event/main_listener.php on line 96: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead

this is what i get when i activate the extension

i am on phpbb 3.1.7pl

extra info on this, i had it installed on the old php version 5.3 and it runned fine, now i run php 7.0 and it gave the errors i posted 1 up here

i also added it on your github as issue

User avatar
o0johntam0o
Registered User
Posts: 228
Joined: Thu Sep 23, 2010 3:53 pm
Location: Viet Nam
Name: Tam
Contact:

Re: [RC] Codebox Plus

Post by o0johntam0o » Fri Feb 12, 2016 3:19 am

Hi Area53, currently Codebox Plus is not ready for PHP7, please replace "msie" with "msi" in preg_replace (on lines 96, 137, 161 - main_listener.php)

User avatar
3Di
Former Team Member
Posts: 14087
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [RC] Codebox Plus

Post by 3Di » Fri Feb 12, 2016 3:22 am

phpBB 3.1.x does NOT support PHP 7.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

Logman
Registered User
Posts: 38
Joined: Fri Jun 13, 2003 7:41 pm
Location: Czech Republic

Re: [RC] Codebox Plus

Post by Logman » Fri Apr 08, 2016 9:10 pm

Hi, I tried install pure phpbb 3.1.8 (prosilver) and Codebox Plus 2.0.0 on my localhost for testing purposes.

Syntax highlighting is working only in Preview mode. After submitting the colors disappear, but code box with the line numbering still exists. My tested code:

Code: Select all

[codebox=autoit file=test.au3]
If $bRool Then
	$iRndMovie = Random (1, ubound($aFileList)-1, 1)
	GUICtrlSetData($GUI_LBL_MOVIE, $aFileList[$iRndMovie])
EndIf
[/codebox]
Moreover, the extension doesn't work without "file=test.au3". This example is ignored:

Code: Select all

[codebox=autoit]
If $bRool Then
	$iRndMovie = Random (1, ubound($aFileList)-1, 1)
	GUICtrlSetData($GUI_LBL_MOVIE, $aFileList[$iRndMovie])
EndIf
[/codebox]
Any idea?


Admin settings:

Code: Select all

Enable syntax highlighting:............ Yes
Display expanded:...................... Yes 
Enable download feature:............... Yes 
Requires login to download:............ No 
Prevent Bots:.......................... Yes
Enable CAPTCHA function:............... No
Max attempt:........................... 3
phpbb 3.1.8
Codebox Plus 2.0.0
php: 5.6.15


Source post:
Image

Preview post:
Image

Submitted post:

Image

User avatar
o0johntam0o
Registered User
Posts: 228
Joined: Thu Sep 23, 2010 3:53 pm
Location: Viet Nam
Name: Tam
Contact:

Re: [RC] Codebox Plus

Post by o0johntam0o » Fri Apr 15, 2016 3:05 am

Logman wrote:Syntax highlighting is working only in Preview mode. After submitting the colors disappear, but code box with the line numbering still exists. My tested code:

Code: Select all

[codebox=autoit file=test.au3]
If $bRool Then
	$iRndMovie = Random (1, ubound($aFileList)-1, 1)
	GUICtrlSetData($GUI_LBL_MOVIE, $aFileList[$iRndMovie])
EndIf
[/codebox]
Tested and I found no problem, but I'll take a look at this issue.
Logman wrote:Moreover, the extension doesn't work without "file=test.au3". This example is ignored:

Code: Select all

[codebox=autoit]
If $bRool Then
	$iRndMovie = Random (1, ubound($aFileList)-1, 1)
	GUICtrlSetData($GUI_LBL_MOVIE, $aFileList[$iRndMovie])
EndIf
[/codebox]
Yes Logman, we have to use "file=name" to make it work.
Thanks for the feedback.

User avatar
Rhino.Freak
Registered User
Posts: 275
Joined: Wed Apr 29, 2015 8:32 am
Contact:

Re: [RC] Codebox Plus

Post by Rhino.Freak » Fri Apr 15, 2016 9:29 am

I have the ABBC3.1 extension enabled and I don't see any new button on here or below or anywhere for the codebox plus stuff.

Can there be an update so that it shows up? Otherwise I'd have to tweak it myself.

User avatar
null2
Registered User
Posts: 475
Joined: Wed Jan 20, 2010 11:03 am

Re: [RC] Codebox Plus

Post by null2 » Fri Apr 15, 2016 11:25 am

Rhino.Freak wrote:I have the ABBC3.1 extension enabled and I don't see any new button on here or below or anywhere for the codebox plus stuff.

Can there be an update so that it shows up? Otherwise I'd have to tweak it myself.
Set the option to show this bbcode in edit box. Look for that in bbcode configuration (in ACP).
Sorry for my bad english. I'm from USA.

Logman
Registered User
Posts: 38
Joined: Fri Jun 13, 2003 7:41 pm
Location: Czech Republic

Re: [RC] Codebox Plus

Post by Logman » Fri Apr 15, 2016 10:21 pm

o0johntam0o wrote:Tested and I found no problem, but I'll take a look at this issue
Thanks for ryour eply o0johntam0o. I found out that problem was an invalid code (without "file" statement) mixed with a correct one. There is a problem with parsing. Please, put this example to your testing board and try it:

Code: Select all

[codebox=autoit]
If $bRool Then
	$iRndMovier = Rfandom (1, ubound($aFileList)-1, 1)
	GUICtrlSetData($GUI_LBL_MOVIE, $aFileList[$iRndMovie])
EndIf
[/codebox]

[codebox=autoit file=test.au3]
If $bRool Then
	$iRndMovier = Rfandom (1, ubound($aFileList)-1, 1)
	GUICtrlSetData($GUI_LBL_MOVIE, $aFileList[$iRndMovie])
EndIf
[/codebox]
Is there an option how to hide rows number and line between rows?

User avatar
o0johntam0o
Registered User
Posts: 228
Joined: Thu Sep 23, 2010 3:53 pm
Location: Viet Nam
Name: Tam
Contact:

Re: [RC] Codebox Plus

Post by o0johntam0o » Sat Apr 16, 2016 2:41 am

null2 wrote:
Rhino.Freak wrote:I have the ABBC3.1 extension enabled and I don't see any new button on here or below or anywhere for the codebox plus stuff.

Can there be an update so that it shows up? Otherwise I'd have to tweak it myself.
Set the option to show this bbcode in edit box. Look for that in bbcode configuration (in ACP).
Hi Rhino.Freak, please read this post viewtopic.php?f=456&t=2248306&start=45#p14214591
Logman wrote:Thanks for ryour eply o0johntam0o. I found out that problem was an invalid code (without "file" statement) mixed with a correct one. There is a problem with parsing. Please, put this example to your testing board and try it:

Code: Select all

[codebox=autoit]
If $bRool Then
	$iRndMovier = Rfandom (1, ubound($aFileList)-1, 1)
	GUICtrlSetData($GUI_LBL_MOVIE, $aFileList[$iRndMovie])
EndIf
[/codebox]

[codebox=autoit file=test.au3]
If $bRool Then
	$iRndMovier = Rfandom (1, ubound($aFileList)-1, 1)
	GUICtrlSetData($GUI_LBL_MOVIE, $aFileList[$iRndMovie])
EndIf
[/codebox]
Hi Logman, we have to use "file=name" to make Codebox Plus work. I checked the second part of your code and I don't see any problem, maybe the Codebox Plus had trouble with other extensions in your board.
Logman wrote:Is there an option how to hide rows number and line between rows?
Please try this,
- Open: .\ext\o0johntam0o\codeboxplus\event\main_listener.php
+ Find: $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
Replace-with: $geshi->enable_line_numbers(GESHI_NO_LINE_NUMBERS);
+ Find: $geshi->set_code_style('border-bottom: dotted 1px #cccccc;', false);
Replace-with: $geshi->set_code_style('border-bottom: none;', false);
+ Find: $code = str_replace("\n", "", $geshi->parse_code());
Replace-with: $code = $geshi->parse_code();

pitur
Registered User
Posts: 69
Joined: Mon Mar 16, 2015 2:04 am

Re: [RC] Codebox Plus

Post by pitur » Mon May 09, 2016 9:08 pm

tlem wrote:My goal partially reaches by replacing in file ext\o0johntam0o\codeboxplus\event\main_listener.php :
$re .= '<div><div style="display: ' . (($lang != 'NULL' && !$this->expanded) ? 'none' : 'inline') . ';">';
by
$re .= '<div><div style="display: ' . (($lang != 'NULL' && !$this->expanded) ? 'none' : 'block') . '; height: 250px; overflow:auto;">';

and after activated the option "Display expanded" in the ACP.

With that, I have by default a CodeBox partialy "expanded" that show only 13 lines with scroll bar if code is more long.

Now maybe it can be interesting to add this modification in ACP and options to enable/disable line number and the interline (to show the code like a standard codebox).

It just remains to solve the problem of the download button

Great thanks to o0johntam0o for is help.
This is exactly what I'm trying to do as well, but when you press collapse I want it to collapse to the setting that's 250px high, not the totally collapsed version. I wonder where to set that...

So the collapsed state is the one you shared the code for, and the expanded state is fully expanded.

I wish I knew code more.

pitur
Registered User
Posts: 69
Joined: Mon Mar 16, 2015 2:04 am

Re: [RC] Codebox Plus

Post by pitur » Wed May 11, 2016 9:51 pm

Never mind - I made a booboo :)

Locked

Return to “Abandoned Extensions”