[ABD] bbGeSHi - a better syntax highlighter

Any abandoned MODs will be moved to this forum.

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

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
cillinz
Registered User
Posts: 68
Joined: Sun Jan 16, 2005 11:29 am

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by cillinz »

oh really, sorry, my fault ;)
Thanks.
stotis.net <- Lithuanian the best.
cillinz
Registered User
Posts: 68
Joined: Sun Jan 16, 2005 11:29 am

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by cillinz »

I found a little bug. When line number is even number it colors all line in grey, but not only line number.
stotis.net <- Lithuanian the best.
DarrenSW
Registered User
Posts: 58
Joined: Fri May 11, 2007 11:50 pm
Location: Sweden
Contact:

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by DarrenSW »

cillinz wrote:I found a little bug. When line number is even number it colors all line in grey, but not only line number.
You have an example I can look at because I don't have that bug.
cillinz
Registered User
Posts: 68
Joined: Sun Jan 16, 2005 11:29 am

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by cillinz »

stotis.net <- Lithuanian the best.
DarrenSW
Registered User
Posts: 58
Joined: Fri May 11, 2007 11:50 pm
Location: Sweden
Contact:

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by DarrenSW »

Ahhh, that one. That's not a bug but GeSHi feature called fancy line numbers. :D

Quick fix:

Code: Select all

--------- OPEN -------------
includes/geshi.php
--------- FIND -------------
var $line_style1 = 'font-family: \'Courier New\', Courier, monospace; color: black; font-weight: normal; font-style: normal;';
--------- REPLACE WITH -------------
var $line_style1 = 'padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;';
--------- FIND -------------
var $line_style2 = 'font-weight: bold;';
--------- REPLACE WITH -------------
var $line_style2 = 'padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;';
--------- OPEN -------------
styles/prosilver/template/forum_fn.js
--------- FIND -------------
row.setAttribute("style", "border-left: none;");
--------- REPLACE WITH -------------
row.setAttribute("style", children[b].getAttribute("style") + "; border-left: none;");
--------- FIND -------------
row.setAttribute("className", dds[b].getAttribute("className"));
--------- AFTER, ADD -------------
row.setAttribute("style", dds[b].getAttribute("style") + "; border-left: 1px solid #999;");
--------- SAVE ALL EDITED FILES -------------
cillinz
Registered User
Posts: 68
Joined: Sun Jan 16, 2005 11:29 am

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by cillinz »

Thanks, now it looks realy nice :)
stotis.net <- Lithuanian the best.
TRICHES.FR
Registered User
Posts: 75
Joined: Sat Jun 09, 2007 5:23 pm

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by TRICHES.FR »

Can you put a demo so we can see "how much better it is" ;)
DarrenSW
Registered User
Posts: 58
Joined: Fri May 11, 2007 11:50 pm
Location: Sweden
Contact:

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by DarrenSW »

TRICHES.FR wrote:Can you put a demo so we can see "how much better it is" ;)
Much, much better. :lol: Than phpBB own highlighter of course.

Sorry, my 2.x isn't yet converted online, just localy on my development computer. Feel free to visit cillinz board and this topic for a small preview.
cillinz
Registered User
Posts: 68
Joined: Sun Jan 16, 2005 11:29 am

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by cillinz »

Demo:
http://stotis.net/siukslynas-f6/bbgeshi ... t1014.html
When entering code:

Code: Select all

[code=mirc]on *:text:*:#:{
  if $istok(!mods !modlist !admins,$1,32) {
    if (!$2) { mod_list }
    else { mod_nick $2 }
  }
}
[/code]
i got error:
[phpBB Debug] PHP Notice: in file /includes/geshi.php on line 2097: preg_replace() [function.preg-replace]: Unknown modifier 't'
[phpBB Debug] PHP Notice: in file /includes/geshi.php on line 2097: preg_replace() [function.preg-replace]: Unknown modifier 't'
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4353: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3724)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4355: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3724)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4356: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3724)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4357: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3724)
stotis.net <- Lithuanian the best.
DarrenSW
Registered User
Posts: 58
Joined: Fri May 11, 2007 11:50 pm
Location: Sweden
Contact:

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by DarrenSW »

Thanks cillinz. :)
cillinz wrote:When entering code:

Code: Select all

