define('DISALLOW_FILE_EDIT', true); Kevin Newman – Page 8 – unFocus Projects – Kevin Newman and Ken Newman

Correct User IP for WordPress comments on Mosso

Update #2: It looks like a couple of days after I posted this, the Mosso guys sent word on fresh clicks that the issue has been fixed on their end, rendering this plugin completely useless, days after I put it up. 🙂

I stumbled across a problem running WordPress on Mosso (Rackspace Clould) servers (which I’m now quite happily running unFocus.com on 🙂 ) in the Mosso Knowledge Base, where the ip address of the user is not properly recorded in comments when running in the Mosso cluster. The knowledge based linked to a fresh clicks article, but I wanted something a little easier to maintain than an inline hack. So I rolled a quick and dirty plugin, which seems to do the trick. Here is what it does:

[cc lang=’php’]
< ?php /* Plugin Name: unFocus.Mosso-User-IP Plugin URI: http://www.unfocus.com/projects/ Description: A plugin to set REMOTE_ADDR on Mosso clusters to HTTP_X_CLUSTER_CLIENT_IP to fix tracking and comment posts, etc. Version: 1.0a Author: Kevin Newman Author URI: http://www.unfocus.com/projects/ */ function unFocus_MossoUserIP() { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP']; } add_action('init', 'unFocus_MossoUserIP'); ?>
[/cc]

That’s it! It just sets the regular REMOTE_ADDR value to the Mosso Server var HTTP_X_CLUSTER_CLIENT_IP. Pretty simple. 🙂 Update: I forgot to upload a zip archive. unFocus.Mosso-User-IP.zip

Quick Update – HistoryKeeper, SwfHTML, SwfShim

Just a quick post.

There have been a couple of fixes and changes that have gone into HistoryKeeper, SwfHTML and SwfShim that are now in the SVN trunk, as well as a few other issues that have been nailed down, and put into the issue tracker.

Among the fixes are finally a fix for the incorrect use of Javascript Errors in SwfHTML, as well as fixing the previously unfinished SwfShim.

Despite the fact that I can’t figure out how to pass flashvars from SwfShim to loaded AS3 based swfs, I’m still going to include it anyway, with a note about that caveat. It does solve some other issues, and adds an easy way to utilize ExpressInstall even if you are using html to embed the swf (rather than javascript). More on that in a future post.

I’ll also be cleaning house around the site, here and on google code. I’ve already removed some old lingering (and useless) ad stuff.

Also, since Microsoft removed the “click to activate” silliness, I went ahead and deprecated PatentMagic. It was buggy anyway.

Check back for more updates, and hopefully, an actual release!

A problem with Flash Player 10 version number and javascript detection

As you may have heard, Adobe recently released the first beta of Flash Player 10. It looks like unFocus.FlashPlayerInfo has been checking for single version digits, rather than multiple:
[cc lang=’javascript’ ]
_versionRaw.match(/Shockwave Flash (\d)\.(\d)/);
[/cc]
The fix is easy enough (I could swear I actually fixed this at one point too):
[cc lang=’javascript’ ]
_versionRaw.match(/Shockwave Flash (\d+)\.(\d+)/);
[/cc]
This problem doesn’t seem to be limited to just the unFocus Flash Detection script. I’ve seen other claims of failed Flash detection in other corners as well. I’d bet most of the problems are with the plugin detection scripts (Mozilla Firefox, Opera, Safari, etc.) and not with the ActiveX detection scripts (Internet Explorer), since most of the plugin detection scripts out there are using string parsing techniques, and have probably not tested with multiple digit Flash versions (since there haven’t been any until now).

I’ll see about getting a release out soon. If anyone needs any help updating anything, feel free to leave a comment, or email me.

unFocus.History Keeper 2.0 (and SwfHTML) Beta 2 – Out Now!

unFocus.History Keeper 2.0 Beta 2 is now available for download.

Feel free to download, test and use the new beta. Here’s what’s new and fixed:

  • History.js – There was an odd error, from a mixed up function, keeping History Keeper from working at all in the last release. It was the first issue reported by someone other than myself (thanks shacky7!) and it’s been fixed.
  • FlashPlayerInfo.js – was throwing an error if there was no flash player installed at all in IE. It’s fixed.
  • FlashPlayerInfo.js – added more robust Flash Player 6 detection. It is impossible to check for some minor revision versions in Flash Player 6, because they crash IE if you do. It’s now possible, though, to check for 6.0r65, which is the first version to support Express Install.
  • FlashPlayerInfo.js – deprecated “.getPluginType()”, and replaced it with “.getPlayerType()” and made it actually work. To practice discipline, I left “.getPluginType()” since it’s improper to change the API after a beta release (it didn’t work before, so I’m sure no one is using it).
  • FlashPlayerInfo.js – Fixed beta and MinorRevision errors in ActiveX path.
  • SwfHTML.js – was producing a security warning in IE if used over https. It’s fixed.
  • Added a bunch of test files for each object, to help make sure stuff doesn’t break (that’s annoying), and more thoroughly test the various methods and features. It is almost, sorta like unit testing, if you kinda look at it sideways, in a mirror. 🙂
  • Added Object Patent Magic to the package.
  • Added SwfShim to the source (under javascript folder), but it’s not ready for prime time yet, and is not in the packed js file.
  • Added some example pages – but these are really just there to test to the packed files, at the moment. HistoryKeeper.html is a good place to start if you want to learn how to use History Keeper. I’ll update soon with some Flash examples.

Check out the updated project page for more info, or just skip straight to the download. 🙂