Drupal login modal window solution
Posted on January 10th, 2010 at 3:48 pm
Posted on January 10th, 2010 at 3:48 pm
This is a solution for creating a pop-out lightbox login area on any Drupal v6 site.
Modules used for this are:
Lightbox2 (I used the Dev version 6.x-1.x-dev dated 2009-NOV-23)
Go to the Lightbox2 settings and make sure ‘enable login support’ is selected.
Then create a custom block (blocks/add block), lets call it ‘login box’
Give the block a title of ‘test’ and add a line of text. Make sure the page specific visibility settings are set to only show on one page, i.e. ‘About Us’. This is purely due to testing but will save your life if you come up against the WSOD (White Screen Of Death) caused by some broken code. Save the block and then on the Blocks page move it to a region that you know is in your template. Before you do anything else please just check that the block you’ve created is appearing on the correct page and no other.
Once that’s done it’s time to enter the working Login Modal Window code in our new block. Edit the block and put this in the Block Body field. I have FCKeditor working on my Drupal build (I’ve no idea if it’s a default Drupal module – let me know) which lets you enter code by selecting ‘Source’ before you put this in:
<?php global $user;
if ($user->uid) {
print '<p><a href="/logout">Logout</a></p>';
} else {
print '<p><a rel="lightmodal" href="/user/login">Login</a></p>';
}
?>
Then below the body text area I have some Input Format settings. Please choose ‘PHP code’ (again, I’m not sure if this is a native Drupal option). If anybody apart from yourself will be editing the site make sure that their ability to post PHP code is turned off.
Now save the block again and look at the page it appears on. You should get ‘logout’ appearing if logged in and ‘login’ if you’re logged out. When you click ‘Login’ a modal window should appear allowing you to enter your login information. This should then close when you hit return, or take you to a normal login page should you enter any wrong details. Now go ahead and style that login link however you want!
Please leave comments if you think I’ve done this wrong, left out huge parts of the process or think there’s a better way to do this. This is my first post about Drupal and I really want to keep it as ‘layman’ as possible. Thank you.
Posted on December 19th, 2009 at 1:45 pm
I’ve been without a printer for about 4 months now, which isn’t great when you run a small business. So I finally tracked down the printer I wanted, the Samsung CLP-315W Wireless Colour Laser Printer. Now keep an eye on that ‘W’ there as it’s important. That ‘W’ means Wireless. Yes I could put this printer anywhere in the house. My desk’s real estate is expensive and I was looking forward to all that free room that a printer stashed in the cupboard would bring.
So I looked around and found the cheapest place to buy it, Overclockers UK, a snip at £125.31. I’ve used these people lots of times for all sort of computer bits and never had a problem although a quick look around the internet showed they had quite a number of dissatisfied customers. Most were complaining about the companies’ poor returns policy and up till then I’d never experienced it.
Well I’ve got to say that many of these customers were correct. Overclockers’ Webnote system is the only way to contact the people there as there’s no email address. This sytem is hideously out of date and you end up having a different staff member answering each query you have and you never feel that and communication between them goes on.
Anyway, I order the CLP-315W and get the CLP-315. Not much difference I admit but the CLP-315 is lacking one thing, yes that ‘W’. Bang goes that free desk space because the printer I get sent isn’t wireless!
Now begins a torturous procedure of trying to get the company to take back this printer and swap it for the one I ordered. This has happened to me before and has always been painless. The company arrange for somebody to come and pick it up and within a few days you get the right one. Unfortunately it didn’t quite work out like that and now 4 weeks after ordering the printer they just sent me back the old CLP-315.
This wouldn’t be that annoying if it wasn’t for the fact that I have told them on two seperate occasions that they may just make that mistake so please could they double check that they send me back the correct printer. I was told that the managers has ensured that my order has been corrected, oops!
So I’ve just sent off an email to them explaining this, along with a nice timeline of the order so far and asking to see how they may lift me out of this Kafka-esque nightmare. I’ll probably be adding to this over the next painfull few weeks. Do you think they may send me back the wrong one again? I may start taking bets.
UPDATE: Overclockers UK have given me a full refund after messing up my order due to a stock numbering problem. One member of staff there was really quite helpful in sorting this out. The conclusion I’ve drawn during this is that Overclockers UK really need to change their problem management software. The current webnote system meant a complete breakdown in communication between different members of staff and it’s really awful to use for the end user too.
Time line of my Overclockers UK Samsung CLP-315W colour laser printer order:
22 Nov – ordered Samsung CLP-315W StockID PR-011-SA – order number 3XXXXXX
23 Nov – Rec’d email conf that Samsung CLP-315W has shipped
24 Nov – Was delivered Samsung CLP-315 by mistake
24 Nov – Rec’d RMA number 1XXXXX
27 Nov – after waiting 3 days for RMA instruction I send email asking for RMA instructions and explain that Stock ID PR-011-SA has been changed to non-wireless Samsung CLP-315 product
27 Nov – Rec’d email reiterating RMA number but with no further details
7 Dec – I email you to ask again for RMA instructions
9 Dec – Told item will be picked up from me on the 11th of Dec
11 Dec – Contact you to tell you pick up was not made and to ask for another pick up.
15 Dec – DPD finally pick up the printer from me
17 Dec – Told new printer will be dispatched soon
17 Dec – Rec’d email conf that Samsung CLP-315 has shipped
17 Dec – I contact you to check that you’re sending me the correct printer this time (the CLP-315W not the CLP-315) as the order email looks like you’re sending me the non-wireless one.
17 Dec – Rec’d reply saying that the managers have assured you that this has been corrected.
19 Dec – Rec wrong Samsung CLP-315 printer (as I predicted might happen due to Stock ID number correction).
19 Dec – Send them a complaint and ask them to solve this once and for all.
21 Dec – Rec new RMA number and date of 23 Dec for pick up.
23 Dec – Printer picked up.
30 Dec – Printer arrives at Overclockers.
31 Dec – Rec email telling me my money will be refunded.
5 Jan – Money refunded into my bank account.
That’s 44 days in total!
Epilogue: I ordered the same printer from PC World last week and the correct one arrived 4 days later, even with all this snow!
Posted on June 5th, 2009 at 4:27 pm
Superb ToneMatrix light sythesizer from aM laboratory.
Can you guess the names of the 50 films to be found in the Empire Cryptic Canvas?
A new way of finding the odd tune or other file on the internet, FilesTube.com.
Dub Disco Deli pt.5 – More Deep Disco from Leftside Wobble. Quality tracks as per usual.
Posted on April 14th, 2009 at 10:14 am
After a few years of use and then quite a few years in the back of the cupboard it’s time to finally sell my Roland MC-303. My reasons for selling this are to free up some room (really need to declutter) and to allow someone else to make use of the instrument.
When I opened it for the following photos I managed to crank one more tune out of it before I packed it away for the last time. It took me just under an hour. Have a listen (download mp3).
It’ll be on eBay this week!

