Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: ziycon on June 5th, 2012, 12:28 PM

Title: Mobile Version
Post by: ziycon on June 5th, 2012, 12:28 PM
Just a heads up. Not sure if it's still being worked on and not sure if there is a mobile version yet but on my phone, Samsung Wave, it doesn't look pretty at all and doesn't auto detect it as a mobile device.
Title: Re: Mobile Version
Post by: Nao on June 5th, 2012, 12:31 PM
There's a mobile version, can be seen here as well, but it's really mostly geared towards iOS...
Not that I prefer iOS, but I simply have no other devices to test on.
Title: Re: Mobile Version
Post by: ziycon on June 5th, 2012, 12:34 PM
Will other mobile platforms be supported by a generic mobile site and will auto-detect be added?
Title: Re: Mobile Version
Post by: Nao on June 5th, 2012, 01:23 PM
Nothing will be done until I have an opportunity to play with any devices people want support for.

As for detection, iirc Wedge should redirect most mobile and tablet devices to the wireless skin. If it doesn't, go to your profile, change skin and check whether you're on the wireless or weaving skin.
Title: Re: Mobile Version
Post by: ziycon on June 5th, 2012, 03:45 PM
Grand, no worries.
Title: Re: Mobile Version
Post by: Nao on June 5th, 2012, 04:44 PM
So..?
Title: Re: Mobile Version
Post by: ziycon on June 5th, 2012, 04:51 PM
Hadn't looked, I was just saying thanks as in I was going to but now that I've had a chance, its set to the forum default. :)
Title: Re: Mobile Version
Post by: Nao on June 5th, 2012, 05:02 PM
Okay. I'll have a look at the ua for Wave and add it to my list if it isn't there.
Title: Re: Mobile Version
Post by: Nao on June 5th, 2012, 05:20 PM
There aren't any 'wave' ua strings available, only phone models which I'm not going to care about, so I added a generic 'samsung' string... I doubt they'll ever release a desktop browser, so it should be fine forever.

Can you confirm you get the wireless skin by default, now..?
Title: Re: Mobile Version
Post by: Nao on June 5th, 2012, 07:51 PM
Sorry, site was down for some time...
Didn't realize my FTP client had failed to upload Class-MoDe.php properly -- so it was generating errors on new sessions.
Title: Re: Mobile Version
Post by: ziycon on June 5th, 2012, 07:54 PM
Was this the error as this is what I was getting for a good while now!?
Quote
Fatal error: Class 'weMoDe' not found in /Sources/Load.php on line 368
Still getting the default theme on my wireless device.
Title: Re: Mobile Version
Post by: Nao on June 5th, 2012, 08:45 PM
Yes, and it should be working for you, are you sure you didn't change the skin *while* you were visiting the site on your mobile, by any chance..?

If not, go there and copy/paste your Wave's user agent here:

http://whatsmyuseragent.com/
Title: Re: Mobile Version
Post by: ziycon on June 6th, 2012, 12:50 AM
Still the same, heres my user agent.
Quote
SAMSUNG-GT-S8500/S8500BWKB1 Bada/1.0 Dolfin/2.0 NexPlayer/3.0 SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1 OPN-B
Title: Re: Mobile Version
Post by: Nao on June 6th, 2012, 09:20 AM
Well it should be working then... Very odd.
Title: Re: Mobile Version
Post by: Dragooon on June 6th, 2012, 11:38 AM
Cached in SESSION?
Title: Re: Mobile Version
Post by: Nao on June 6th, 2012, 11:46 AM
Oh yeah, forgot to suggest logging off :)
Title: Re: Mobile Version
Post by: 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.
Title: Re: Mobile Version
Post by: Dragooon 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.
Title: Re: Mobile Version
Post by: Nao on June 6th, 2012, 11:50 AM
Yup... And/or log out ;)
Title: Re: Mobile Version
Post by: ziycon on June 6th, 2012, 12:46 PM
Cleared everything I could possible clear and logged out and back in, still the same. <_<
Title: Re: Mobile Version
Post by: Nao on June 6th, 2012, 01:09 PM
It's no fun anymore. :(
Title: Re: Mobile Version
Post by: Dragooon 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.
Title: Re: Mobile Version
Post by: Nao 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...
Title: Re: Mobile Version
Post by: Dragooon 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).
Title: Re: Mobile Version
Post by: Nao on June 6th, 2012, 02:18 PM
Look at the strtolower............. :whistle:
Title: Re: Mobile Version
Post by: Dragooon on June 6th, 2012, 02:26 PM
What the f....I got no idea why that won't work.
Title: Re: Mobile Version
Post by: Nao 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...
Title: Re: Mobile Version
Post by: Dragooon 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.
Title: Re: Mobile Version
Post by: Nao on June 6th, 2012, 03:40 PM
Yup...
Title: Re: Mobile Version
Post by: ziycon 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?!
Title: Re: Mobile Version
Post by: Nao on June 6th, 2012, 06:03 PM
It's simple enough: the user name (in topic pages) is ABOVE the post, and there's no message counter below it. The date is on the right side. There is no permalink to the post, either.