Theme Switch - how to reset Theme Switch - how to reset
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Theme Switch - how to reset

Started by ericr23, March 22, 2023, 10:42:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ericr23

I changed my user-agent to test Theme Switch on my desktop, but now it won't revert. How can I reset it after I've reverted my user-agent?

ericr23

(I would have expected it to revert automatically upon detecting that I am back to my desktop user-agent.)

ericr23

In the Theme Switch codebase, perhaps there needs to be an "else" routine with the following:

    if ($mobile_browser > 0) {
        define('MOBILE_BROWSER', TRUE);
        if (!$superCage->cookie->keyExists($CONFIG['cookie_name'].'_mobile_theme')) {
            define('MOBILE_VIEW', TRUE);
            if ($CONFIG['theme'] != $CONFIG['theme_switch_mobile_theme'] && !$superCage->get->keyExists('theme')) {
                $USER['theme'] = $CONFIG['theme_switch_mobile_theme'];
                user_save_profile();
                header('Location: '.urldecode($REFERER));
            }
        }
    }

Joe Carver

QuoteHow can I reset it after I've reverted my user-agent?

To reset the theme to default use: yourdomain . com/index.php?theme=xxx.

Note that the theme=xxx request will reset any page the user happens to be on. Any theme on
the server can also be selected by naming the theme:  yourdomain . com/index.php?theme=eyeball

ericr23