Active Topics

 


Reply
Thread Tools
Posts: 8 | Thanked: 0 times | Joined on Jun 2008
#1
Hi all,

I am making a wordpress blog, and while looking for themes, I found this -
http://www.bravenewcode.com/wptouch/ .

It looks really cool for iPods, but I was wondering if I could make it work for the n800 and n810.

I saw part of the php code was this -

function detectAppleMobile($query = '') {
$container = $_SERVER['HTTP_USER_AGENT'];
//print_r($container); //this prints out the user agent array. uncomment to see it shown on page.
$useragents = array("iPhone", "iPod", "Aspen");
//print_r($container); //this prints out the user agent array
// Add whatever user agents you want here if you want to make this show on a Blackberry or something. No guarantees it'll look pretty, though!
$useragents = array("iPhone", "iPod", "Aspen", "n800", "n810",);
$this->applemobile = false;
foreach ($useragents as $useragent) {
if (eregi($useragent, $container)) {
$this->applemobile = true;
}
}
}
Did I do the useragents part correctly? Or would I have to enter something else...
I could install it right now and ask someone if it displays properly... right now my n800 is at the Nokia Repair Center .

Thanks!
Budgetperson
 
penguinbait's Avatar
Posts: 3,096 | Thanked: 1,525 times | Joined on Jan 2006 @ Michigan, USA
#2
Originally Posted by Budgetperson View Post
Hi all,

I am making a wordpress blog, and while looking for themes, I found this -
http://www.bravenewcode.com/wptouch/ .

It looks really cool for iPods, but I was wondering if I could make it work for the n800 and n810.

I saw part of the php code was this -



Did I do the useragents part correctly? Or would I have to enter something else...
I could install it right now and ask someone if it displays properly... right now my n800 is at the Nokia Repair Center .

Thanks!
Budgetperson

I just did this on my blog.

http://tablethacker.com

If you go there with a tablet or iphone you will get wptouch theme




---------------------------------------------------

function detectAppleMobile($query = '') {
$container = $_SERVER['HTTP_USER_AGENT'];
// print_r($container); //this prints out the user agent array. uncomment to see it shown on page.
$useragents = array("iPhone", "iPod", "Aspen", "X11; U; Linux armv6l");
// print_r($container); //this prints out the user agent array
// Add whatever user agents you want here if you want to make this show on a Blackberry or something. No guarantees it'll look pretty, though!
$useragents = array("iPhone", "iPod", "Aspen", "X11; U; Linux armv6l");
$this->applemobile = false;
foreach ($useragents as $useragent) {
if (eregi($useragent, $container)) {
$this->applemobile = true;
}
}
}

-----------------------------

Not everything worked cleanly though, the dropdowns are kind of messed up, let me know if you get that figured out, I just removed the drop arrows and linked the search to google
__________________
To all my Maemo friends. I will no longer be monitoring any of my threads here on a regular basis. I am no longer supporting anything I did under maemo at maemo.org. If you need some help with something you can reach me at tablethacker.com or www.facebook.com/penguinbait. I have disabled my PM's here, and removed myself from Council email and Community mailing list. There has been some fun times, see you around.

Last edited by penguinbait; 2008-10-13 at 18:49.
 

The Following 3 Users Say Thank You to penguinbait For This Useful Post:
Posts: 8 | Thanked: 0 times | Joined on Jun 2008
#3
Ah okay, that makes sense.
Thanks!
(Oh and by the way, your blog theme (on normal computers) is cool, I like it ) :P.
 
Posts: 22 | Thanked: 3 times | Joined on Oct 2008 @ UK
#4
Originally Posted by penguinbait View Post
I just did this on my blog.

$useragents = array("iPhone", "iPod", "Aspen", "X11; U; Linux armv6l");
Thanks!
Do you know if there is a list of UA somewhere (i'm interested in mobile UAs as well)...
__________________
------------------------
N810/Diablo
Blog: www.reda-ek.com/blog/
 
Posts: 20 | Thanked: 0 times | Joined on Apr 2007
#5
For user agent strings, try http://www.user-agents.org/
 
Posts: 22 | Thanked: 3 times | Joined on Oct 2008 @ UK
#6
Thanks, I also had that link from wikipedia but I was wondering if there is a more user friendly list (which identifies the hardware running the browser as well)
__________________
------------------------
N810/Diablo
Blog: www.reda-ek.com/blog/
 
Reply

Tags
display, iphone, n800, website, wptouch


 
Forum Jump


All times are GMT. The time now is 12:12.