[DEV] Syntax Highlighter 1.0.14

Moderator: Moderators

<<

fade2gray

User avatar

Very New Member
Very New Member

Posts: 2

Joined: Thu Jan 13, 2011 6:47 pm

Post Sun Jan 16, 2011 3:34 pm

Re: [DEV] Syntax Highlighter 1.0.14

:adore: Thanks very much for this excellent mod.

For the benefit of anyone else, like myself and ruyi7952, who tries installing with AutoMod and gets the error "The MOD is missing a find matching the action ‘<!-- ul end -->’", you will need to edit the mod's install.xml.

I discovered by reading this, that basically, AutoMod requires the following format in order to perform an '<inline-edit>'.
Syntax: [ Download ] [ Hide ]
  1. <open src="/path/to/filename.ext"> 
  2.     <edit> 
  3.         <comment lang="en">['COMMENT TEXT']</comment> 
  4.         <find>'TEXT TO FIND (1)'</find> 
  5.         <inline-edit> 
  6.             <inline-find>'TEXT TO FIND WITHIN 'TEXT TO FIND (1)''</inline-find> 
  7.             <inline-action type="action-to-perform">'TEXT TO REPLACE/ADD-BEFORE/ADD_AFTER'</inline-action> 
  8.         </inline-edit> 
  9.     </edit> 
  10. </open> 

This is easiest achieved by extracting 'install.xml' from the zip, editing as shown below, then replacing with the edited 'install.xml'.

