meHi - welcome to my site. I am a web developer and partner in leafish.co.uk: providing dynamic sites and supported hosting based around Drupal.

I might randomly blurt out some Drupal ideas or code from time to time, or perhaps take some photos or write some stuff about other stuff for anybody out there who cares.

Listing authenticated users without roles

1st Jul
2008

Sometimes we'd like to list users who have registered with a Drupal site, but haven't been placed into any proper roles yet via subscriptions, purchases, membership approval or whatever.

Try this join query to get started:

  1. SELECT users.uid, name, created, access, login, status
  2. FROM {users}
  3. LEFT OUTER JOIN {users_roles}
  4. ON users.uid = users_roles.uid
  5. WHERE users_roles.uid IS NULL AND users.uid != 0

Firefox 3 and "virus scanning"

20th Jun
2008

security.jpg Or, "I'm checking it, honest!"

Hmm. A mate noticed this earlier - his Macbook is currently fried so he's temporarily working on his girlfriend's machine with Windows XP (anyone feel his pain?).

On goes the spangly new Firefox 3... sooner or later he notices the new "Scanning for viruses" message which briefly appears at the end of a download.

Hang on a mojo: he has no virus scanner. Come to think of it, I thought, I've noticed this in Firefox 3 recently and neither have I. Yes, this is on my Windows machine - I've not run a virus checker for a long time. Only stupid people get infected. OK, OK, I admit my hard drive back when I worked at Jester once got trashed by some malicious shittery or other, but that was down to my own stupidity.

Anyway, that ends the invitation to send me viruses. So what exactly is Firefox doing with our downloads?

Night time Micra action

15th Jun
2008

dance_parties.pngTonight I discovered a new favourite choon when speeding home late at night in my super powered Micra: Dance Parties [Mechanised] by 65daysofstatic. This song has almost everything, and needs to be listened to loud.

(Must remember to turn volume back down on stereo in the morning.)

Richard Dawkins' Root of All Evil?

15th Jun
2008

richard_dawkins.jpgI've been meaning to check this out for a while and where torrents for TV programmes fail, YouTube wins. Sort of.

The programme is a two-parter from Richard Dawkins discussing how religious faith is gaining ground in the face of rational, scientific truth. The program takes you to some of the world's religious hot-spots... to examine the power of religion. Interviews with former Pastor Ted Haggard, the novelist Ian McEwan, the former Bishop of Oxford, and others offer valuable insights into the global impact and consequences of faith in the 21st century.

Dawkins himself claims the title of the programme wasn't quite right and insists he "fought it hard", but this programme along with his bestseller The God Delusion* has helped inspire people of reason worldwide to stay guided by the power of science and reason, to avoid abandoning the endeavour toward progress and knowledge for faith and superstition instead: a move which Dawkins believes puts humanity in great peril.

* Is this legal? Worth a visit for the enlightened comment "This is rubbish. I feel that this is very contridictory."

On "subscribing" to module porting/updating issues

6th Jun
2008

Come on people, STOP IT! You know who you are. "Subscribing" to an issue on a drupal.org project (can we guess which ones, people?) simply fills the thread full of useless comments, cluttering up any valid discussion enough to make any maintainer cry.

So, again, please stop. Bookmark the issue. Use RSS. Visit the Contributed Module Status group on groups.drupal.org, and help maintain the current branches status list - get some links to the relevant issues in there for us all to "subscribe" to!

And of course, if you really want the issue to enter into your "My Issues" queue, then contribute something more worthwhile than "subscribing" or "..."

/rant

Embedding Views in PHP snippets with Views 2

21st May
2008

Just a quickie - embedding views in PHP snippets etc. Sometimes blocks or panels don't quite cut the mustard and we need to directly insert a view via some PHP.

I started off here - the method I've used before to achieve this. There's another howto on Innovating Tomorrow. However, views_build_view, and indeed theme_view, are both no longer part of Views...

After a bit of searching I found mention of a new function; its also mentioned in the Views 2 documentation (work in progress).

So, the resulting PHP is wonderfully simple:

print views_embed_view($view_name, $display_id = 'default');

I was tearing my beard out, so I hope this helps someone.