Cannot switch theme

Hi.
Switch theme from AdminPanel does not effect, active theme still is "default".
Checked on clean install R 5.5.9, XAMPP, PHP 7.2.12
Any idea ?

Comments

  1. Re: Cannot switch theme

    This is probably because there is currently only one theme available, what does your theme/ folder tells you?

    All other themes must be migrated with or without using the new template engine. I'm willing to provide help and support, but I won't do the work myself.
  2. Comment 630

    I copy default theme to the same folder and rename it. Then I trying to switch them no success.
  3. Please try to start a new session

    Do you mean that the guest still gets the default theme? Delete the old page cache and restart the browser to get a new session.

    Did you can login and change the theme for the user?
    • WikiAdmin
    • 04.05.2019 17:17 edited
  4. Can't reproduce the issue

    I tested on Linux and Windows with XAMPP. Hard to say what the error source is, a config option hickup or maybe a folder rights or path issue?
    Could you solve the issue?
  5. Comment 647

    I expected that specifying theme in the Admin Panel will certainly install it for all users. However, if a registered user has set a theme in his a profile before changed theme by the administrator, then this setting does not change. I did not understand how to install theme for the guest. Cleaning caches of wiki and browsers give unpredictable results. I myself am embarrassed to reproduce the issue. So far, I realized that it is necessary to allow one theme only and set it in Admin Panel. After that, I need clean all caches of wiki and browser. Then (may be) users and guests will see same theme.
  6. setting new default theme versus user theme

    The Admin Panel sets the value for the default theme in the secondary config, which affects of course only guests and new users. What you are looking for is a function which sets a selected theme for all users.

    UPDATE wacko_user_setting SET theme = 'default'	


    This option would then overwrite all set themes in the user_setting table.

    diff --git a/wacko/admin/lang/ap.en.php b/wacko/admin/lang/ap.en.php
    --- a/wacko/admin/lang/ap.en.php
    +++ b/wacko/admin/lang/ap.en.php
    @@ -405,6 +405,9 @@
         'LayoutSection'                => 'Layout',
         'Theme'                        => 'Theme',
         'ThemeInfo'                    => 'Template design the site uses by default.',
    +    'ResetUserTheme'            => 'Reset all user themes',
    +    'ResetUserThemeInfo'        => 'Resets all user themes. Warning: This action will set back all user selected themes to the global default theme.',
    +    'SetBackUserTheme'            => 'Set back all user themes to %1 theme.',
         'ThemesAllowed'                => 'Allowed Themes',
         'ThemesAllowedInfo'            => 'Select the allowed themes, which the user can choose, otherwise all available themes are allowed.',
         'ThemesPerPage'                => 'Themes per page',
    diff --git a/wacko/admin/module/config_appearance.php b/wacko/admin/module/config_appearance.php
    --- a/wacko/admin/module/config_appearance.php
    +++ b/wacko/admin/module/config_appearance.php
    @@ -184,6 +184,19 @@
             $engine->http->redirect(rawurldecode($engine->href()));
         }
     
    +    // set back all user themes to curent default theme
    +    if (isset($_POST['reset_user_theme']))
    +    {
    +        $engine->db->sql_query(
    +            "UPDATE " . $engine->db->table_prefix . "user_setting SET
    +                theme    = " . $engine->db->q($engine->db->theme) . "");
    +
    +        $engine->set_message(Ut::perc_replace($engine->_t('SetBackUserTheme'), '<code>' . $engine->db->theme . '</code>' ), 'success');
    +        $engine->log(4, Ut::perc_replace($engine->_t('SetBackUserTheme', SYSTEM_LANG), '##' . $engine->db->theme . '##' ));
    +
    +        $engine->http->redirect(rawurldecode($engine->href()));
    +    }
    +
         // update settings
         if (isset($_POST['action']) && $_POST['action'] == 'update')
         {
    @@ -335,6 +348,18 @@
                 </td>
             </tr>
             <tr class="lined">
    +                <td colspan="2"></td>
    +            </tr>
    +            <tr class="hl-setting">
    +                <td class="label">
    +                    <label for="reset_user_theme"><strong><?php echo $engine->_t('ResetUserTheme'); ?>:</strong><br>
    +                    <small><?php echo $engine->_t('ResetUserThemeInfo'); ?></small></label>
    +                </td>
    +                <td>
    +                    <input type="submit" id="reset_user_theme" name="reset_user_theme" value="<?php echo $engine->_t('ResetUserTheme'); ?>">
    +                </td>
    +            </tr>
    +        <tr class="lined">
                 <td colspan="2"></td>
             </tr>
             <tr class="hl-setting">


    Maybe this should be placed in an extra module dedicated to resetting user settings (default -> user setting)
    • WikiAdmin
    • 15.06.2019 10:05 edited
Log in or create an account to post a comment.