GeSHi Renderer & Proxy Classes for b2 (evolution)

Well, very inspired by Aral Balkan yesterday, got straight in Dreamweaver and started following the instructions, until I found I only had one of the files he had. I didn’t realize b2evolution was not infact b2/cafelog, it has changed considerably, ever…

Well, very inspired by Aral Balkan yesterday, got straight in Dreamweaver and started following the instructions, until I found I only had one of the files he had. I didn’t realize b2evolution was not infact b2/cafelog, it has changed considerably, everything is now very OO. Thankfully now there’s no need for hacks to the source (I hope).

Now you have to create a PHP sub-class of Renderer, and get that to do some preg_match’ing of it’s own. My PHP hat is still fairly new, but I’ll try and go through what I had to do to get it all working….you can just download it if you feel lazy.

First of all, GeSHi will (at present) only work on PHP 4 and some PHP 5 installations (specifics yet to be confirmed), but I’ve written a workaround later on in this post.

First up download the zip file provided (contains the Renderer plugin and CSS file) geshi_for_b2.zip, then download and unzip GeSHi to your b2 blog root.

  • Unzip the first file, and put _geshi.renderer.php in “b2root/plugins/renderers/” (where b2root is your blog’s root directory)
  • Place geshi.css in “your_skin_directory/geshi.css” (e.g. on mine this is “b2root/skins/custom/”)
  • Add to “b2root/config/_config.php”:
    include_once (dirname(__FILE__ ) . ‘/../geshi.php’);
  • Add to “b2root/skins/custom/_main.php” (where custom is your current skin):
    <link rel=”stylesheet” href=”geshi.css” type=”text/css” />

All done 🙂 you should now be good to go…

Usage:

  • Wrap any code in [as], [java] or [php] (etc) tags.
  • Click the tick next to “Geshi” in the Renderers palette.

Sample Actionscript:

[as]Date.prototype.getDateOffset = function(offset)
{
var retDate = new Date(this);
retDate.setTime(retDate.getTime()+offset*86400000);
return retDate;
}[/as]

Good news is, your code remains editable in the admin section, you save some CPU cycles as the CSS is pre-generated (you can generate more with cssgen.php provided with GeSHi). I’ve included CSS for Actionscript, PHP, Java, HTML, but the renderer is only looking for the 1st three of those for speed reasons, you can enable as many as you like in under a minute.

Now for PHP 5 :s :

(Un)lucky for me, my webhost is running PHP 5, which GeSHi doesn’t like, so in light of this, I’ve written a Proxy Renderer class, that will get a script on a PHP 4 server to generate the required highlighted code, and return it to the Proxy plug-in.

To install, simply download the geshiproxy_for_b2.zip files and modify the commented code in the “geshiproxy_Rendererplugin.php” file to point to your PHP 4 server (this could be a free host with banners for example). Put that file in your “b2root/plugins/renderers” folder. Next up, put the “doGeshi.php” file on your PHP 4 webhost, at the location defined in the Proxy class.

This is currently the method I am using, and so far so good as long as you’ve installed GeSHi to your other host of course.

Good luck, please feel free as always to comment on anything.

Shockwave 10.0.1 Installer

Well this one came as a little bit of a suprise, almost completely silent. The new Shockwave player comes in a “slim” size. (The installer via browser plug-in detection is actually called “Shockwave_Installer_Slim.exe”). Macromedia has managed to shave…

Well this one came as a little bit of a suprise, almost completely silent. The new Shockwave player comes in a “slim” size. (The installer via browser plug-in detection is actually called “Shockwave_Installer_Slim.exe”). Macromedia has managed to shave over 2mb off the player size making it just under 2.5mb that’s a pretty mean feat and will no doubt help the spread of the Shockwave player by some amount. Great work MM! 😀

I must note this is only when downloaded via a browser’s auto-install feature. If you visit the player page on MM’s site you still only have a 4.6mb option. All of us Firefox 1.0 users will probably find the slim install doesn’t appear to work when the “confirmation page” is launched post-install. It just requires you close all Firefox windows first of all.

When Macromedia meets Microsoft

First of all I want to make it clear, I am a huge fan of Flash, to an obsessive level, there’s no chance of me switching to anything else anytime soon and this is not about slagging off Flash. 🙂

Ok, with that done…

