I wanted to put a WP-Admin link on my blog, but one which only showed to me whilst I was logged in.
So hunting through the WordPress Codex I tried to find something like is_admin(), but couldn’t find it. Then going through all the PHP files I found this function current_user_can(capability) which returns true or false if the logged in user can do that capability. Next I had to work out a capability which only admin could do, but a quick look at the source code showed that it should be possible to enter an integer which related to a level.
So finally I have this on my blog:
<?php if(current_user_can(10)) { ?><a href="/wp-admin/">WP-Admin</a><?php } ?>
All posts by Ryan Cullen
Tidy Slugs
I’ve been playing about with WordPress plugins all day, and have created (more like stolen and modified a small amount) Tidy Slugs.
This plugin tries to catch a few of the random stuff that WordPress misses when I make the post slug.
For example if my post title was:
Ryan's Tidy Slugs, WordPress would make a URL of blog.artesea.co.uk/2007/11/ryans-tidy-slugs.html
however if it was:
Ryan’s Tidy Slugs (notice how the apostrophe is slightly more curvy) it would be blog.artesea.co.uk/2007/11/ryan%e2%80%99s-tidy-slugs.html
Very, very ugly!
(OK, you might not be able to spot the difference as WordPress loves to curve the apostrophes, however try creating a post title using the second one).
Made my mind up
After attending the East Midlands Regional Conference yesterday where Nick Clegg and Chris Huhne did an sort of husting, I’ve finally made up my mind on who will get my vote for the LibDem Leadership. Continue reading Made my mind up
They’re back!
And if you’re really lucky I might even throw in a bar-chart!
And the next leader goes
On the way home tonight the radio was teasing with breaking news, what could they mean? I was sure I knew the answer but they weren’t going to tell me until the newsreader got to her piece. It must be that someone was either pushed or jumped. Then at 17.06 it was announced that John Schofield had gone.
Dum di dum di dum di dum
From today you can now listen to the Archers on your MP3 player. It’s on iTunes, or manual downloads can be done via the BBC Website.
Good to see that at least BBC Radio are making their programmes easily available, unlink the TV arm and their dreadful iPlayer.
Spare Arsenal ticket for the Sunderland Game
Due to my brother flying off to Australia for 6 months, I now have a spare ticket for the Arsenal v Sunderland game this Sunday (12pm).
If anyone wants to come with me the ticket is £40 and we’re sat in the Orange quad in the far back row of 28. (See left)
Please email me at ryancullen at the domain of artesea.co.uk if you want it.
Local Post Office to Close, again!
In the last round of Post Office closures the branch on Cross Street was closed down. At the time we were told that we could easily get to our second nearest Post Office which is located on the High Street opposite St Peter at Gowts school (also the name of the branch). However according to todays plans this branch is now also to be closed.
How long before Lincoln is just left with one Post Office?
3 years old
Some time before Conference, LibDemBlogs had it’s 3rd Birthday. I’m not sure exactly when it was as the archives only go as far back as 5th December 2004 and archive.org only has posts from the 4th October 2004, yet I remember having the site live before Bournemouth 2004 conference.
But looking back at those early pages it’s amazing to see that we only had 16 bloggers and were average around 6 posts a day between us. Since then only half remain active/live (Adam Nazir Ahmed Teladia, Gavin Whenman, Lynne Featherstone, Neil Fawcett, Richard Allan, Ryan Cullen, Sandra Gidley, Will Howells), whilst the others are now gone (Hazel Crabb-Wyke, Jody Dunn, Martyn Hencher, Rob Goodfellow, Sara Grey, Steve Guy, Tom Paul and Vivienne Raper).
Today we have 133 active bloggers, in the last 44 hours 92 posts have been made and the site is one of the most popular LibDem websites.
Do you expect the Police to save your life?
After the recent press about the death of Jordon Lyon, I think people need to ask the following question.
Do you expect the Police to save your life?
Now it might not seem that hard, but I have the view that the Police are there to protect and the same goes for the PCSOs.
If it was two lifeguards, yes I would be asking why they didn’t jump in, but these were two fully clothed PCSOs.
It might be “human nature” to jump in, but what if the two officers couldn’t swim? I’m not the best swimmer and I remember all those years ago jumping into the swimming pool in Hemel with my pyjamas on and trying to pick up a brick, and I remember not being that good at it. Would I not be putting both the life of the boy and mine at risk if I tried a rescue? And then if I had a radio which had direct access to those that could help, would it not be better for me to use that?
What if it was a burning building instead, would you expect a PCSO to run in, or wait for the Fire Brigade?
It seems that the media like to question the roles of the PCSOs, however I know that the team we have for Park Ward in Lincoln do a great job and are welcomed by the community. So lets stop putting them down.
ps, we keep being told how the boy drown in a pond. Now I’ve seen the pictures and that is not a pond! A pond is a small water feature in your garden, this was a 6ft deep football pitch sized lake.