Cool Codes (Syntax Highlighter)
Author Message
This plugin is problematic under PHP 7.x or newer.

This is pretty much a MyBB 1.4/1.6 port of my Syntax Highlighter for MyBB 1.2.
I've also added line numbers to this one.

To resolve speed issues, you may be interested in my preparser cache plugin.

See the following thread for examples of what this looks like: http://mybbhacks.zingaburga.com/showthread.php?tid=33 (note, no code edits required for this version of the plugin)
(This post was last modified: 02-28-2021 08:45 PM by ZiNgA BuRgA.)
Find all posts by this user
Quote this message in a reply
Download: coolcode-1.26.7z (14.52 KB)
Plugin Version: 1.26
Last Updated: 11-24-2014, 10:39 PM

Downloads: 1,272
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: GPLv3
Uploader: ZiNgA BuRgA
MSTF Offline
Junior Member
**
Posts: 1
Joined: Apr 2012
Post: #71
RE: Cool Codes (Syntax Highlighter)
Thank you for the useful plugin!
But I have an issue with it as I am using it on a Dari forum which is a RTL language. As you can see from the shot the code also appears from right to left which I really don't want this to happen.

[Image: 67808286705583334816.png]

Any idea how to fix it, I really appreciate.
04-20-2012 05:59 PM
Find all posts by this user Quote this message in a reply
ksr Offline
Junior Member
**
Posts: 5
Joined: Aug 2012
Post: #72
RE: Cool Codes (Syntax Highlighter)
How to use this plugin. I didn't found any instructions on how to use, Can somebody help me?
02-28-2013 10:31 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #73
RE: Cool Codes (Syntax Highlighter)
Check the links in the first post.  You can always view the underlying code for any post by quoting it.

My Blog
03-01-2013 10:58 AM
Find all posts by this user Quote this message in a reply
Xilver266 Offline
Junior Member
**
Posts: 1
Joined: Mar 2013
Post: #74
RE: Cool Codes (Syntax Highlighter)
Can you add C# to supported languages?

It would be nice Biggrin
03-17-2013 07:41 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #75
RE: Cool Codes (Syntax Highlighter)
That's must too bad!!!!!!!!!!!!!

My Blog
04-20-2013 05:11 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #76
RE: Cool Codes (Syntax Highlighter)
Fixed issue reported by Midori (who deleted the post).
Apologies for being so late, I forgot to get around and look at it.
This can be fixed by editing inc/highlighter.php, and finding:

PHP Code:
function html_highlight(&$code)

replacing with

PHP Code:
function html_highlight($code)


Thanks to Midori for reporting!


I've also updated the package to v1.25 which fixes the above.

My Blog
(This post was last modified: 09-14-2013 03:00 PM by ZiNgA BuRgA.)
09-14-2013 02:59 PM
Find all posts by this user Quote this message in a reply
Midori Offline
Junior Member
**
Posts: 3
Joined: Apr 2013
Post: #77
RE: Cool Codes (Syntax Highlighter)
Thanks for your answering  Yipi
another problem for me .
Example:
when i insert below codes in code section

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
<div class="wrapper">
<div class="header"></div>
<div class="nav-container">
<div class="nav">
<ul>
<li><a href="#">home</a></li>
<li><a href="#">forum</a></li>
<li><a href="#">upload</a></li>
<li><a href="#">contact</a></li>
</ul>
</div>
</div>


Class code disappear  (class="*****") , same below

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
<div>
<div></div>
<div>
<div>
<ul>
<li><a href="#">home</a></li>
<li><a href="#">forum</a></li>
<li><a href="#">upload</a></li>
<li><a href="#">contact</a></li>
</ul>
</div>
</div>


I have ( class="tooltip" ) in my forum. maybe this is problem for me.Unlove
A Solution for me:
If i insert <div class ="wrapper"> (space after class ) Everything will be O.K.

(This post was last modified: 11-16-2013 06:36 AM by Midori.)
11-15-2013 05:50 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #78
RE: Cool Codes (Syntax Highlighter)
I guess it depends on what parser replacements you have activated?
I don't think this plugin does anything with class="tooltip"



HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
<div class="wrapper">
<div class="header"></div>
<div class="nav-container">
<div class="nav">
<ul>
<li><a href="#">home</a></li>
<li><a href="#">forum</a></li>
<li><a href="#">upload</a></li>
<li><a href="#">contact</a></li>
</ul>
</div>
</div>

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
<div class="wrapper">
<div class="header"></div>
<div class="nav-container">
<div class="nav">
<ul>
<li><a href="#">home</a></li>
<li><a href="#">forum</a></li>
<li><a href="#">upload</a></li>
<li><a href="#">contact</a></li>
</ul>
</div>
</div>

XML Code
1
2
3
4
5
6
7
8
9
10
11
12
<div class="wrapper">
<div class="header"></div>
<div class="nav-container">
<div class="nav">
<ul>
<li><a href="#">home</a></li>
<li><a href="#">forum</a></li>
<li><a href="#">upload</a></li>
<li><a href="#">contact</a></li>
</ul>
</div>
</div>

Code:
1
2
3
4
5
6
7
8
9
10
11
12
<div class="wrapper">
<div class="header"></div>
<div class="nav-container">
<div class="nav">
<ul>
<li><a href="#">home</a></li>
<li><a href="#">forum</a></li>
<li><a href="#">upload</a></li>
<li><a href="#">contact</a></li>
</ul>
</div>
</div>


My Blog
12-01-2013 06:00 PM
Find all posts by this user Quote this message in a reply
FBI Offline
Junior Member
**
Posts: 19
Joined: Apr 2010
Post: #79
RE: Cool Codes (Syntax Highlighter)
this is still cool plugin ever,
try this demo link with various code

Brand New Portal from MyBB Indonesia  to get local Bahasa (language) support.
My Unique Plugin here Smile
05-09-2014 01:18 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #80
RE: Cool Codes (Syntax Highlighter)
v1.26: MyBB 1.8 compatibility fix

My Blog
11-24-2014 10:15 PM
Find all posts by this user Quote this message in a reply


Forum Jump: