Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Switch back to mobile theme

OnlyAnExcuseOnlyAnExcuse ✭✭
edited March 2012 in Vanilla 2.0 - 2.8

A user accesses our site via mobile. He switched to the Full Site version at the link at bottom, but can't seem to switch back.

I've tried doing the same myself and similarly there's no way I can see of doing it.

Any advice anyone?

(P.S. i'd have searched but the site search isn't bringing up any results, few for simpler queries)

Best Answer

«1

Answers

  • Thanks hbf. I advised user to do this but being fairly tech-phobic they're still using normal version.

    Might be a suggestion for later release to add a 'revert' link.

  • lucluc ✭✭

    OnlyAnExcuse said:
    Thanks hbf. I advised user to do this but being fairly tech-phobic they're still using normal version.

    Might be a suggestion for later release to add a 'revert' link.

    Already added.

  • SheilaSheila ✭✭

    luc said:

    Might be a suggestion for later release to add a 'revert' link.

    Already added.

    Hi! Does this mean that the 'revert' link has already been added or that it is gonna be included in the future release?

    Don't find the option when testing my site with phone. Meanwhile, is it possible how to add manually a link to footer with switching back to mobile site -option?

  • peregrineperegrine MVP
    edited May 2012

    A side question - Is there a way to use firefox or chrome and spoof to pretend you are a mobile device to see what it would look like to mobile users (in the case where you don't have a mobile device to test on).

    never mind:
    found this
    http://stackoverflow.com/questions/464089/simulators-emulators-for-mobile-browser-testing

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Sheila said:

    luc said:

    Might be a suggestion for later release to add a 'revert' link.

    Already added.

    Hi! Does this mean that the 'revert' link has already been added or that it is gonna be included in the future release?

    Don't find the option when testing my site with phone. Meanwhile, is it possible how to add manually a link to footer with switching back to mobile site -option?

    Its part of the next release.

  • hbfhbf MVP
    Answer ✓

    OnlyAnExcuse said:
    Thanks hbf. I advised user to do this but being fairly tech-phobic they're still using normal version.

    Might be a suggestion for later release to add a 'revert' link.

    It should automatically revert after a day or so. At least it does that to me on bb.

  • Hi guys,

    I had the same problem. Here is how i solved it:

    Just go to applications/dashboard/controllers/class.profilecontroller.php and look for this: function NoMobile, should be at line 363. Copy that function under it, change the name to "Mobile", and at Expiration variable, put this: $Expiration = time() - 172800;

    So replace the + with a -
    This will destroy the cookie, and you can add a link to your default.master.tpl for the desktop version of your forum, this link: www.yoursite.com/profile/mobile

    That's it.

    Regards,
    Vali.

  • @valizr said:
    Hi guys,

    I had the same problem. Here is how i solved it:

    Just go to applications/dashboard/controllers/class.profilecontroller.php and look for this: function NoMobile, should be at line 363. Copy that function under it, change the name to "Mobile", and at Expiration variable, put this: $Expiration = time() - 172800;

    So replace the + with a -
    This will destroy the cookie, and you can add a link to your default.master.tpl for the desktop version of your forum, this link: www.yoursite.com/profile/mobile

    That's it.

    Regards,
    Vali.

    thanks for that, can you be a bit more specific about what to copy ? do I copy the entire function from this:

    public function NoMobile() {
    $Expiration = time() + 172800;
    $Expire = 0;
    $UserID = ((Gdn::Session()->IsValid()) ? Gdn::Session()->UserID : 0);
    $KeyData = $UserID."-{$Expiration}";
    Gdn_CookieIdentity::SetCookie('VanillaNoMobile', $KeyData, array($UserID, $Expiration, 'force'), $Expire);
    Redirect("/", 302);

    to this ?:

    public function Mobile() {
    $Expiration = time() - 172800;
    $Expire = 0;
    $UserID = ((Gdn::Session()->IsValid()) ? Gdn::Session()->UserID : 0);
    $KeyData = $UserID."-{$Expiration}";
    Gdn_CookieIdentity::SetCookie('VanillaNoMobile', $KeyData, array($UserID, $Expiration, 'force'), $Expire);
    Redirect("/", 302);

  • Ok since no one got back to me I experimented with the above. I placed the second function in the class.profilecontroller.php. I added a link back to the mobile version in my Main forum page .
    This works very well. However I have one small bug in one of the forums where the link works to take me back to mobile version but auto refreshes back to the full site.

    The code is exactly the same. Works great on three forums . Got to figure out why the one refreshes back....

  • @peregrine said:
    A side question - Is there a way to use firefox or chrome and spoof to pretend you are a mobile device to see what it would look like to mobile users (in the case where you don't have a mobile device to test on).

    never mind:
    found this
    http://stackoverflow.com/questions/464089/simulators-emulators-for-mobile-browser-testing

    All you need to do is change the **User Agent **of the Browser to whatever you want. :)

  • AnonymooseAnonymoose ✭✭
    edited October 2012

    Set your browser User-Agent string to:

    Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3

  • Украдено у дизайнера из Украины.

  • phreakphreak MVP
    edited October 2012

    There is not yet a solution for this i guess. Deleting cookies or waiting till they are deleted isn't a way comunities without tech-savvy can go. An inbuilt solution would be very important.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • @vrijvlinder how did you solve this?

  • RiverRiver MVP
    edited September 2016

    @schindler said:
    @vrijvlinder how did you solve this?

    not sure if your goal is to switch back and forth between mobile and full page from a mobile device but...

    FYI - in all templated themes in vanilla 2.2.1

    {asset name="Foot"}

    controls whether you can see the option to go to Full Page or to go back to mobile while viewing from a mobile device

    if you remove the footer asset from your theme, you will not see the option to switch back in forth while viewing from a mobile device and you might break your theme.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • @schindler said:
    @vrijvlinder how did you solve this?

    Waited 4 years, actually there is a plugin for this called GoBackMobile the takes you back to the mobile view if you went to the full one and your theme does not have a link to the mobile view.

  • RiverRiver MVP
    edited September 2016

    @vrijvlinder said:

    @schindler said:
    @vrijvlinder how did you solve this?

    Waited 4 years,

    these old discussions should be closed to further commenting to force people to start new discussions and link back if necessary.

    actually there is a plugin for this called GoBackMobile the takes you back to the mobile view if you went to the full one and your theme does not have a link to the mobile view.

    https://vanillaforums.org/discussion/comment/220005/#Comment_220005
    Try this plugin http://vanillaforums.org/addon/gobackmobile-plugin :)

    Some plugins may have a link in the forum and the addons say file not found.
    not sure why they are missing? then read below.....

    Some may ask why are plugins removed?

    Well there are a few good reasons I can think of:

    • the author asked for permanent removal of plugin from vanilla forum (author's perogative).
    • the plugin was removed because its functionality was replaced by a better plugin or a core feature.
    • the plugin didn't work and somebody had the brains and wherewithal to remove it.
    • the plugin had security issues.
    • the author was responsible enough to remove a piece of garbage that was no longer supported.
    • the plugin was broken and author was tired of people begging the author to update it.
    • the plugin worked and the author got tired of people wanting more useless features and expected continual support for every theme and nuance.
    • the plugin couldn't be rewritten reasonably for the current version of vanilla, and the current version of the plugin provided no help to anyone in creating a working version of the plugin
    • some plugins are removed simply because they probably should have never been added for public use and the author is smart enough to remove it.
    • the plugin had specific licensing agreements and people were breaking the license agreement,
    • they removed the plugin from the plugin section and left it on github
    • inability of people to accept the answer NO from the author and begging and begging for hours of the authors time, so author decided easiest thing to do was remove it.
    • the plugin killed performance and people wondered why it killed performance.
    • the plugin broke other plugins.
    • the plugin broke vanilla.

    What does this mean for you...

    if it is not in the addons and the author didn't add it to github. time to give it a rest, and write your own or pay somebody to write for you and respect the authors wishes.

    Frankly - all the broken plugins that have been broken for a while should be removed. Too much clutter of broken crap.

    plugins that can't be thrown away....

    http://archive.magazine.jhu.edu/2011/11/why-can’t-some-people-throw-anything-away/

    https://github.com/adrianspeyer/VanExtend/tree/master/Plugins/GoBackMobile

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • @River said:

    @schindler said:
    @vrijvlinder how did you solve this?

    not sure if your goal is to switch back and forth between mobile and full page from a mobile device but...

    FYI - in all templated themes in vanilla 2.2.1

    {asset name="Foot"}

    controls whether you can see the option to go to Full Page or to go back to mobile while viewing from a mobile device

    if you remove the footer asset from your theme, you will not see the option to switch back in forth while viewing from a mobile device and you might break your theme.

    i am using vanilla 2.0.18 now, because of Anonymous plugin. i know there are security bugs but i will use almost 1 month.

    i found on https://github.com/adrianspeyer/VanExtend/tree/master/Plugins/GoBackMobile .
    probably there are bugs on plugin. but it is not important, i dont think a hacker will come my site in a month. :)

  • Hackers don't come to your site, they use vulnerabilities to infect your server. If you are paying for hosting, you will infect their server and everyone else.

    Vulnerabilities don't affect your forum, they affect any and all of your php files even from other software like WordPress. Basically anything that uses PHP.

    I was hacked and had no users at all. It was a nightmare because it affected all of my installations and websites I run for other people.

    Using software with known vulnerabilities, is irresponsible.

Sign In or Register to comment.