Find.
Syntax: (original.txt) [ Download ] [ Hide ]
Using XML Syntax Highlighting
                <open src="styles/prosilver/template/bbcode.html">
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- BEGIN ulist_close --></ul>]]></find>
                                <inline-edit>
                                        <inline-action type="after-add"><![CDATA[<!-- ul end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- BEGIN olist_close --></ol>]]></find>
                                <inline-edit>
                                        <inline-action type="after-add"><![CDATA[<!-- ol end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END quote_close -->]]></find>
                                <inline-edit>
                                        <inline-action type="before-add"><![CDATA[<!-- quote end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END b_close -->]]></find>
                                <inline-edit>
                                        <inline-action type="before-add"><![CDATA[<!-- b end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END u_close -->]]></find>
                                <inline-edit>
                                        <inline-action type="before-add"><![CDATA[<!-- u end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END i_close -->]]></find>
                                <inline-edit>
                                        <inline-action type="before-add"><![CDATA[<!-- i end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END color -->]]></find>
                                <inline-edit>
                                        <inline-action type="before-add"><![CDATA[<!-- colour end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END size -->]]></find>
                                <inline-edit>
                                        <inline-action type="before-add"><![CDATA[<!-- size end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                </open>
Parsed in 0.004 seconds, using GeSHi 1.0.8.11

Replace with.
Syntax: (replacement.txt) [ Download ] [ Hide ]
Using XML Syntax Highlighting
                <open src="styles/prosilver/template/bbcode.html">
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- BEGIN ulist_close --></ul>]]></find>
                                <inline-edit>
                                        <inline-find><![CDATA[<!-- BEGIN ulist_close --></ul>]]></inline-find>
                                        <inline-action type="after-add"><![CDATA[<!-- ul end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- BEGIN olist_close --></ol>]]></find>
                                <inline-edit>
                                        <inline-find><![CDATA[<!-- BEGIN olist_close --></ol>]]></inline-find>
                                        <inline-action type="after-add"><![CDATA[<!-- ol end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END quote_close -->]]></find>
                                <inline-edit>
                                        <inline-find><![CDATA[<!-- END quote_close -->]]></inline-find>
                                        <inline-action type="before-add"><![CDATA[<!-- quote end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END b_close -->]]></find>
                                <inline-edit>
                                        <inline-find><![CDATA[<!-- END b_close -->]]></inline-find>
                                        <inline-action type="before-add"><![CDATA[<!-- b end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END u_close -->]]></find>
                                <inline-edit>
                                        <inline-find><![CDATA[<!-- END u_close -->]]></inline-find>
                                        <inline-action type="before-add"><![CDATA[<!-- u end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END i_close -->]]></find>
                                <inline-edit>
                                        <inline-find><![CDATA[<!-- END i_close -->]]></inline-find>
                                        <inline-action type="before-add"><![CDATA[<!-- i end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END color -->]]></find>
                                <inline-edit>
                                        <inline-find><![CDATA[<!-- END color -->]]></inline-find>
                                        <inline-action type="before-add"><![CDATA[<!-- colour end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                        <edit>
                                <comment lang="en"></comment>
                                <find><![CDATA[<!-- END size -->]]></find>
                                <inline-edit>
                                        <inline-find><![CDATA[<!-- END size -->]]></inline-find>
                                        <inline-action type="before-add"><![CDATA[<!-- size end -->]]></inline-action>
                                </inline-edit>
                        </edit>
                </open>
Parsed in 0.005 seconds, using GeSHi 1.0.8.11


Hope this helps. :tright:
I don't code - I just butcher that of others.
<<

fade2gray

User avatar

Very New Member
Very New Member

Posts: 2

Joined: Thu Jan 13, 2011 6:47 pm

Post Sat Jan 22, 2011 4:57 pm

Re: [DEV] Syntax Highlighter 1.0.14

There are some users of phpBB who have their forum integrated with Joomla using Joomla's JFusion extension for user synchronization and frameless integration. If this mod is installed under such circumstances, users will find that clicking on any topic will result in a blank page regardless of whether it contains code. If they find a solution for that, they will then find that the [Download] command looks for bbc_download.php in the root Joomla directory rather than the root phpBB directory.

To rectify the above problems:

Open hook_syntax_highlighter.php for editing.

To fix [Download] command - Find:
Syntax: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
$download_text = ' [ <a href="bbc_download.' . $phpEx . '?p=' . $can_download;
Parsed in 0.022 seconds, using GeSHi 1.0.8.11

Replace with:
Syntax: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
preg_match('/.*\//', $_SERVER['PHP_SELF'], $phpBBdir);
$download_text = ' [ <a href="' . $phpBBdir[0] . 'bbc_download.' . $phpEx . '?p=' . $can_download;
Parsed in 0.025 seconds, using GeSHi 1.0.8.11


To fix blank pages - Find:
Syntax: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
function do_parse(&$item, $key, $options = array())
{
        global $sh_bbcode, $user;
Parsed in 0.026 seconds, using GeSHi 1.0.8.11

Add after:
Syntax: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
        $sh_bbcode = new SyntaxHighlighter();
Parsed in 0.026 seconds, using GeSHi 1.0.8.11

Hope this helps. :tright:
I don't code - I just butcher that of others.
<<

Mortana

Very New Member
Very New Member

Posts: 1

Joined: Thu Feb 10, 2011 9:55 am

Post Thu Feb 10, 2011 11:33 am

Re: [DEV] Syntax Highlighter 1.0.14

Hi,

I installed your plugin, and everything works, except the styling, it won't use the styles :/
http://gyazo.com/adfbb9978ce7f140a213fb3ba50b033a.png

Standard prosilver template, I changed everything what needed to be changed, purged cache and stuff, but still won't show some fancy code block :/
<<

UseLess

User avatar

Village Idiot
Village Idiot

Posts: 272

Joined: Thu Jan 08, 2009 9:57 pm

Location: North East UK

Post Fri Feb 11, 2011 8:03 pm

Re: [DEV] Syntax Highlighter 1.0.14

Greetings,

Have you refreshed the Theme? If you have try refreshing it again and clearing the browser cache.
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
<<

Radek2212

Very New Member
Very New Member

Posts: 7

Joined: Tue Mar 01, 2011 2:35 am

Post Tue Mar 01, 2011 1:50 pm

Re: [DEV] Syntax Highlighter 1.0.14

Hi. I have problem with 1.0.14 that was not present in 1.0.12:

I install 1.0.12 and it worked fine, then i create simple BBCode Tag:
  Code:
[cpp]{INTTEXT}[/cpp]
without entering anything into "HTML code" window. And it worked fine: i can select some code in post, use
  Code:
[cpp][/cpp]
and it work as i would use
  Code:
[syntax="cpp"][/syntax]


Now it don't work anymore: i can still use
  Code:
[syntax="cpp"][/syntax]
but not
  Code:
[cpp][/cpp]
- it's much easy to use i think.

Is there something that i can do to get
  Code:
[cpp][/cpp]
back to working :?:
<<

UseLess

User avatar

Village Idiot
Village Idiot

Posts: 272

Joined: Thu Jan 08, 2009 9:57 pm

Location: North East UK

Post Tue Mar 01, 2011 2:58 pm

Re: [DEV] Syntax Highlighter 1.0.14

Greetings,

In the MODs 'contrib' dir read this file 'lang_as_bbcode_tag.txt' ;)
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
<<

Radek2212

Very New Member
Very New Member

Posts: 7

Joined: Tue Mar 01, 2011 2:35 am

Post Tue Mar 01, 2011 3:37 pm

Re: [DEV] Syntax Highlighter 1.0.14

I'ts work \o/ Thank you !!
<<

Radek2212

Very New Member
Very New Member

Posts: 7

Joined: Tue Mar 01, 2011 2:35 am

Post Fri Mar 11, 2011 2:11 pm

Re: [DEV] Syntax Highlighter 1.0.14

Hi :!:
One of the user found dangerous bug in this mod:

http://www.phpbb.com/customise/db/mod/syntax_highlighter/support/dangerous_bug_in_this_mod-t_85288

Can you tell me if it is already fixed :?:
<<

UseLess

User avatar

Village Idiot
Village Idiot

Posts: 272

Joined: Thu Jan 08, 2009 9:57 pm

Location: North East UK

Post Sat Mar 12, 2011 2:01 pm

Re: [DEV] Syntax Highlighter 1.0.14

Greetings,

It's not fixed, but as I cannot get a post made using this:
  Code:
[img]http://jabko.net/nenalezen"onError="alert('Vitejte-v-tomto-tematu');document.getElementById('page-header').style.background='DodgerBlue';document.body.style.background='gold';document.getElementById('reklama-box').style.display='none';document.getElementById('logo').style.background='url(http://www.google.cz/intl/en_com/images/logo_plain.png)';document.getElementById('logo').innerHTML='';document.getElementById('logo').style.height='110px';document.getElementById('logo').style.width='258px';document.getElementById('logo').href='http://www.google.cz/';document.getElementById('logo').title='Prejit-na-Google-vyhledavac';document.getElementById('reklama-dalsi_partneri').style.display='none';document.getElementById('google').style.display='none';"style="display:none;height:0[/img]

without getting a message informing me It was not possible to determine the dimensions of the image. using phpBB 3.0.7-pl1 (which is the version I'm running on my test forum) then it'll remain as it is as I just don't have the time at present to resolve the issue.
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
<<

Radek2212

Very New Member
Very New Member

Posts: 7

Joined: Tue Mar 01, 2011 2:35 am

Post Sun Mar 13, 2011 12:21 pm

Re: [DEV] Syntax Highlighter 1.0.14

Ok, i understand. On my 3.0.8 test forum i was able to make post with this code. User can eg: change forum logo to his own etc. Let user know when you will fix this.
PreviousNext

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.