We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Code Highlighter Extension

Development and Programming

Jason Bullard's avatar
Jason Bullard
55 posts
17 years ago
Jason Bullard's avatar Jason Bullard

Thanks to vinnyio for taking a look at the code he found a problem. I forgot to add the & to $this which caused these errors. I am also taking a look at the overall layout right now and are in the process of making some major updates. Just things that I noticed after taking a deeper look into the actual code.

Once I get all this done I will post another build. 😊

       
Jason Bullard's avatar
Jason Bullard
55 posts
17 years ago
Jason Bullard's avatar Jason Bullard

Hey guys. Do ya’ll like the way this groups multi-line items together?

http://www.codingdesigns.net/index.php

Not really sure if it should be like that or if people would rather see it line by line like before.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
17 years ago
John Henry Donovan's avatar John Henry Donovan

I for one prefer it that way. Adds more structure to it.

       
Jason Bullard's avatar
Jason Bullard
55 posts
17 years ago
Jason Bullard's avatar Jason Bullard

I agree. Just adding some final touches to the overall layout for initial display and that will be done. Then it is just a matter of making the language files.

       
Jason Bullard's avatar
Jason Bullard
55 posts
17 years ago
Jason Bullard's avatar Jason Bullard

Okay. Here is the updated version. Couple of quick things.

  1. Replace the old style with the new style.

    • Uses alternating row colors, a table, and XHTML Validated layout
  2. Now uses $SESS->cache to hold certain data (i.e. code blocks and matched highlighted code) - faster than before.

  3. It also uses typogrphy_parse_start and end. It replaces the code blocks with a unique id and then after all parsing is done goes through and highlights and outputs the results.

Let me know if you have any issues.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
17 years ago
John Henry Donovan's avatar John Henry Donovan

Getting an error here

Warning: Invalid argument supplied for foreach() in /extensions/ext.ignite.php on line 127
       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
17 years ago
John Henry Donovan's avatar John Henry Donovan

K it works on my clean template so must be a plugin interferring with it. Error appears in control panel also

       
Jason Bullard's avatar
Jason Bullard
55 posts
17 years ago
Jason Bullard's avatar Jason Bullard

Interesting. That is the new $SESS->cache method. Let me look into that class some more. I may need to initialize something before doing anything with it.

       
Jason Bullard's avatar
Jason Bullard
55 posts
17 years ago
Jason Bullard's avatar Jason Bullard

It might be. If something is clearing the cache then that could cause an issue. Maybe I should just leave it in my own array. I just noticed it was a little faster when I store the values there compared to my own.

       
Jason Bullard's avatar
Jason Bullard
55 posts
17 years ago
Jason Bullard's avatar Jason Bullard

Here is what I am going to be working on for the next release.

  1. User can choose whether to use tables, divs, or lists.
  2. User can choose to insert expand/collapse url’s
  3. User can choose to insert copy url

I am not sure about the third one because it requires the flash clipboard script and I really do not want to go that route unless it is requested.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
17 years ago
John Henry Donovan's avatar John Henry Donovan

K I eliminated all the other plugins and extensions installed as causing the problem. The weblog I am using has two fields. One for summary and one for body. I add my text and code I need highlighted to the body field and all is grand and it renders fine. But if I add any data to the summary field then thats when I get the error above. Head wreck?

EDIT: Yes confirmed that error apears for every field that does not have the highlighter code inserted.

       
Jason Bullard's avatar
Jason Bullard
55 posts
17 years ago
Jason Bullard's avatar Jason Bullard

Can you give me examples of what you have posted in each field. I am not getting this error not matter if I put code or just text into any field.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
17 years ago
John Henry Donovan's avatar John Henry Donovan

In the summary field I just added ‘sdfsdfsdfsdf’ text and nothing else. Formatting is set to < br> or none And in the body field I have

[ code lang='php' line_start='2']
<?php
echo “test”;
?>
[ /code]

So nothing odd there

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
17 years ago
John Henry Donovan's avatar John Henry Donovan
I am not getting this error not matter if I put code or just text into any field.

I am guessing you have error reporting on?

       
Jason Bullard's avatar
Jason Bullard
55 posts
17 years ago
Jason Bullard's avatar Jason Bullard

I’m not getting that error at all. Does it happen if you use XHTML?

       
1 2 3

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.