[DEV] Syntax Highlighter 1.0.15

Moderator: Moderators

<<

UseLess

User avatar

Village Idiot
Village Idiot

Posts: 272

Joined: Thu Jan 08, 2009 9:57 pm

Location: North East UK

Post Tue May 03, 2011 10:47 am

Re: [DEV] Syntax Highlighter 1.0.15

Greetings,

Tried this at work using IE Version 8.0.7600.16385IC and get no javascript errors even with the option to 'Display a notification about every script error' turned on.
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
<<

Graham

Very New Member
Very New Member

Posts: 5

Joined: Wed Apr 27, 2011 1:12 pm

Post Tue May 03, 2011 12:09 pm

Re: [DEV] Syntax Highlighter 1.0.15

Thanks for your time with this issue, I appreciate it!

Did you test my site with no errors reported, or this one? I'm still getting the error in IE and FF. Which I find strange as in the past usually more than one error will appear for conflicts.

Any recommendations how to tackle this? I have a sandbox copy of the site which you're more than welcome to use/modify.
<<

UseLess

User avatar

Village Idiot
Village Idiot

Posts: 272

Joined: Thu Jan 08, 2009 9:57 pm

Location: North East UK

Post Tue May 03, 2011 12:40 pm

Re: [DEV] Syntax Highlighter 1.0.15

Greetings,

Tried it on this site, just tried yours and I get the error in IE which is really strange. I'm wondering if it's got anything to do with the order the scripts are loaded in...?
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
<<

randomessence

Very New Member
Very New Member

Posts: 1

Joined: Fri May 06, 2011 1:53 am

Post Sun May 08, 2011 6:33 am

Re: [DEV] Syntax Highlighter 1.0.15

Syntax: [ Download ] [ Hide ]
  1. mkdir -p ~/.irssi/scripts/autorun 
  2. cd ~/.irssi/scripts 
  3. wget -O autodl-irssi.zip http://sourceforge.net/projects/autodl- ... p/download 
  4. unzip -o autodl-irssi.zip 
  5. rm autodl-irssi.zip 
  6. cp autodl-irssi.pl autorun/ 
  7. mkdir -p ~/.autodl 
  8. touch ~/.autodl/autodl.cfg 
  9. cd 


on my board this url is getting shortened no matter what format i chose ,css, php, ini, etc. using phpbb3 with a few mods, but i get the exact same result here as i do on my board so i just want to know how to make this stop messing with the url


  Code:
mkdir -p ~/.irssi/scripts/autorun
cd ~/.irssi/scripts
wget -O autodl-irssi.zip http://sourceforge.net/projects/autodl-irssi/files/autodl-irssi-v1.31.zip/download
unzip -o autodl-irssi.zip
rm autodl-irssi.zip
cp autodl-irssi.pl autorun/
mkdir -p ~/.autodl
touch ~/.autodl/autodl.cfg
cd


how do i make it like this?

edit: you know what i figured it out, it is not your mod but PHPbb3 itself parsing urls . I had to select the "do no automatically parse urls" before i submit my posts (in options below the submit button). I leave the question though because it was not immediately oblivious that the forum itself was messing with the url. Maybe it will help someone else.
<<

wide_load

Very New Member
Very New Member

Posts: 2

Joined: Thu May 05, 2011 5:23 pm

Post Sun May 15, 2011 12:37 pm

Re: [DEV] Syntax Highlighter 1.0.15

hey,

I use this mod on my forum, it seems that the bug mentioned here http://www.phpbb.com/customise/db/mod/s ... od-t_85288 is still present.

Any ideas how it can be fixed ?
<<

matthew9090

Very New Member
Very New Member

Posts: 1

Joined: Sun May 15, 2011 11:57 am

Post Sun May 15, 2011 2:38 pm

Re: [DEV] Syntax Highlighter 1.0.15

What is the screen supposed to look like when you post because mine looks like the 1 in this forum. i need it so it shows the languages at the top aswell
<<

UseLess

User avatar

Village Idiot
Village Idiot

Posts: 272

Joined: Thu Jan 08, 2009 9:57 pm

