CodeBox Pluss (Syntax Highlighter), Lines Problem.

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Ideas Centre
Post Reply
Raheem
Registered User
Posts: 82
Joined: Thu Feb 09, 2017 7:02 pm
Location: Egypt
Contact:

CodeBox Pluss (Syntax Highlighter), Lines Problem.

Post by Raheem » Fri Feb 10, 2017 4:47 pm

Hello, I installed THIS extension in my Forum and it's working but there is strange problem i don't know how to fix as i don't know about PHP.

Problem: When i post code without empty lines it add empty line and if i added empty line it add 2 and so in. It increase 1 empty line. Exmaple when i post this code:

Code: Select all

#include <amxmodx>

new iITimeLeft, iIMinutes, iISeconds
new ifTimeLeft, ifMinutes, ifSeconds

public plugin_init()
{
	register_plugin("Time Left", "1.0", "Raheem")
	register_logevent("New_Round", 2, "1=Round_Start")
	
	set_task(1.0, "Check_RoundTimeleft", _, _, _, "b")
}

public New_Round()
{
	iITimeLeft = get_timeleft()
	iIMinutes = iITimeLeft / 60
	iISeconds = iITimeLeft % 60
} 
It appears as in this photo:

Image

It have no sequence seems it's insert empety lines everywhere, Any help or suggestion? Or can anyone make another extention for phpBB 3.2.0 this really important. Thanks in advance.

OK just to fix the line double just open event/main_listener.php

Then find this event: message_parser_event() and then delete it all and add this one:

Code: Select all

/*
    * Event: core.modify_format_display_text_after (message_parser.php)
    * Use: $this->codebox_template()
    * Generate text for preview
    */
    public function message_parser_event($event)
    {
        if (isset($event['text']))
        {
            $text = $event['text'];
            $post_id = 0;
            $part = 0;
            $text = preg_replace_callback('#<div class="codebox" title="' . preg_quote($this->user->lang['CODEBOX_PLUS_TITLE']) . '" data-language="(.*?)" data-filename="(.*?)"><p>.*?</p><code>(.*?)</code></div>#msi',
                        function ($arg) use ($post_id, &$part)
                        {
                            // Before : 
                            //return $this->codebox_template(preg_replace('#\<br\\s*/?\>#msi', "\n", $arg[3]), $arg[1], $arg[2], $post_id, ++$part);
                            // After : 
                            return $this->codebox_template(preg_replace('#\<br\\s*/?\>#msi', "", $arg[3]), $arg[1], $arg[2], $post_id, ++$part);
                        },
                        $text);
            //$text = preg_replace('#<div class="codebox" title="' . preg_quote($this->user->lang['CODEBOX_PLUS_TITLE']) . '" data-language="(.*?)" data-filename="(.*?)"><p>.*?</p><code>(.*?)</code></div>#msie', "\$this->codebox_template(preg_replace('#\<br\\s*/?\>#msi', '\n', '\$3'), '\$1', '\$2', \$post_id, ++\$part)", $text);
            $event['text'] = $text;
        }
  }
Last edited by Raheem on Mon Feb 13, 2017 11:15 am, edited 1 time in total.

User avatar
AmigoJack
Registered User
Posts: 5588
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: CodeBox Pluss (Syntax Highlighter), Lines Problem.

Post by AmigoJack » Mon Feb 13, 2017 8:18 am

Ugh, I would ask where I downloaded the software from. And this comment looks promising.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

Raheem
Registered User
Posts: 82
Joined: Thu Feb 09, 2017 7:02 pm
Location: Egypt
Contact:

Re: CodeBox Pluss (Syntax Highlighter), Lines Problem.

Post by Raheem » Mon Feb 13, 2017 11:12 am

AmigoJack wrote:
Mon Feb 13, 2017 8:18 am
Ugh, I would ask where I downloaded the software from. And this comment looks promising.
Oh my bad i don't see this. It's working now thanks but can you tell me how to add scroll bar like in the default one?

Strange, code tag in this forum updated? I see now it's have an style it was before just green. So now it's:

Code: Select all

#include <zombie_escape>

// Fowards
enum _:TOTAL_FORWARDS
{
	FORWARD_NONE = 0,
	FORWARD_ROUNDEND,
	FORWARD_HUMANIZED,
	FORWARD_INFECTED,
	FORWARD_ZOMBIE_APPEAR,
	FORWARD_ZOMBIE_RELEASE,
	FORWARD_GAME_STARTED
}
How they do this :P? I think this will be better for me than this extension as i just use one language style only.

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7607
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: CodeBox Pluss (Syntax Highlighter), Lines Problem.

Post by JimA » Mon Feb 13, 2017 11:29 am

This isn't really an extension request, so therefore doesn't really fit in this forum. I'd recommend you create a new issue on Github (where you downloaded it) to let the author have a look. :)
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

Raheem
Registered User
Posts: 82
Joined: Thu Feb 09, 2017 7:02 pm
Location: Egypt
Contact:

Re: CodeBox Pluss (Syntax Highlighter), Lines Problem.

Post by Raheem » Mon Feb 13, 2017 11:48 am

JimA wrote:
Mon Feb 13, 2017 11:29 am
This isn't really an extension request, so therefore doesn't really fit in this forum. I'd recommend you create a new issue on Github (where you downloaded it) to let the author have a look. :)
Yeah so please move this topic to the right section. Also the problem already solved thanks for AmigoJack.
Issue is already opened but the author in-active and the solution also is discussed on github i just miss to read it. Now i can post with style :D.

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7607
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: CodeBox Pluss (Syntax Highlighter), Lines Problem.

Post by JimA » Mon Feb 13, 2017 11:51 am

Raheem wrote:
Mon Feb 13, 2017 11:48 am
Yeah so please move this topic to the right section.
That was kind of my point, we don't have a section for extensions not released on this site. ;)
But I'm happy that you've got your problems resolved regardless.
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

Raheem
Registered User
Posts: 82
Joined: Thu Feb 09, 2017 7:02 pm
Location: Egypt
Contact:

Re: CodeBox Pluss (Syntax Highlighter), Lines Problem.

Post by Raheem » Mon Feb 13, 2017 11:56 am

Hmm, Ok you can move it to the general discussion section better :)

User avatar
aurquiel
Registered User
Posts: 243
Joined: Fri May 15, 2009 1:45 am

Re: CodeBox Pluss (Syntax Highlighter), Lines Problem.

Post by aurquiel » Sat May 13, 2017 7:06 pm

Could some one make it work? In my board works but with issues

Post Reply

Return to “Extension Requests”