[code=mirc]on *:text:*:#:{
  if $istok(!mods !modlist !admins,$1,32) {
    if (!$2) { mod_list }
    else { mod_nick $2 }
  }
}
[/code]
i got error:...
Hmmm, a core GeSHi bug it seams. I'll take a look on that and see if I can find something.
TRICHES.FR
Registered User
Posts: 75
Joined: Sat Jun 09, 2007 5:23 pm

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by TRICHES.FR »

Thanks !! Looks great !! Can't wait for the final version :D
cillinz
Registered User
Posts: 68
Joined: Sun Jan 16, 2005 11:29 am

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by cillinz »

They had added to mirc.php from last version:

Code: Select all

3 => array(
			'/action','/ajinvite','/alias','/amsg','/ame','/anick','/aop',
			'/auser','/avoice','/auto','/autojoin','/away','/background','/ban',
			'/beep','/channel','/clear','/clearall','/clipboard','/close',
			'/closemsg','/color','/copy','/creq','/ctcp','/ctcpreply','/ctcps',
			'/dcc','/dde','/ddeserver','/debug','/describe','/disable',
			'/disconnect','/dlevel','/dll','/dns','/dqwindow','/ebeeps','/echo',
			'/editbox','/emailaddr','/enable','/events','/exit','/filter',
			'/findtext','/finger','/flash','/flood','/flush','/flushini',
			'/font','/fsend','/fserve','/fullname','/ghide','/gload','/gmove',
			'/gopts','/gplay','/gpoint','/gqreq','/groups','/gshow','/gsize',
			'/gstop','/gtalk','/gunload','/guser','/help','/hop','/ignore',
			'/invite','/join','/kick','/linesep','/links','/list','/load',
			'/loadbuf','/localinfo','/log','/me','/mdi','/mkdir','/mnick',
			'/mode','/msg','/names','/nick','/noop','/notice','/notify',
			'/omsg','/onotice','/part','/partall','/pdcc','/perform','/ping',
			'/play','/pop','/protect','/pvoice','/qmsg','/qme','/query',
			'/queryrn','/quit','/raw','/remini','/remote','/remove','/rename',
			'renwin','/resetidle','/rlevel','/rmdir','/run','/ruser','/save',
			'/savebuf','/save','/saveini','/say','/server','/showmirc','/sline',
			'/sound','/speak','/splay','/sreq','/strip','/time',
			'/timers','/timestamp','/titlebar','/tnick','/tokenize','/topic',
			'/ulist','/unload','/updatenl','/url','/uwho','window','/winhelp',
			'/write','/writeini','/who','/whois','/whowas'
			) 
I think this makes that error.. Something with preg_replace, because that line in geshi.php looks:

Code: Select all

                    $stuff_to_parse = preg_replace( "/(" . str_replace('/', '\/', $regexp) . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse);
Please take a look at that, i am not able to fix this litle bug, my PHP experience is to little :)
stotis.net <- Lithuanian the best.
DarrenSW
Registered User
Posts: 58
Joined: Fri May 11, 2007 11:50 pm
Location: Sweden
Contact:

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by DarrenSW »

cillinz wrote:When entering code:

Code: Select all

[code=mirc]on *:text:*:#:{
  if $istok(!mods !modlist !admins,$1,32) {
    if (!$2) { mod_list }
    else { mod_nick $2 }
  }
}
[/code]
i got error:...
Quick fix:

Code: Select all

------ OPEN ------------------------------------
includes/geshi/mirc.php
------ FIND ------------------------------------
6 => '\/timer(?!s\b)[0-9a-zA-Z_]+',
------ REPLACE WITH ------------------------------------
6 => '/timer(?!s\b)[0-9a-zA-Z_]+',
------ SAVE FILE ------------------------------------
cillinz
Registered User
Posts: 68
Joined: Sun Jan 16, 2005 11:29 am

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by cillinz »

Fixed. Thanks again :)
I think everything is working now.
Keep up good working :)
stotis.net <- Lithuanian the best.
cillinz
Registered User
Posts: 68
Joined: Sun Jan 16, 2005 11:29 am

Re: [DEV] bbGeSHi - a better syntax highlighter

Post by cillinz »

Ok, i were testing this mod and when code is more than 99 lines first number a little bit gone..
Look at http://stotis.net/siukslynas-f6/bbgeshi ... tml#p18157
Last code, where is long delphi.
I think this is something with padding..
stotis.net <- Lithuanian the best.
Locked

Return to “[3.0.x] Abandoned MODs”