Nao

  • With a Box
  • If you say so.....
  • Posts: 12,901
Re: Mobile Version
« Reply #15 on June 6th, 2012, 11:46 AM »
Oh yeah, forgot to suggest logging off :)
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

ziycon

  • We-Gen
  • Posts: 121
Re: Mobile Version
« Reply #16 on June 6th, 2012, 11:46 AM »
Quote from Dragooon on June 6th, 2012, 11:38 AM
Cached in SESSION?
Cleared the phones cache still the same.

Dragooon

  • I can code! Really!
  • Talking Head
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,724
Re: Mobile Version
« Reply #17 on June 6th, 2012, 11:47 AM »
Quote from ziycon on June 6th, 2012, 11:46 AM
Quote from Dragooon on June 6th, 2012, 11:38 AM
Cached in SESSION?
Cleared the phones cache still the same.
Clear your phone's cookies.
The way it's meant to be

Nao

  • With a Box
  • If you say so.....
  • Posts: 12,901
Re: Mobile Version
« Reply #18 on June 6th, 2012, 11:50 AM »
Yup... And/or log out ;)
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

ziycon

  • We-Gen
  • Posts: 121
Re: Mobile Version
« Reply #19 on June 6th, 2012, 12:46 PM »
Cleared everything I could possible clear and logged out and back in, still the same. <_<

Nao

  • With a Box
  • If you say so.....
  • Posts: 12,901
Re: Mobile Version
« Reply #20 on June 6th, 2012, 01:09 PM »
It's no fun anymore. :(
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Dragooon

  • I can code! Really!
  • Talking Head
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,724
Re: Mobile Version
« Reply #21 on June 6th, 2012, 01:20 PM »
Code: (Class-MoDe.php) [Select]
if (strpos($ua, $device) !== false)
return true;
Shouldn't that be
Code: (Replace) [Select]
if (preg_match('/' . $device . '/i', $ua))
return true;
?

Plus I don't see samsung/bada in there?
Posted: June 6th, 2012, 01:16 PM

Crap, no. Didn't read the foreach declaration.
The way it's meant to be

Nao

  • With a Box
  • If you say so.....
  • Posts: 12,901
Re: Mobile Version
« Reply #22 on June 6th, 2012, 01:21 PM »
Quote from Dragooon on June 6th, 2012, 01:16 PM
Code: (Class-MoDe.php) [Select]
if (strpos($ua, $device) !== false)
return true;
Shouldn't that be
Code: (Replace) [Select]
if (preg_match('/' . $device . '/i', $ua))
return true;
?
No... This is an array of short strings that are lowercased, and the user agent is lowercased at this point, too. There's no point in wasting time compiling a regex for that. I'm just scanning the user agent for these strings. It could be faster to do a global regex match for the entire list of devices, but I did some tests earlier and it was actually slower... (Yes, a single preg_match was slower than dozens of strpos calls...)
Maybe it has changed since I did my first tests, but I doubt so.
Quote
Plus I don't see samsung/bada in there?
Because it's not committed yet. Currently on wedge.org there's an additional '|samsung|' in the 'generic' list. It should return 0 for ziycon (start of the string), which is !== false (but not != false of course), and thus should return true overall...
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Dragooon

  • I can code! Really!
  • Talking Head
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,724
Re: Mobile Version
« Reply #23 on June 6th, 2012, 01:22 PM »
It is case sensitive. samsung won't match anything as it's SAMSUNG (strpos is case sensitive, stripos isn't).
The way it's meant to be

Nao

  • With a Box
  • If you say so.....
  • Posts: 12,901
Re: Mobile Version
« Reply #24 on June 6th, 2012, 02:18 PM »
Look at the strtolower............. :whistle:
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Dragooon

  • I can code! Really!
  • Talking Head
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,724
Re: Mobile Version
« Reply #25 on June 6th, 2012, 02:26 PM »
What the f....I got no idea why that won't work.
The way it's meant to be

Nao

  • With a Box
  • If you say so.....
  • Posts: 12,901
Re: Mobile Version
« Reply #26 on June 6th, 2012, 02:38 PM »
Hence my original reply...

Perhaps it always worked for him, but he chose to go Weaving at some point during his mobile tests, and I can't do anything for him...
But if he's logged out (a guest), and has cookies disabled, then it SHOULD work...
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Dragooon

  • I can code! Really!
  • Talking Head
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,724
Re: Mobile Version
« Reply #27 on June 6th, 2012, 02:44 PM »
Did a test run using that UA, code is evaluating it fine (after adding |samsung|). So must be something else.
The way it's meant to be

Nao

  • With a Box
  • If you say so.....
  • Posts: 12,901
Re: Mobile Version
« Reply #28 on June 6th, 2012, 03:40 PM »
Yup...
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

ziycon

  • We-Gen
  • Posts: 121
Re: Mobile Version
« Reply #29 on June 6th, 2012, 04:55 PM »
The only other thing I can think of is that the mobile site is being applied but it doesn't like working with my device, can you post a screen of what the mobile site should look like?!