Artodia: Mobile and SEO

Mobile detect with cookies - Artodia: Mobile and SEO

Mobile detect with cookies

by javiexin » Sun May 06, 2012 10:40 am

Hello,

I have made a further modification to the mobile_detect script provided with this style so that it stores the user choice in a cookie, and therefore "persists" between sessions. That way, if a user selects "Full Style" in a certain device, it will continue using the original style until he/she clicks on "Mobile Style", and viceversa. No need to pass "nomobile" parameter around, only when switching.

Please, take a look, verify (as I have only done it in a few devices) and post any issues here, and I will try to help fix them.

download/file.php?id=140258

Note this is a ModX XML file, not fully packaged (missing the XSL file). To open, just copy it to any folder with the standard XSL file for ModX.

Hope this helps, regards,
-javiexin

PS: I attach the file again as I received some reports of failed downloads from previous link.
Attachments
detect_mobile_cookies.zip
(2.54 KiB) Downloaded 524 times
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: Mobile detect with cookies

by APealing » Wed May 16, 2012 1:55 am

Works Great - thanks Javier.
APealing
Registered User
Posts: 2
Joined: Tue May 15, 2012 5:03 am
Contact:

Re: Mobile detect with cookies

by noth » Wed Jul 04, 2012 7:13 am

Note this is a ModX XML file, not fully packaged (missing the XSL file). To open, just copy it to any folder with the standard XSL file for ModX.

this is what I don't understand
User avatar
noth
Registered User
Posts: 2472
Joined: Fri Jan 07, 2005 7:10 pm
Location: North Surrey
Contact:

Re: Mobile detect with cookies

by javiexin » Wed Jul 04, 2012 7:18 am

Download THIS to the same folder where you put the file in the ZIP.
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: Mobile detect with cookies

by Stoker 4.0 » Mon Jul 09, 2012 7:10 am

Does this version make the style default for bots?
User avatar
Stoker 4.0
Registered User
Posts: 1483
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: Mobile detect with cookies

by javiexin » Mon Jul 09, 2012 7:18 am

Stoker 4.0 wrote:Does this version make the style default for bots?
No change in this respect vs the standard version.
-javiexin
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: Mobile detect with cookies

by Stoker 4.0 » Mon Jul 09, 2012 7:20 am

Just as I wanted it :)
Thanks for making this.
User avatar
Stoker 4.0
Registered User
Posts: 1483
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: Mobile detect with cookies

by Hirazi Blue » Sat Jan 12, 2013 10:25 am

I wanted to try this "mobile detect with cookies" modification, but after completing the modification my whole board stops functioning, throwing me the following error message: "Cannot redeclare user::check_mobile() in (...)\includes\session.php on line 1945" Any ideas what I could be doing wrong? Thanks in advance for your reply...
Hirazi Blue
Registered User
Posts: 12
Joined: Sat May 08, 2010 7:26 pm

Re: Mobile detect with cookies

by javiexin » Sat Jan 12, 2013 12:13 pm

You have duplicated code. Review your edits and make sure you only have one set of edits.
-javiexin
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact: