For the last ‘ages’ I have been meaning to update my wordpress theme and add a forum.
I get a bunch of emails and comments on various posts about script help, which I am happy to help, but now I would like keep all questions in the forums so that they can help others.
New Design & Forum for Sheldon Lendrum
Update for Sheldon.Lendrum Search Rank checker
I have made an update to my search rank checker for http://sheldon.lendrum.co.nz to paginate the results. With over 4500 records, the list was getting a bit long.
I have paginated it by rank’s rather than equal pages.
Check it out – http://sheldon.lendrum.co.nz/search-rank-for-sheldonlendrumconz/,
Use PHP to find your mobile browser
I needed a quick way to include different files based on the if the visitor to a site is on a mobile device or a regular browser/computer.
Every browser has a user agent depending on the operating system, browser and system.
below are some common use agents, they can be found by echoing the server variable HTTP_USER_AGENT
< ?php echo $_SERVER['HTTP_USER_AGENT']; ?>
FireFox
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7
Safari Mac
Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-en) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10
Safari Windows
Mozilla/5.0 (Windows; U; Windows NT 6.0; en) AppleWebKit/522.13.1 (KHTML, like Gecko) Version/3.0.2 Safari/522.13.1
Nexus One
Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD56C) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
Apple iPhone
Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3
Apple iPod Touch
Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A100a Safari/419.3
Internet Explorer
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
PHP mobileAgent() Function
Here is my function, is it simple PHP function, is expects one paramerter, and array or expected user agents, but by leaving it blank, the function will use the default user agents.
Update: I have added more mobile user agents for older Android models, Blackberrry’s and the iPhone simulator. .
< ?php
function mobileAgent($custom_agents = array()) {
$agents = array_merge($custom_agents, array(
'iphone', // Apple iPhone
'ipod', // Apple iPod touch
'aspen', // iPhone simulator
'nexus', // Nexus One Android
'dream', // Pre 1.5 Android
'android', // 1.5+ Android
'cupcake', // 1.5+ Android
'blackberry9500', // Storm
'blackberry9530', // Storm
'opera mini', // Opera mobile
'webos', // Nokia Browser
'incognito', // Other iPhone browser
'webmate' // Other iPhone browser
));
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
foreach($agents as $agent) if(strpos($user_agent, $agent)) return TRUE;
return FALSE;
}
?>
Usage
< ?php if(mobileAgent()): ?>
< ?php else: ?>
< ?php endif; ?>
Twitter Weekly Updates for 2010-01-10
- First rotisserie on the BBQ
- RT @SheldonNesdale: Can you help me give my free ebook away? "How to Optimise Your NZ Website For Search Engines": http://bit.ly/84fQAh #
- RT @textmator: Amy Editor http://www.amyeditor.com/ #
- RT @keesfransen: RT @TylorSkory: Go to http://google.com and click "I'm Feeling Lucky" without typing anything to see a surprise. #
- Just created some lighting lines for fun http://yfrog.com/3nasiuj
from http://bit.ly/3m4cM0 #
- The DL link is broken
RT @smashingmag: Jellyfish-CSS 1.2: a free powerful CSS editor for Mac – http://bit.ly/70qlIK #
- hey @telecomnz, I'm not happy with my BB speeds of late ! Whats going on ? any issues in Tauranga CBD ? #
- http://bit.ly/622U2o
RT @SheldonNesdale: @totalinz re: TaurangaWebsites.co.nz That would be "Van" at NetMatters http://bit.ly/8zf5h6 #
- Just watched 'kingdom of hevean' I mysky'd it a week or so ago, not bad. #
- I have been working on the 2010 release of @dreamcatchernz this morning, http://bit.ly/4CHDGe #
- Sorry for the Tweet SPAM, this was due to our system, and Twitters delayed sending issues. http://bit.ly/8Du9OI #
- RT @5hameless: RT @iamkhayyam: I'm a PC. I'm a MAC. | http://bit.ly/4SZnyO *haha! #parody! #
- RT @keesfransen: 5 Reasons Pigs Are More Awesome Than You http://theoatmeal.com/comics/pigs from @oatmeal #
- I am proud to say – TGIF & TGFB !
(Thank god its friday – Thanks god for beer ) #
- Saturday morning humor http://media.funlol.com/content/img/did-it-hurt-when-you-fell.jpg #
Twitter Weekly Updates for 2010-01-03
- I just learned that the 1st known recording of Led Zeppelin happened @ Gonzaga University in Spokane on 12/30/1968. (@biggreenape @Klymacks) #
- Some one didn't make it to midnight http://yfrog.com/4fxjjpj #
- Hey @TelecomNZ my interwebs are SLOW today !
http://www.speedtest.net/result/668331951.png in reply to TelecomNZ #
- Just got back from spotty fishing, got a good couple bits of cat food down that the Tauranga jetty's. #
- @SheldonNesdale Thanks, will check it out tomorrow. That site really needs a lot of work, mostly it is there for the customer account area. in reply to SheldonNesdale #
- @telecomnz WTF is wrong with my net last couple of days ?! SO SLOW ! #
- @SheldonNesdale I have a feed that should be picking up everyone with in 35k of Tauranga CBD
http://twitter.sheldon.lendrum.co.nz/ in reply to SheldonNesdale #
- running updates for the mother-in-law's windows ME machine, brought it home as I couldn't beer to use her Dial Up #
- defragging windows ME, and almost done. #
- Whats new ?
Twitter Weekly Updates for 2009-12-27
- Help Please, #CodeIgniter and #fpdf pdf generation http://codeigniter.com/forums/viewthread/45365/P15/#685785 #
- RT @mike9r: HP is going to learn how social media can kill you: their webcams are racist http://idek.net/p0i (via @iA) #
- I just successfully restored a files from 2 weeks ago #thanks #apple #timemachine ! #
- RESOLVED: RT: @sheldonlendrum: Help Please, #CodeIgniter and #fpdf pdf generation http://codeigniter.com/forums/viewthread/139181/ #
- pretty – firefox 4 windows screenshots
http://blog.stephenhorlander.com/2009/12/21/windows-themeui-update/ # - RT @vodafoneNZ: RT @SitaMitaBita and others: RT @flyairnz: from our friends @grabaseat wildlife – The Cougar – http://bit.ly/6bqBFQ #
- Sweet mac Growl theme #mono http://fixedgear.ca/ #
- I just saw the #trademe guy in http://www.trademe.co.nz/Community/OfficeCam.aspx picking his nose !!! #
- Thanks @google – Merry Christmas ! http://www.google.com/advertising/holiday2009/
- When advertising goes bad http://i.imgur.com/uoJi0.png (via @timothymarshall) #
- RT @mike9r: Microsoft loses patent appeal, is ordered to stop selling Word and Office starting January 11th. Wow! http://idek.net/phI #
- At the mall, kmart is sold out of sellotape !! #fml #
- I'm watching Forrest Gump – classic! #
- Even Santa bends the rules sometimes… http://pics.livejournal.com/photognome/pic/005fk3zq.jpg (via @photognome) #
- Did you get some last night or something ?
Hm. I'm in a good mood today.
(via @dustindikes) # - RT @vodafoneNZ: RT @nigelramsay: RT @daaanpace: adidas star wars collection http://bit.ly/8DByU4 sweet! #gottagetmeoneofthose #
- 1 working hour of 2009 to go – ish… #
- @mwproductions I have heard 3d isthe ONLY way to see Avatar ! in reply to mwproductions #
Twitter Weekly Updates for 2009-12-20
- I took it and so should you—The Survey For People Who Make Websites, 2009: http://aneventapart.com/survey2009 #
- Sequel Pro, can you import a 120mg mySQL database ? #
- Yes, yes you can ! I remember when you would crash with a 2mg import
Happy times ! # - RT @iPhonewzealand: For those of you with a US iTunes account, check out the free 20-track iTunes Holiday Sampler . http://bit.ly/5ZC9Uo #
- @rowanbeentje Thanks, yeah, worked well, Great App BTW ! in reply to rowanbeentje #
- @rowanbeentje I have SP 0.9.6, checked for updates, there is no 0.9.7 ? in reply to rowanbeentje #
- RT @totalinz: RT @iPhonewzealand Latest…Kiwi App Review: NZRSS http://bit.ly/79J67o / #2 thanks to you
http://yfrog.com/4eaqtj # - My Niece made me and the misses a christmas video.
http://elfyourself.jibjab.com/view/B5aXdb2F7p4RHCr9xSoY # - This morning's work at @totalinz – Merry Christmas from the Vodafone Warriors
- Check out my latest game of Clown Town! http://yfrog.com/3lpyytzj (http://rampchamp.com/) #
- Check out my latest game of Icon Garden! http://yfrog.com/33vhyqj (http://rampchamp.com/) #
- Check out my Blue Kazoo in @RampChamp! http://yfrog.com/3g25oj (http://rampchamp.com/) #
- Got an iPhone ? Get this !! http://bit.ly/7E2GsZ #
- Hey I Google number 1 for 'sheldon'
http://yfrog.com/aukp6p
( Maybe a little bias ) # - Best church Christmas billboard evar: http://bit.ly/915lEG (via @gnat) #
- I'm at the @glassartnz workshop http://yfrog.com/4e7amgj #
- Try @totalinz
RT @gnat: dear lazyweb: who in NZ has business experience around open content (text, audio, video, interactive)? # - home time, home time, home time. #
- Hey @telecomnz, Does your pro account has 80gig data allowance now ? http://yfrog.com/1ybccyj #
- I just upgraded in to wordpress 2.9 on my blog http://sheldon.lendrum.co.nz #
- Sweet Deal.
@sheldonlendrum for a limited time it does, details here http://bit.ly/8jDU3i ^DM (via @TelecomNZ) #
- CAn anyones help as to why my #php #fpdf PDF generation is not creating new files, but juts adding new pages ? #
- Who drinked my cougar ? http://yfrog.com/3laviuj #
Yahoo – sheldon.lendrum and torrents
How do I rank number 1 for ‘torrent.com’ ?
I found this out on here!! http://sheldon.lendrum.co.nz/search-rank-for-sheldonlendrumconz/ – God I have to post more !
