Updated Syntaxhighlighter

Update #1: hmmmm, stupid but I write these post sometimes weeks ahead…. and this one caught up on me… The new version of SyntaxHighlighter Evolved has ActionScript support.. 🙂
Update #2: I could remove everything below, but I’m keeping this here, perhaps someone can use it…. and it took some time to write, so I really can’t kill my darlings.

A little change I made to the new updated plugin:
find the plugin-folder “syntaxhighlighter” and add the next line to “syntaxhighlighter.php”
[as highlight=”1,3″]
‘as’ => ‘as3’,
‘as3’ => ‘as3’,
‘actionscript’ => ‘as3’,
‘actionscript3’ => ‘as3’,
[/as]
and find in the plugin-folder “syntaxhighlighter”, the folder “scripts” and change the next line to “shBrushAS3.js”
[as wrapper=”true”]
// SyntaxHighlighter.brushes.AS3.aliases = [‘actionscript3’, ‘as3’]; // old line and the bottom of the .js file
SyntaxHighlighter.brushes.AS3.aliases = [‘actionscript3′,’actionscript’, ‘as3’, ‘as’]; // new line
[/as]

the new syntaxhighlighter only uses “as3” and “actionscript3“, and I just changed all my post to “as

Update #3: and update the css, that made the code not wrap….
I removed “white-space: pre;” form “code” and now it wraps:

code  { font-family: "Courier New", Courier, monospace; font-size: 1.2em; /*white-space: pre;*/ color: Gray; }

Today I updated my SyntaxHighlighter JavaScript package by Alex Gorbatchev and it was not easy…

I have a syntax highlighter installed on my blog to show my ActionScript source code in a nice way.
But the first time I installed it, I choose a WordPress plugin which isn’t add to WordPress Plugin Directoryand doesn’t appear to be update.
And if I remember correctly, it didn’t work as it should and I had to add ActionScript. Read my previous decision here.
So I had to upgrade to SyntaxHighlighter Evolved which of course came with some upgrading issues created by my previous install.

First problem: write ActionScript.
ActionScript is not default included in the Syntaxhighter, and you will be advised to use [ javascript ] tag, which is a good advice since AS is almost javascript. It would make your live easier if you choose this option.
But as in my last installment of syntaxhighlighter I want to use Actionscript highlighting.
So there we go:
To do that you need an Actionscript brush. I found two of them: cptloadtest.com has one but it looks like its more for AS2,
and yourpalmark.com which is also the one I choose, because I used his version also with my previous installment and it’s for AS3.

This is what you need to do: install SyntaxHighlighter and if you choose to use [ javascript ]
your done. I was not done yet, so lets continue… Download the shBrushAS3.zip, extract and place the shBrushAS3.js in the correct folder on the server (in my case .../wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts). Now you need to change some code in the WordPress plugin:
You can do this in WordPress itself if you have writing permission set, or you can edit the php file on your desktop…
you need to add the highlighted code

// Register brush scripts
wp_register_script( 'syntaxhighlighter-core', plugins_url('syntaxhighlighter/syntaxhighlighter/scripts/shCore.js'), array(), $this->agshver );
wp_register_script( 'syntaxhighlighter-brush-actionscript3', plugins_url('syntaxhighlighter/syntaxhighlighter/scripts/shBrushAS3.js'), array('syntaxhighlighter-core'), $this->agshver);

and

// Create list of brush aliases and map them to their real brushes
$this->brushes = apply_filters( 'syntaxhighlighter_brushes', array(
	'as'       => 'actionscript3',
	'as2'       => 'actionscript3',
	'as3'       => 'actionscript3',
	'actionscript'       => 'actionscript3',
	'bash'       => 'bash',

and now you are ready to go.

I had to change some other stuff ([ source:as ]...[ /source ] into [ as ]...[ /as ] ) and it seems that my css is not playing nice with syntaxhighlighter. hmmmm this is more work then I thought it would be.

I had to deactivate one plugin: autoescape , it didn’t play nice with SyntaxHightlighter. I didn’t use it anymore, and the combination generated gibberish.

Headers broken again: sIFR update

My Flash rendered headers didn’t work after my host transferred my site to another server.
Well in retrospect it’s easy to blame it on the host (sorry guys), but the fault was/is simpler.

I had this problem before : firefox and sifr dont play nice, and just as last time I blamed the wrong person again: not my host but the new Flash Player version 10 killed my sIFR headers…

That would explain why I see my headers at home but not at my work (I didn’t upgrade to Flash Player 10 at home).

The solution is very simple: visit http://novemberborn.net/sifr/2.0.7 and download the latest version of sifr (2.0.7).

Find your sIFR javascript file and check if it’s 2.0.5 or higher:

If you are upgrading from sIFR 2.0.5 or 2.0.6, you must upgrade the sifr.js JavaScript file.

and overwrite it…

And that’s it.
So do you recognize this situation: update the Flash Player recently/ your sIFR headers work on one computer but not on another/ sIFR works in IE and not in Firefox (or the other way around)/ Flash headers are now html headers …. update your sIFR!

For the people that don’t know sIFR:

sIFR is meant to replace short passages of plain browser text with text rendered in your typeface of choice, regardless of whether or not your users have that font installed on their systems. It accomplishes this by using a combination of JavaScript, CSS, and Flash, which renders the font. It degrades gracefully if Flash is not present. sIFR 3 is open source and licensed under the CC-GNU LGPL.

And I use the WordPress plugin CG-FlashyTitles.

Upgrading WordPress 2.6

Today I upgraded to WordPress 2.6.

I followed the instructions how to upgrading WordPress and this has never failed… till today 🙁 .

This is what happened: I upgraded and everything was oke. I could login, the upgrading of the database worked fine. I could see my post, pages, etc, etc in the admin and edit them.
So I checked out my homepage: and everything was as it should: mission completed…. NOT!! 🙁

Every link to another page didn’t work, you can navigate by “older post” but not with “recent posts” or the title of the post.

It took me some time to find the correct way to search about this problem: it has something to do with the permalinks. In all cases, these people have permalink structures that contain “index.php”.
Example: “http://www.matthijskamstra.nl/blog/index.php/2008/07/09/drukks-the-selfish-series-drukkgrumm/

Still no idea? Go to your “[your WordPress install]/wp-admin/options-permalink.php” (Customize Permalink Structure) and you will probable see that you don’t have the default setting ( http://www.matthijskamstra.nl/blog/?p=123 :: no “index.php”) but have chosen something else (in my case: [x] Day and name — http://www.matthijskamstra.nl/blog/index.php/2008/07/16/sample-post/ )

I found the explanation here: 2.6 Permalink issues with “index.php” and in my case the second option worked.

2. If you need/want the index.php to be there, then on the Settings->Permalinks screen, add some values in for the category and tag bases. The words “category” and “tag” will do just fine. As long as they are not blank, this should work around the bug.

This is bug in WordPress 2.6, read more about it here: http://trac.wordpress.org/ticket/7306. It will be fixed in the next version (2.6.1)

But for now you can make your WordPress work again: visit your “[your WordPress install]/wp-admin/options-permalink.php” (Customize Permalink Structure) and fill in the two boxes at the bottom with “category” and “tag

happy blogging