Archive for the ‘PHP’ Category
TwitLive AIR application
Last Sunday afternoon I was listening to The Tech Guy on twitlive.tv and when I accidentally closed its tab one too many times decided to quickly make an AIR app for it to have it available as a desktop application.
It literally took me 11 lines of code and a good 15 minutes to build. Decided to send it to Leo and was happy to hear how excited he was about the app and did a plug for it on the net@night and MacBreak Weekly podcasts.
You can use the application to watch the live video stream and see the schedule for upcoming shows. Looks like it was released just in time to see him do the 24 hour iPhone 3G launch marathon.
For those of you not familiar with Adobe AIR:
- AIR is a free cross OS runtime (Windows, Mac and Linux)
- There’s no new language to learn, it uses web technologies like HTML, AJAX, Flash and Flex
- You get a lot of additional API’s like drag ‘n drop, filesystem access, network detection, clipboard access, local database support and much more that you can directly call from your code
This particular application was built in Flex with a TabNavigator component and two HTML components that are specific to AIR (the runtime has the open source WebKit embedded, the same HTML rendering engine as Safari uses).
For embedding the AIR install badge on his blog, Leo is the AIR Badge plugin for WordPress, a project I started a couple of months back.
I hope you’ll like this little application, there’s obviously a lot more you can do with this so am happy to hear any feature requests you might have. Leave a comment or drop me an email.
AIR Badge WordPress plugin
If you want to distribute AIR applications the install badge is definitely the best way to go. The one problem I had with it is that its a pain to prepare and embed on your blog.
To help remedy this I started working on this AIR Badge plugin last night, it allows you to simply use an [airbadge] tag and a couple of arguments in your blog post which will then be replaced by the AIR install badge.
[airbadge] application name, full URL to .air file, application version, image.jpg [/airbadge]
[airbadge]Contact Manager, http://www.peterelst.com/downloads/sqlite/sqlite-contactmanager.air, 1,http://www.peterelst.com/blog/wp-content/uploads/2008/04/contactmanager.jpg[/airbadge]
AMFPHP and Flex 2
There have been a number of posts and tutorials posted on this topic but just wanted to post it here as well because I’ve heard some people who were under the impression it is not possible to hook AMFPHP or other Flash Remoting solutions up to Flex 2.
Flex 2 uses a newer and more optimized version of the AMF format, while its true that exisiting Flash Remoting solutions currently don’t support this latest AMF format, it is possible to set a property on the NetConnection class to make it compatible.
Getting this done is pretty easy, you create a custom class by extending flash.net.NetConnection and set the objectEncoding property to AMF0 (the constant is set in flash.net.ObjectEncoding.AMF0).
For more information see:
http://www.adobe.com/devnet/flex/articles/flex2_amfphp.html
http://www.tweenpix.net/blog/
WordPress updated to 2.0.1
If you’re running WordPress its well worth doing the upgrade to 2.0.1! I just did it here this afternoon and it fixes a whole lot of issues I had with 2.0.
The dashboard is now actually usable and doesn’t crash all the time, performance seems to be way up, smilies are working, linebreaks in the WYSIWYG post editor are converted to linebreaks in HTML etc. Not sure what went wrong with my 2.0 install but it was extremely buggy to say the least and now I’m a happy camper again ;)
Configuring a Flash application – Part Two
DMXzone.com has just published my follow-up article on using an XML file to configure your Flash applications, its a pretty cool piece even if I say so myself ;)
The article talks about how to take things one step further, change config parameters at runtime and save the XML file back out using a simple PHP script. I’ll probably have more articles available in this series in the coming weeks, so if you liked to first free article, you’ll definitely be interested in reading this one.
Any feedback or suggestions for future articles is of course very welcome!
WP-ShortStat WordPress plugin
I recently got word from my good friend (and CMS guru) mattie about a great plugin. This plugin is a really cool addition to those of you running a WordPress blog for getting some visitor stats (including those that read it through your RSS feed) inside the admin panel. Extremely easy to install, just upload and activate it — no further action required which was a pleasant surprise!
mySQL 5.0 alpha available for download
ActionScript Hero has just reported some great news, a developer edition of mySQL 5.0 alpha is available for download which includes support for stored procedures.
I remember working on a project a while back involving Microsoft SQL Server and it took me quite a while to get my head around the concept of stored procedures. I’m looking forward to using it with my PHP apps, it’s a really neat way to handle more complex or repetitive series of queries.
AMF-PHP multiple method calls
If you’re working with Flash Remoting using AMF-PHP you might have encountered some problems in the latest release with doing multiple method calls. I’ve been browsing the mailinglist and came across a solution by Justin Watkins that fixes this problem.
You can download an updated version of “Executive.php” and use that to replace the old one (flashservices > app), you’ll also be required to do a little tweak to your “gateway.php” file:
$gateway->setBaseClassPath($_SERVER['DOCUMENT_ROOT'].“flashservices/services/”);
Those two changes should do the trick!
SHA1 class for PHP4
I’ve written this SHA1 class in PHP quite a while ago but thought I might just put it up in case anyone’s still interested in using it.
The code was ported from Branden Hall’s SHA1 Secure Hash for Flash MX which in turn was based on a JavaScript implementation. You can download the code here, feel free to drop me a line if you’re using it for a particular project that’s always nice to know!
FYI, people running a PHP release above 4.3 can use the built-in sha1() and sha1_file() functions.