Location: North East UK

Post Sun May 15, 2011 4:32 pm

Re: [DEV] Syntax Highlighter 1.0.15

Greetings,

1st post updated with a fixed version to update simply upload the syntax_highligher hook file, after setting any switches you want turned on.

As always let me know if there are any problems ... ;)

Using the 'syntax' tag on it's own will not show the language you need to specify which lang to use examples:
  Code:
[syntax]this is
just some text i want line
numbers on[/syntax]

the above will result in:
Syntax: [ Download ] [ Hide ]
  1. this is 
  2. just some text i want line 
  3. numbers on 

  Code:
[syntax lang=php]<?php
/*
* Display the PHP Info page
*/

phpinfo();

?>[/syntax]

the above will result in:
Syntax: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
<?php
/*
* Display the PHP Info page
*/


phpinfo();

?>
Parsed in 0.021 seconds, using GeSHi 1.0.8.11
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
<<

wide_load

Very New Member
Very New Member

Posts: 2

Joined: Thu May 05, 2011 5:23 pm

Post Sun May 15, 2011 4:37 pm

Re: [DEV] Syntax Highlighter 1.0.15

Great job !

thanks for getting this fixed so quickly.
<<

UseLess

User avatar

Village Idiot
Village Idiot

Posts: 272

Joined: Thu Jan 08, 2009 9:57 pm

Location: North East UK

Post Sat May 21, 2011 12:05 pm

Re: [DEV] Syntax Highlighter 1.0.15

Greetings,

Found a solution to the problem posted above by randomessence to try it:

Open: includes/hooks/hook_syntaxhighlighter.php

Find:
Syntax: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
        /**
         * Undo phpBB URLs
         *
         * @param string $message
         * @returns string $message with URLs or email addresses un-phpBB'd
         */

        function undo_phpbb_urls($message)
        {
                // Remove the <!-- [lmve] --><a ... > link </a><!-- [lmve] --> added by phpBB
                // And replace it with the URL or email address...
                $search = "/(<\!-- . -->)(<a(.*?)\>(.*?)<\/a>)(<\!-- . -->)/si";
                $replace = "\\4";
                $message = preg_replace($search, $replace, ' ' . $message . ' ');
                $message = substr($message, 1, strlen($message) - 2);
                return $message;
        }
Parsed in 0.025 seconds, using GeSHi 1.0.8.11

Replace it with:
Syntax: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
        /**
         * Undo phpBB URLs
         *
         * @param string $message
         * @returns string $message with URLs or email addresses un-phpBB'd
         */

        function undo_phpbb_urls($message)
        {
                // Remove the <!-- [lmve] --><a ... > link </a><!-- [lmve] --> added by phpBB
                // And replace it with the URL or email address...
                $search = "/(<\!-- [lmve] -->)(<[a](.*?)>(.*?)<\/[a]>)(<\!-- [lmve] -->)/si";
                $str_remove = array('class="postlink"', 'href="', 'rel="nofollow"', 'mailto:', 'onclick="this.target=\'_blank\';"', '"', ' ');
                preg_match_all($search, $message, $matches, PREG_SET_ORDER);

                if( sizeof($matches) )
                {
                        $str_search = array();
                        $replace = array();
                        foreach($matches as $key => $value)
                        {
                                $str_search[$key] = $value[0];
                                $replace[$key] = str_replace($str_remove, '', $value[3]);
                        }
                }
                else
                {
                        $replace = "\\3";
                        $replace = str_replace($str_remove, '', $replace);
                }
                if( is_array($replace) )
                {
                        $tmp = str_replace($str_search, $replace, ' ' . $message . ' ');
                }
                else
                {
                        $tmp = preg_replace($search, $replace, ' ' . $message . ' ');
                }
                $message = substr($tmp, 1, strlen($message));
                return $message;
        }
Parsed in 0.029 seconds, using GeSHi 1.0.8.11


[edit] Note this removal only works when a language is specified or put another way when GeSHi is used.
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
Previous

Return to phpBB 3 MODs [Developement]

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for blacklist.org.