Thursday, April 08, 2010

Drupal 6 multi-site single sign-on

I've just spent the last two days looking into setting up single sign-on across multiple sites under a shared domain. I looked at both the Multisite Login and Single sign on modules but in the end the solution was achieved without either of these modules. Multisite Login correctly notes in the README : "if you are using several sites on the same domain then you do not need this module. The multisite functionality in Drupal core has the ability to share logins for sites like these without additional modules." The problem was there doesn't seem to be much documentation about achieving this. In the end the solution was on Eric's Drupal Blog but it was sort of lost in the detail so I want to note the key elements here.

For this example we have three sites http://www.example.com/master, http://www.example.com/slave1, http://www.example.com/slave2. I want to be able to sign on to one site and to be signed in to all.

Start by setting up the master site as you normally would (if you haven't set up a multisite before this earlier post may help). The only additional thing to do is to set the cookie_domain variable in the sites settings.php:

$cookie_domain = 'master';

Now go ahead and setup slave1. Once again add the cookie_domian (using the same value as the master site) but this time also define the db_prefix array. You use this to tell this site to use the database from the master site for some of the tables. Lets say that the master site uses a database called masterdb. To tell slave1 to use this database for the users table add 'users' => 'masterdb.' to the db_prefix array. The exact list of tables you'll need to add will depend on how much functionality needs to be shared across your sites. Eric's post adds users, sessions and authmap. I've also added filters, filter_formats and role :

$db_prefix = array(
'default' => '',
'access' => 'masterdb.',
'authmap' => 'masterdb.',
'filters' => 'masterdb.',
'filter_formats' => 'masterdb.',
'role' => 'masterdb.',
'sessions' => 'masterdb.',
'users' => 'masterdb.'
);


Now you are ready to install slave1. When that's done you should be able to log out of and into either site and stay logged in across both. Repeat the steps used for slave1 on the slave2 site. That's all there is to it. In essence all that's required is to share some core tables and the cookie domain across all sites. The only problem I struck was if the cookie_domain isn't an actual domain.

Monday, July 27, 2009

New Game : Balance Of Power

After many months of hard work and heartache my latest game Balance of Power is finally available. This game is a real departure from my last two games Wheel of Death and Perpetual Motion (both using the Box2D physics engine). Balance Of Power is a turn based strategy game. While most games are about resource depletion : a resource called health. Balance of Power is about resource distribution : a resource called influence. The more influence you have the greater your status. The higher your status the more influence you can take. The aim is to take all the influence from the enemy. When their influence is gone they will start to see things your way.

It's probably not the easiest game in the world. But like many board games it rewards the effort of learning a few basics with many hours of challenge. I actually built most of Balance prior to starting the physics based games. But I felt that it's genre would be an obstacle to it's success. In the end I came back to it and decided I really liked the game and so committed to getting it published regardless. I hope that you will give it a fair go as I think it will be worth your efforts.

Thursday, July 16, 2009

RSS vs Twitter

Like a lot of people I started out very sceptical about the value of Twitter and have gradually been drawn in. I'm finding more and more useful ways to use Twitter. I don't really get the desperate pursuit of followers but have found very real value in following a small number of reliable streams. For example, I can't imagine that I would ever stop following abcnews. But I'm still very attached to RSS through Google Reader and still defining the line where something works as a Tweet rather than an RSS. For example, I still find myself following TechCrunch on both Twitter and via RSS. Twitter offers convienience while I'm still very keen to star and share things in Google Reader. Anyway I just found a very clear example of something that works much better in RSS than in Twitter : Dilbert. I can't start the day without a dose of Dilbert. Below are two screenshots the first from Google Reader and the second from Twitter. However you look at it the Reader version is handy and the Twitter version (even with the bit.ly preview addon) isn't:

Saturday, April 25, 2009

The Reid iPhone Reader

A growing category of iPhone apps is the eReader. Obviously they aren't as common as games and fart jokes but they are a lot more useful. Though I imagine many wouldn't consider the idea of reading books on the iPhone. Some of this is just nostalgia (the smell of the book etc) and some has to do with a poor experience trying to read on a computer screen. But I've read a few books using Stanza (my review) and I'm so taken with the experience that I've told my family not to give me an paper books until further notice. The iPhone's small screen actually seems to assists with reading and I've had no trouble reading chapter after chapter (when time allows).

The latest eReader is Minions Reid. Reid offers three unique ways of reading documents:
  1. Word highlighting
  2. Word Flash : also known as Rapid Serial Visual Presentation (RSVP)
  3. Un-assisted reading (OK this isn't unique)
Of these RSVP (not to be confused with a popular dating site) is new to me and I'm intrigued by it. Essentially the words flash onto the screen one at a time. Hence reading is easy and it's is the progression of words that provide context. A slider allows you to control the speed of the text and hence the speed at which you read. It is very easy to stop the progression of text if you need to pause and do something else. Though I found it hard to go back and re-read a sentence if I wanted clarification.

These features were developed based on usability studies and Minions provides information on the science behind Reid.

To my mind the stand out feature of the Reid is it's ability to connect to and import from your Google Docs. Consequently any text document that can be loaded into Google Docs can be read using the Reid. Readers like Stanza allow you to connect to a range of existing online book stores. Some of these sell the books (ie Fictionwise) but others provide access to free books (ie Project Gutenburg). This provides quick access to an enormous range of books and so far I haven't had any trouble finding something I was keen to read. Unfortunately I've never successfully loaded a work document into Stanza (apparently it is possible). Reid bridges this gap. Any document that is sent to you, that you create, that you find online and that can then be loaded into Google Docs is available. This is something I will definitely use. It annoys me that I will have two readers to cover my needs but I can't see an easy solution to that.

There are a couple of things about Reid that I'm not so fond of:

Firstly, it seems to only store one document at a time. Therefore if I wanted to read two or more things on the way home (where I frequently don't have network access) I can't.

Secondly it provides sliders for adjusting font size and contrast. A slight movement of these sliders seem to take me from 5pt to 50pt and I found it near impossible to get a font size that I was entirely happy with. I also think having these options on the apps menu bar is a bit distracting. Especially as it seems to reload the document after each adjustment. Stanza allows you to adjust the size and appearance through a settings page that provide a preview of the text that updates quickly while you are making adjustments. This seems a much better system to me. I think Reid's approach could work if it was more responsive.

Reid is a genuinely useful addition to the list of available eReaders for the iPhone. It offers some unique reading options and access to your Google Docs. I'd like to see it provide access to a larger pool of documents directly from the app but I will definitely continue to use it and if you need to read documents that you create or that colleagues provide then I'd recommend giving it a go.

Update : In response to my review Michael Coon from Minion has been in touch to say that a few of the issues mentioned above will be addressed in the next version. This includes looking at improving the slider controls and the ability to cache multiple documents.

Sunday, March 08, 2009

Perpetual Motion : Walkthrough

A while back (OK 11 months and 2 weeks ago) my Perpetual Motion game was released. It is now available on 180 different sites and has been played 270,000+ times. It's probably a bit late but now I've finally re-done my website it seemed a good time to publish a walkthrough for Perpetual Motion. It's a bit of a task so I'm publishing one level a day until all 36 are complete (level 8 was published yesterday). If you've never given the game a go, or you got stuck on a level, now may be a good time to have another go.

GeekGlue Site Update

Over the last couple of years my GeekGlue website has become increasingly out of step with my current interests. I've been thinking more and more about how I should use that space. In the last year I've become very interested in casual gaming and have (as noted on this blog) published a couple of games. Therefore I started to think that I would like to use the GeekGlue site to support my game publishing and perhaps focus my own research into casual gaming. I was also keen to use Drupal (which we've been using extensively) to make the site more flexible. Hence the new GeekGlue is born with new games added daily, a blog posting a daily review of the best new game of the day, walkthroughs of my games (and probably a few others) as well as casual gaming news. The site is very much in a formative state and I expect to regularly add new features in the coming months.

Friday, February 13, 2009

Kindle 2 vs iPhone Stanza

A few weeks ago I joined the growing throng of Apple fanboys and signed up for an iPhone. The main reason was that my last phone was one of the great GUI disasters of all time. It took about 8 button clicks to delete a single SMS message and similar hoops for many other common actions. So this time I was determined to get a phone that didn't make you want to throw it firmly into concrete after the first five minutes. I haven't been disappointed with my iPhone and in fact I have been surprised by it's versatility.

Since the first Kindle was released I've been watching that space with interest. I love to read and I love the idea of eReaders. But I've never seen an eReader I wanted to use. The Kindle seemed like an eReader I'd want to own. While I was researching new mobile phones I came across Stanza. Stanza is an eReader app for the iPhone and I was keen, though more than a little sceptical, to give it a go. What has surprised me is how much I've enjoyed reading books on my iPhone with Stanza. I've read a couple of novels using Stanza in the last couple of weeks and have my eye on a couple of others I'm keen to read. The only thing stopping me is the stack of paperbacks on my bedside table (I've issued instructions not to buy me any more paperbacks unless instructed otherwise). I could go on a bit here but probably best you take a look at Stanza's quick guide video if you want to know more.

Which brings me to Kindle. Last week Amazon previewed a new improved Kindle (see also CrunchGear's "Hands-on with the Kindle 2". Looks great but is it too late. The Kindle probably provides a slightly better reader than the iPhone (hard to tell from the preview) but it would need to be dramatically better to compete. One of the selling points for the iPhone is that I could consolidate my music and my phone into one device. So why would I want to carry another device to read a book when my phone does such a good job? Obviously not everyone has an iPhone, but I'm assuming that similar devices (by Apple or it's competitors) will become the norm in the future and that each will be able to provide a similar reading experience. So while Kindle seems like a great idea it now looks like a great idea that came too late.

Friday, January 16, 2009

Melbourne JoomlaDay 2009


Melbourne JoomlaDay 2009 will take place at Melbourne University on Saturday 7th February and Sunday 8th February. From the site :

"Joomla is an award-winning Content Management System (CMS) that will help you build websites and other powerful online applications. Best of all, Joomla is an open source solution that is freely available to everybody. Visit Joomla's official website.

Beginners will get a jump-start into Joomla, learn how to set up their first Joomla site. Designers will gain deep insight into Joomla 1.5 templating. Implementors and Developers will enjoy myriads of tips and tricks out of the core developers’ toolbox.

Joomla is an award-winning Content Management System (CMS) that will help you build websites and other powerful online applications. Best of all, Joomla is an open source solution that is freely available to everybody."

Registrations close on 21 January if they don't sell out before then (apparently it did sell out last year so you might want to get in early).

Thursday, January 15, 2009

Zamak : Peugot Ad

Zamak is perhaps one of the worlds top designers of 3D characters. Mostly I've seen them as images on his blog. This morning Zamak has published a very cool Peugot ad using his robotic characters :

Wednesday, January 14, 2009

Adobe Stratus beta launched

Adobe have launched a new communication protocol(RTMFP) and the Adobe Stratus service (beta) to enable the development of applications using the protocol. Real-Time Media Flow Protocol (RTMFP) uses UDP "whose low latency, end-to-end peering capability, security, and scalability make it especially well suited for developing real-time collaboration applications by not only providing superior user experience but also reducing operators' costs". Currently Flash uses Real-Time Messaging Protocol (RTMP) which is TCP based. "Stratus is a hosted rendezvous service" that allows Flash applications to sent media "directly between two Flash Player instances without routing through a central relay server".

Links

Thursday, December 11, 2008

Google Native Client

OR Changing the web one press release at a time

Google have released a new experimental browser plugin called Native Client that allows embedded application to interact with the operating system. Traditionally browser to OS interaction has been severely constrained for security reasons. Plugins that have attempting to provide more options for interaction have proven to be highly insecure. ActiveX attempted to do this by allowing the user to decide what plugins it trusted but users are generally poorly positioned to make these sorts of decisions. Google's Native Client plugin aims to provide secure interaction by identifying trusted modules for interfacing with the OS. I'm guessing that Google will be making the decisions about what modules can and can't be trusted. The up side is that you can develop an application and know that it will be as secure as the trusted module that is doing the work for you.

A nice feature of this system is that existing applications can apparently be quickly compiled to work with a minimal number of changes:

"As a test, Google ported an H.264 encoder that is about 11,000 lines of conventional C code. To get the encoder to compile and run in Native Client, they only had to add approximately 20 lines of code and modify the Makefile. The resulting binaries are completely portable and can run without requiring recompilation on any operating system supported by the Native Client. "
Safer than ActiveX: a look at Google's Native Client plugin

It's not hard to see that this has the potential to transform the internet (not that old chestnut again). Especially when it's combined with Google's Chrome browser and the growing popularity of Google apps.

Tuesday, November 18, 2008

Web Developer IDE's

Like a very large percentage of the worlds web developers I've been using Dreamweaver as my main Developer IDE for many years. Recently I've started to do some of my web development in Eclipse due to some handy Javascript and PHP plugins. But I still go back to Dreamweaver for CSS and FTP ( there is a plugin for enabling FTP in Eclipse but it needs more time and patience than I have to install all the dependancies). Really I'd prefer to have one application open rather than two so I'm always on the look out for alternative. Consequently, my radar went up when I saw a post comparing Komoda Vs Coda. I'd never heard of either so I started hunting around :

Sunday, October 26, 2008

Flash NumericStepper : Setting the Background Color

Have you ever wanted to customize the appearance of the NumericStepper component in Flash (it's pretty easy in Flex). Specifically I wanted to change the color of the text input area. Looking at the NumericStepper class there is some mention of the upSkin and I tried setting this the way I would normally set a button upSkin but with no effect. So I started looking into how the component is constructed. It shouldn't surprise you to find out that the text in the NumericStepper uses the TextInput component. You can get a reference to this object by using the NumericStepper textField property. The next problem is that the TextInput component offers no direct way to change it's background. It turns out that TextInput uses a TextField to display it's text. You can get a reference to this object using the TextInputs textField property. Consequently to change the background color of a NumericStepper's text you need to access it's textFields textField. It looks like this:

myStepper.textField.textField.background = true;
myStepper.textField.textField.backgroundColor = 0x0F1A2F;

What makes this confusing for me is that the first textField returns a reference to a TextInput and then the second textField returns a reference to a TextField. There may be an easier way to do this and I hope to hear what it is. Perhaps I'm missing something regarding upSkin?

Thursday, October 16, 2008

Perpetual Motion : My New Game

Perpetual Motion Singapore

A few days ago we (myself and the nice people over at King.com) published my latest game : Perpetual Motion. This new game has much in common with my first physics based game : Wheel of Death. In Wheel Of Death you had to arrange props to get the wheel to the goal. Walls, bus and various other obstacles provided variety to the levels. Box2D was used as the physics engine to allow some realistic collision and physics. While I was developing Wheel Of Death I regularly found I was more interested in building perpetual machines with the available props than I was in completing the levels. By perpetual machines I mean a combination of props that cause the wheel to cycle for an indefinite period. It seemed to me at the time that it would be simple enough to "quickly" build this new game as it used much of the engine from the original. To be honest much of the engine from Wheel of Death remains unchanged except for a few enhancements to make it more reliable but as I became more interested in the concept I started to invest more time in refining the user experience (dialog transitions, a world map with each location having a unique landmark and a different background) and introducing instructional elements (numbers to show the sequence of prop interaction). Getting a meaningful scoring mechanism was probably one of the biggest challenges and from the comments on Kongregate I don't think I went far enough in explaining the scoring system. Still I feel Perpetual Motion is a real leap forward from my first game. I hope you enjoy playing it.

Wednesday, October 01, 2008

OzFlex October Meeting : Andrew Spaulding presents CS4

If you didn't make it to last weeks launch of Adobe Creative Suite 4 then you might be interested in joining Adobe's Andrew Spaulding as he presents an "exciting, fast‑paced, developer focused session on Adobe’s latest line‑up of their flagship Creative Suite products, and how they interface with Flex & AIR". This event will be hosted as part of OxFlex's October meetup and will take place at Melbournes Loop Bar from 6.30 PM on Monday 13 October (more details).

Thursday, September 25, 2008

Melbourne CS4 Launch Debrief

I've just left the Melbourne Adobe Creative Suite 4 launch. I have to say I'm a bit surprised. It was unlike any product launch I've been to in the past. Essentially it was a half hour tour of the top new features followed by an open bar. Some were disappointed by the brevity of the presentation hoping for a more detailed overview of the release. Personally it seemed a clever idea. Everyone there was web savvy enough to go hoem and look up the features that caught their eye and at the end of the day you only need one killer feature that saves you enough time between release cycles (about 18 months?) to justify upgrading. For graphic designers I imagine having multiple artboards in a single Illustrator file could be enough to justify the upgrade. For web developers Fireworks ability to export standards friendly CSS (surely that is too good to be true) or Dreamweaver's many workflow improvements may clinch the deal. For Flash developers the killer feature is less clear. Inverse kinematics and 3D transforms will probably be a selling point for animators. Both of these features will be useful for programmers but hardly killer features. The improved integration with Flex (while not featured during the launch) will definitely be of interest to this group. I was most interested in a feature in Premiere and Soundbooth that was able to create transcriptions from the media audio. This transcript could then be included into the video as metadata with Premiere outputing a player with search capabilities (i.e jump to the point in the video where a word or phrase appear). There were options to customize the size of the text chunks and to choose Australian English (or Korean, or Japanese etc) as the basis for the transcription. Soundbooth was also able to export the transcription as xml (TimedText I think) which will be really useful for creating closed captions in Flash. If this works even half way then it will be of enormous benefit to anyone trying to achieve basic accessibility standards.

Wednesday, September 10, 2008

Google Homepage Word Count and SEO

Marissa Mayer is one of the people responsible for the Google homepage and I just discovered a fascinating post from her on the Official Google Blog. It seems that a series of emails lead Marissa to become very aware of the number of words that Google uses on it's homepage. This lead them to adopt a 28 word policy. That means they use no more than 28 words on the basic Google homepage. Therefore when they decided to add a link to their Privacy page then '©2008 Google' dropped the Google to become '©2008'.

One of the reasons for Google's success is the simplicity of it's homepage and so you might wonder why more people don't copy this approach. It's more than a little ironic that the answer is SEO (Search Engine Optimisation). Google determines a pages page rank by 'reading' the content of the page and looking at what pages link to (and from) that page. Therefore having more relevant text and links on your homepage has the potential to increase your page rank and therefore make your site easier to find on Google. So Google has less words on it's home page so more people will use it to find your site and you must have more words on your home page so Google will let people find it.

Monday, September 08, 2008

Adobe CS4 Features

Early last week the news emerged of a Adobe special event in late September. The invites were quite secretive but by the end of the week the news was out that this was a "launch" event for Creative Suite 4. Details of the new release are still under wraps but there have been a number of sneak peaks and lab releases offering some insight into this upcoming release. I'd like to claim I've done a whole lot of research and put together a compilation of all the new features that have been previewed but in the course of this research I happened across a page on Wikipedia where the work had been done. Also worth a look is a YouTube video showing some new Photoshop features. A post from Flash Magazine showing Flash features demoed at this years WebDU. A four part series on Community MX highlighting new features from the Fireworks beta. Flashmech has posted a good review of the new Dreamweaver features. You can also download and try the Dreamweaver and Fireworks betas from Adobe Labs.

Tuesday, August 19, 2008

Silverlight : the Pro's and Con's

Tim Anderson from The Register has posted one of the best Silverlight overviews to date. In "Microsoft Silverlight: 10 reasons to love it, 10 reasons to hate it" he provides a clear, factual and common sense approach to assessing the value of Silverlight.

There is also an older post "Adobe AIR: 10 reasons to love it, 10 reasons to hate it" that you might want to take a look at while you are there.

Thursday, August 07, 2008

Cairngorm : Makes a few announcements

There has been no shortage of discussion about Cairngorm over the last twelve months. In particular there has been a lot of discussion comparing Cairngorm with the other Flex frameworks that have been, and continue to emerge. But there has been surprisingly few announcements from the Cairngorm team. That all changed yesterday with a lengthy posting by both Alistair Mcleod and Steven Webster. The raw essence of both of these posts is that Cairngorm public face has moved to Adobe Open Source with all the support features that entails (community forums, source code available in a subversion repository, a JIRA bugbase for logging bugs and feature requests). There was also mention of plans for Cairngorm 3 but there were no hints ta how far away that might be. What was most interesting was that both posts read almost like a manifesto, a statement of their philosophy. At no point did they directly respond to Cairngorms quite vocal critics but there were a number of assertion of principles that indirectly dealt with some of these criticisms. The following comment from Steven Webster is quite telling :

"Blog posts that " is evil", " is bad", " sucks" certainly catch a great deal of fleeting attention, but I don't believe that investing our limited time and energy in these debates is the most effective way of advancing the state of our art."

Some other quotes of interest :

Alistair McLeod :

"At Adobe Consulting, we've always had a minimalist approach to Cairngorm; we don't want to add feature for feature sake, add functionality that doesn't belong within an architectural framework, or introduce another design pattern into the mix because it's the latest fad in the software industry. The framework is there to allow us to build well-architected software solutions, and we've only ever added features we truly believe helps us do that."

Steven Webster:

"We have no desire to convolute the framework, to introduce abstraction, or to discourage the use of idioms or techniques specific to Flex, in order that we might create applications that could be ported to other presentation-tier technologies."

"We wish for Cairngorm to encourage best-practice leverage of underlying Flex features, and we are keen to ensure that we never add something to Cairngorm that is better suited to the underlying Flex SDK."

"One of the things we'll look to lock down as we go forward from here, is a simple charter by which we measure suggestions; this has been very implicit and shared understanding amongst the Adobe Consulting team, but we need to document and agree this with the community as we go forward. But in essence, it's as important to decide what Cairngorm is, as well as what it isn't, both now and in the future."