yaritai:
Hi rbarbour,
I will give my input as I looked into your code for 2.1 a while back to do a small task for a friend. From what I did, the issue is not with the call to mobile detect as it is working. What his site is doing was to revert back to your older code without the session switch display and it does call the correct css responsive files. This is what I did to his:
if ($detect->isMobile() && !$detect->isTablet()) {
echo mobile.css;
} else if ($detect->isTablet()){
echo tablet.css;
} else {
echo default.css;
}
>
> When taking away the session display it works fine. It was a workaround as the switch was not important to him. So I guess for now, this may be the best alternative for those who want to use the winchester template and still have the capabilities of calling certain specific files.
>
> I was looking at the session switch to see if that was causing the issue but didn't go further since it was not important to him.
Yes, you are correct! The above code from 2.0 will suffice for those not looking to use the template display_mode switch.
For those of you that want to use or was expecting to use the core template display_mode switch functions included in my 2.1 framework that I forgot to copy over before submitting, Anne is now and always accepting donations to **RESTORE** this function. LOL, just kidding, no really. (Made me laugh! :laugh:, my own personal inside joke)
In: \includes\templates\winchester_responsive\common\html_header.php
find:
if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile'){
echo $responsive_mobile;
} else if ($detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
echo $responsive_tablet;
} else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){
echo '';
} else {
echo $responsive_default;
}
}
and replace with:
if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') {
echo $responsive_mobile;
} else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
echo $responsive_tablet;
} else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){
echo '';
} else {
echo $responsive_default;
}
}
I am sure Anne will update promptly!
@DivaVocals, Crystal
The above should work now with the scroller as well.
<?php if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') { ?>
<script type="text/javascript"><!--
$(document).ready(function() {
$("#foo1").carouFredSel({
auto: false,
align: "center",
padding: [0, 25, 0, 20],
width: "100%",
height: "auto",
items: {
},
scroll: 1, <!--SHOW 1 ON PHONES-->
prev : {
button : "#foo1_prev",
},
next : {
button : "#foo1_next",
}
});
});
--></script>
<?php } else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){ ?>
<script type="text/javascript"><!--
$(document).ready(function() {
$("#foo1").carouFredSel({
auto: false,
align: "center",
padding: [0, 25, 0, 20],
width: "100%",
height: "auto",
items: {
},
scroll: 3, <!--SHOW 3 ON TABLETS-->
prev : {
button : "#foo1_prev",
},
next : {
button : "#foo1_next",
}
});
});
--></script>
<?php } else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){ ?>
<script type="text/javascript"><!--
$(document).ready(function() {
$("#foo1").carouFredSel({
auto: false,
align: "center",
padding: [0, 25, 0, 20],
width: "100%",
height: "auto",
items: {
},
scroll: 5, <!--SHOW 5 ON NON-RESPONSIVE DESKTOPS-->
prev : {
button : "#foo1_prev",
},
next : {
button : "#foo1_next",
}
});
});
--></script>
<?php } else { ?>
<script type="text/javascript"><!--
$(document).ready(function() {
$("#foo1").carouFredSel({
auto: false,
align: "center",
padding: [0, 25, 0, 20],
width: "100%",
height: "auto",
items: {
},
scroll: 4, <!--SHOW 4 ON RESPONSIVE DESKTOPS-->
prev : {
button : "#foo1_prev",
},
next : {
button : "#foo1_next",
}
});
});
--></script>
<?php } ?>