CJ |
|
---|---|
How would i make my site redirect to a mobile theme on a mobile device ??? |
Trustmaster |
|
---|---|
First you need to distinct a user of a mobile device somehow. Either by the URL (i.e. use example.com/mobile or m.example.com for mobile devices) or by User-Agent (which are plenty of I suppose). Then, supposing that you use m.example.com for mobiles, you can write in your config.php: $cfg['defaultskin'] = $_SERVER['HTTP_HOST'] == 'm.example.com' ? 'wap_skin' : 'normal_skin';
May the Source be with you!
|
|
This post was edited by Trustmaster (2011-05-15 18:58, 13 years ago) |
GHengeveld |
|
---|---|
Have a look at this site: http://detectmobilebrowsers.mobi |
Sergey |
|
---|---|
Have a look at this site: http://www.neocrome.ru/forums.php?m=posts&p=22963#22963 But the operation has identified a number of problems: inconsistency size image text size, inadequate display the UL and LI .... www.cotonti.mobi
|
CJ |
|
---|---|
ok so i have a Mobile domian. I added this to my Config file and it didnt work $cfg['defaultskin'] = $_SERVER['HTTP_HOST'] == 'm.example.com' ? 'wap_skin' : 'normal_skin'; like i have the stuff from http://detectmobilebrowsers.mobi but idk where to put it so that it work. anyone wana explain ??? |
urlkiller |
|
---|---|
$cfg['defaultskin'] = $_SERVER['HTTP_HOST'] == 'm.example.com' ? 'wap_skin' : 'normal_skin';
this code switches the variable that stores the name of the skin the user (guest) will see on your page.
hope it helps
Added 6 minutes later: ahh yes autodetect. that would need some more work and a list with the browser user-agents (http://de.wikipedia.org/wiki/User_Agent#Mobilfunkger.C3.A4te <= thats german because the list wasnt in the english version!). but that would be the hard way.
Koradhil's solution was to use that little framework for detecting if its a mobile device or not. with that and a little plugin you could do a simple autodetection. Added 8 minutes later:
ok thats so easy stuff... (nice tipp Koradhil) that code changes the var of the skin (yes like above) but it uses $m (that can be TRUE/FALSE) to select either the first or the sencond argument. URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>
|
|
This post was edited by urlkiller (2011-06-27 02:13, 13 years ago) |
Kingsley |
|
---|---|
Uhm, noobie here.. In this day and age, maybe wise to make it an official cotonti plugin? I mean, the mobile market will only get bigger, so why not integrate it.. But that's just my 2 cents.. |
urlkiller |
|
---|---|
i would indeed like to see a plugin for that too... URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>
|
Sergey |
|
---|---|
This plugin made in 2009 for 6.1 Plugin requires additional testing for version 6.17. Work will be completed no earlier than the beginning of October 2011. This is due to the fact that the test is a new module for the pages of mobile phones. http://www.cotonti.com/datas/users/mobilconfig_205.pdf www.cotonti.mobi
|
|
This post was edited by Sergey (2011-06-28 04:19, 13 years ago) |
urlkiller |
|
---|---|
http://www.cotonti.com/datas/users/mobileskin_39.rar Added 43 seconds later: there it is... fully functional. if choosen skins dont exists it dont changes the skin names. tested with ipad, iphone 3 / 4 and android...URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>
|
CJ |
|
---|---|
@URLKILLER thanks for the link it help !! |
urlkiller |
|
---|---|
no problem. hope it works for you... (one problem though is that the user is forced to use the skins you enter in settings. all what he choose in his profile will most likely get overwritten !!!) URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>
|
CJ |
|
---|---|
well we only have 2 themes the mobile one and the normal one. but im sure there must be a way to make it so when we make more it can set to what u choose |
RaisenBran |
|
---|---|
Nope tested it urlkiller and my regular theme doesn't overwrite the mobile plugin, good job
Also I have the old Sedito MobileSite plugin, so if you ever run into problems on this MobileSkin plugin you made, I can give you my plugin to look at. |
CJ |
|
---|---|
here send it here ill see witch works better for my site |