maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   Wordpress iPhone theme - make it work on n800? (https://talk.maemo.org/showthread.php?t=24285)

Budgetperson 2008-10-13 18:09

Wordpress iPhone theme - make it work on n800?
 
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 -

Quote:

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 2008-10-13 18:44

Re: Wordpress iPhone theme - make it work on n800?
 
Quote:

Originally Posted by Budgetperson (Post 233229)
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 :)

Budgetperson 2008-10-13 18:48

Re: Wordpress iPhone theme - make it work on n800?
 
Ah okay, that makes sense.
Thanks!
(Oh and by the way, your blog theme (on normal computers) is cool, I like it :)) :P.

Reda 2008-10-14 11:59

Re: Wordpress iPhone theme - make it work on n800?
 
Quote:

Originally Posted by penguinbait (Post 233247)
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)...

kbarter 2008-10-14 12:15

Re: Wordpress iPhone theme - make it work on n800?
 
For user agent strings, try http://www.user-agents.org/

Reda 2008-10-14 13:23

Re: Wordpress iPhone theme - make it work on n800?
 
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)


All times are GMT. The time now is 10:42.

vBulletin® Version 3.8.8