Posted on January 4th, 2009 at 8:48 pm
Here’s some things I’ve been looking at over the past month:
The Eyeballing Game – I managed to sneak under 4.0. How good is your coordination?
Best of Bootie 2008 CD – is now out (free download). Featuring the best mash-up mixes of the last year. Quality stuff as per.
LIFE Magazine Photo Archive. Huge resource of images.
The 50 most Strangest Buildings in the World. It’s a funny old world.
Posted on December 24th, 2008 at 5:39 pm
2nd in my series of eclectic compilations with an electronic twist. Included in these tracks are funky harp playing, strange 80’s sounds, cartoon soundtrack remixes and some great edits of some old classic tracks.
Feel free to download this here – eclectronica02.mp3 – or use the music player below.

Tracklisting:
01 – Rosko – Peacemaker
02 – Owusu & Hannibal – Delirium (Morgan Geist Tongues Remix)
03 – The Art of Noise – Robinson Crusoe
04 – Talking Heads – Born Under Punches (The Heat Goes On)
05 – Reel People – The Journey
06 – Bob James – Nautilus
07 – Parallax – L’attaque des Tridents
08 – Dorothy Ashby – Truth Spoken Here
09 – Ralph Myerz & The Jack Herren Band – A Special Morning
10 – Morgan Geist – Lullaby
11 – Château Flight – 1973 (Future Beat Alliance Remix)
12 – Linda Jane Bull – Wake Up And Make Love To Me (Courtesy of Sounds of our Youth Records)
13 – B-52’s – Mesopotamia
14 – The The – Giant (Pilooksi edit)
Posted on November 16th, 2008 at 8:49 pm
Well it seems that as the world leaders meet at the G20 summit this week, (it’s called a “summit” as they always have summit’ to talk about), the main thing they’re deciding on is the best way to fix the economy in a unified fashion. Having Brazil do this and Canada do that just isn’t working, so it seems, so all the leaders along with their treasury brain-boxes have got together to thrash out a solution.
Gordon Brown himself is in a very peculiar position. Behind in the polls but constantly gaining against the Torries the worse his economy gets. What kind of incentive is that? If this keeps up he should just devalue the pound to it’s lowest level since 1946 and call a snap election in the same week, bingo!
No, what Mr Brown is going to do is to actually buck this trend. He wants the economy to do really well and hope that, by the time he calls the next election, we’ll all reward him for making us better off.
Before the current economic crisis the best way in recent times to make the economy better off was the simple idea of job creation. If the government creates a job not only does the employee not claim benefits but they actually start paying you tax – it’s like a ‘6-point game’ in football. Labour was good at this and they did create a huge number of jobs around Britain. I myself benefitted from the New Deal packages, which now seem so outlandish as they were created using money from a £5bn windfall tax on private companies. A windfall tax, surely not? Isn’t that a bit, you know, Marxist.
We can’t create jobs now though apparently as companies around Britain are shedding them due to some kind of recession. During a recession most of these companies still make huge profits but not enough to make the shareholders happy. That’s when we get the news that “BigCorp has made 5,000 employees redundant”, or that the “RBHBHS Bank has shed 25% of their workforce”. So nice to see that many of the workers at these companies are making the biggest sacrifice of all as they go out their way to increase shareholder value. Unfortunately they wont be having a quartly appraisal now in which to bring this up.
So Brown must go back to the drawing board and think again. And it seems that what he’s going to do is create what’s know as a ’stimulus package’. God, that sounds pretty macho, doesn’t it? I can see Brown putting on a Barry White LP while he tells us that he’s about to make us relax, put a smile on our faces and save the country’s economy with his huge stimulus package, “now lie back and think of England”.
But the truth is that this stimulus package aims at putting a whole bunch of money in our pockets in a multitude of various ways. This is meant to kick-start the economy; save jobs; solve the current retail crisis; reduce inflation; and make us happy Labour voters. The government doesn’t quite have this money so we’ll all have to pay it back in one form or another in higher taxes in the future. This mechanism is also known as ‘Tax and Spend’.
Now I get to the main point I wanted to address. Who is Brown going to give this money to? And how will he do it?
An obvious way would be a straight income tax cut. Brown has already done this, with mixed results (the 10p tax debacle), so he may leave well alone. Also it’s hardly going to send you rushing to the shops when you realise you’re getting, say, £10 extra in your pocket every month.
He could try George Bush’s method of giving around £400 of tax refunds to every tax paying American. This could work and it’s the one I’d benefit from most. It might just take a bit of time to work through though.
He could decide to give it to families earning under a certain amount by utilising the Family Tax Credit system. This also would take time to work and has the huge problem in not giving ME any money and alienating all those single people out there, many who are potential Labour voters.
One brave option would be to temporarily cut VAT from 17.5% to around 10%. It’s bold but consumers would feel the effects straight away. That is if the retailers actually reduce their prices by this amount instead of just pocketing the difference themselves.
No, I think he should give every man or woman over 16, in work or not, who earns less than £40,000 per year a nice cheque for £250. In time for Christmas. This would reach the recently unemployed too, unlike the tax rebate measures. After spending all our tax money bailing the banks out surely he could throw some our way. And we’d pump it straight back into the economy, not into offshore accounts.
Rough calculations show this as costing around £10 Billion – a snip. To pay for this we could just do another windfall tax on the utility and oil companies. They’ve put their utility prices up by so much in the last three years and have seen their own profits shoot up at the same time. The main UK energy providers made profits of over £3 billion currently, an increase of 538%, and the oil company Shell alone made nearly £8 billion in the first six months (read this Unite article about Energy company winners). I’d like to see people argue against that. Well, apart from oil men of course. I’m sure they’ve just been saving up for this eventuality anyway.
So there you go Mr Brown, my sticky plaster for the current recession. And just think, it’ll pay for nearly half of the HD TV I’ve been looking at buying for the last month. And as I stare at you in High Definition over the next year I’ll probably be thinking to myself, I might vote labour this year. Everyone’s a winner!
Posted on September 21st, 2008 at 9:04 pm
Here’s a few interesting things I’ve seen or heard on the net recently.
Want to edit your photographs but don’t have Photoshop? Then use the online image editor at Pixlr. It’s relatively simple to use.
Live camera from the LHC collider in France.
Games:
Coign Of Vantage. Rotate the screen using your mouse to find the hidden image.
Totem Destroyer. Perfect blend of skill and luck. I managed to do all 25!
Split Words. Match the correct parts of words together. This is much harder than it first seems.
Music:
The Re:Publikan Podcast. Download mixes by AtJazz, Mark Farina etc..