Over the past year and a half…

First of all I want to make it clear, I am a huge fan of Flash, to an obsessive level, there’s no chance of me switching to anything else anytime soon and this is not about slagging off Flash. 🙂

Ok, with that done…

Over the past year and a half there’s been a lot of talk of Avalon, and Sparkle from MS, and how it might threaten Flash in the RIA market. Most of the discussions I have seen have ended with a Flash fan saying “MS isn’t aiming at the web…it’s not a browser plug-in…Flash will be fine”. Now imagine we are 2 years down the line.

Somehow this statement fails to make a realisation. MS don’t NEED to compete “on the web”, they don’t need to develop a rival browser plug-in or Central like platform. They will HAVE the platform and it won’t require an iota of effort on the part of the user. The fact that Avalon and Sparkle are a part of Longhorn means that they don’t need people to go to a webpage through a browser to use a RIA, these apps can be spread through tiny email attachments or quick to download files from links on web pages. This has been demonstrated in various movies on the MS site for some time. The keyword is SEAMLESS and MS’s “click once technology” embodies this.

These apps will of course use the internet to communicate, but it’s more of a seamless experience for the “always on” generation that becomes ever apparent, not to mention intrinsically having the “offline” capabilities of Central.

The shift from tools to content is enormous, I see the future of RIA’s being more about what they CAN do than what technology it uses (and “do I have it?”), however obvious that may sound, it’s hard not to get caught up in what technology is being used, for us geeks 😉

Odds are Internet Explorer won’t even require the user to download and save the application file to run it, it will just run in the Window when they click a link, with the Window seamlessly “turning into” the app from the browser.

No need for a plug-in, and with the ability to harness the entire power of the OS, FileSystem, Networking, 3D accelerator and all, this is seriously limitless. Wait a second, isn’t Avalon hitting Windows XP also?

Remembering that around 95% of desktops run Windows, you might hear Microsoftians say “who cares about the other 5%?”, seriously, some people really don’t, and for those who might, Mono provides .NET on Mac/Linux so who’s to say there won’t be a new equivelent for the Longhorn featurettes in the near future, let’s face it anyone running Linux will not lack the ability to install such platform, as it is they have to a year for the latest Flash plug-in, only to have it run at 1/3 less speed. Mac and “easy” distro’s of Linux (such as Knoppix) are the only worry here.

This isn’t a cry to MM because to be honest, there’s not much they can do, other than make the FlashPlayer stronger, faster and provide some brute graphical power (*roar*)… <edit> Seems Maelstrom does just this </edit> 😀

Central is a massive step forward, if it weren’t for the fact a user must choose to download Central, trust its certificates in a post SP2 era, and then install the app they wanted after Central installs.

Player size always seems to be an issue, but here’s a little shocker…Most Flash sites I now visit easily exceed the total Flash player download size over the duration, with streaming video, pictures and sound. Is it through fear of Director and Flash inhabiting the same shelf space? I think not, but still…

Well, just some thoughts, ready and willing for some good pro Flash arguments from fellow Flash developers (I really DO want MM to succeed, and I have faith) MM still rule the web, lets hope the web doesn’t melt too far into to the desktop for it to become irrelevant to the mass of home users.

For some more emphasis on “seamless” working, please watch the Higher Education video at:
http://msdn.microsoft.com/Longhorn/productinfo/conceptvid/default.aspx

Firefox 1.0 (PR)

Just another “how brilliant it is” posting on the web. As we have seen, it is rising in popularity, but IE isn’t being *that* affected just yet. This probably means Firefox is soaking up EVERYONE that isn’t using IE (on windows). Most people still find…

Just another “how brilliant it is” posting on the web. As we have seen, it is rising in popularity, but IE isn’t being *that* affected just yet. This probably means Firefox is soaking up EVERYONE that isn’t using IE (on windows). Most people still find no reason to switch, the word “browser” is irrelevant to the average home user, the “internet” just appears on their screen when they (double)click the little blue e icon on their “main screen”, and the sites they visit are just as ^&*% and ad-filled as ever with no Googling skills to be seen :p

Best features:

  • The excellent RSS button that automatically creates a folder in your bookmarks with links to all recent entries in the feed.
  • Hit ctrl+f the highlight find feature rocks and stops you from losing your place as you “tab” to the next result.