Thread: Skin Switch

Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 47
  1. #31
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Skin Switch

    Quote Originally Posted by DrByte View Post
    While these discussions have merit (and it's worth pointing out that in 2017 Search Engines are going to be ranking mobile-friendly sites higher than desktop-only sites, at least in search-results conducted on mobile devices), this discussion thread is about a specific plugin/mod, so we should try to go back to that topic.
    Point taken, but I think there is considerable value in "reigning in the horses" (so to speak). What Carol is trying to achieve is fundamentally to make an improvement on her website, and has the view that a "sticking plaster" solution is going to do the trick. For some reason, she has the view that this skin-switcher will solve her challenge. Technical issues aside, to me the whole point of using zencart is to make a living out of it. If not, just install wordpress and blog away.

    So when I see people making "technical" decisions that (de facto) put the business they are doing at risk (or greater risk), then the importance of the discussion changes from just geek-speak, to one of what's best for the business. It's like the board of directors arguing over the colour of the company stationery while the factory is on fire.

    While Carol might be able to "technically" be guided through how this module can be configured, I think it is perhaps more valuable to her to show her what really needs to be done in order to consolidate her business. Installing this module may in all likelihood give the APPEARANCE of a fix, but at the heart of it, it will be detrimental to her basic objectives in doing it.

    Or maybe I'm wrong... Do I really care if Carol's website gets shunted by Google? Hmmmm, maybe I do... I don't like to see promising businesses make bad decisions.
    20 years a Zencart User

  2. #32
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Skin Switch

    Hey Scott, do you think you can update this module for 1.5.8? I think only the init_templates.php file needs updating.
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  3. #33
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,694
    Plugin Contributions
    123

    Default Re: Skin Switch

    You can take the 1.5.8 copy of init_templates.php and add the override check (line 38-54 from my mod) to line 32 and it will work. For PHP 8+, you have to do an empty() check on $_SESSION['skin'] too before checking it against $new_template_dir.

    But are you sure you still need this plugin? Have you looked at this:
    https://docs.zen-cart.com/user/templ...ivate_testing/
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #34
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Skin Switch

    Both alternatives sound good to me for different types of scenarios. Thanks!

    If I make it work for the switch I will upload an update for others' convenience.
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  5. #35
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Skin Switch

    Quote Originally Posted by swguy View Post
    You can take the 1.5.8 copy of init_templates.php and add the override check (line 38-54 from my mod) to line 32 and it will work. For PHP 8+, you have to do an empty() check on $_SESSION['skin'] too before checking it against $new_template_dir.

    But are you sure you still need this plugin? Have you looked at this:
    https://docs.zen-cart.com/user/templ...ivate_testing/
    I tried this and many other ways and they all failed.
    PHP Code:
    /**
     * Allow admins to switch templates using &t= URL parameter
     */
    if (zen_is_whitelisted_admin_ip()) {
        
    // check if a template override was requested and that the template exists on the filesystem
        
    if (isset($_GET['t']) && file_exists(DIR_WS_TEMPLATES $_GET['t'])) {
            
    $_SESSION['tpl_override'] = $_GET['t'];
        }
        if (isset(
    $_GET['t']) && $_GET['t'] === 'off') {
            unset(
    $_SESSION['tpl_override']);
        }
        if (isset(
    $_SESSION['tpl_override'])) $template_dir $_SESSION['tpl_override'];

      
    /* See if there is an override */
        
    if (isset($_GET['skin'])) { 
        if (
    $_GET['skin'] != '') { 
           
    $new_template_dir zen_db_prepare_input($_GET['skin']);
        if (isset(
    $_SESSION['skin'])) {
               if (
    $_SESSION['skin'] != $new_template_dir) { 
                      
    $_SESSION['skin'] = $new_template_dir
               }
           }
           
    $template_dir $new_template_dir
        } else { 
           if (isset(
    $_SESSION['skin'])) { 
              unset(
    $_SESSION['skin']);
           }
        }
      } else if (isset(
    $_SESSION['skin'])) {
        
    $template_dir $_SESSION['skin'];
      } 
    Would you tell me what I'm doing wrong?

    Thanks!
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  6. #36
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,694
    Plugin Contributions
    123

    Default Re: Skin Switch

    I have updated the plugin for 1.5.8.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  7. #37
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Skin Switch

    That's great, thanks.

    I tried it and when I switch to another template it gives me a blank page (which was the problem that I had before in some of the trials I did).
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  8. #38
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,694
    Plugin Contributions
    123

    Default Re: Skin Switch

    You'll need to post the debug log for me to know what happened.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  9. #39
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Skin Switch

    Code:
    [08-Feb-2023 17:32:23 UTC] Request URI: /sandbox/?skin=sophy_blue, IP address: 24.55.69.103
    #1  each() called at [/home/ideas22/public_html/sandbox/includes/templates/sophy_blue/common/html_header.php:72]
    #2  require(/home/ideas22/public_html/sandbox/includes/templates/sophy_blue/common/html_header.php) called at [/home/ideas22/public_html/sandbox/index.php:42]
    --> PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/ideas22/public_html/sandbox/includes/templates/sophy_blue/common/html_header.php on line 72.
    That's the "multilingual section" of the header.

    I replaced it copying that part from responsive_classic and still not success.
    Last edited by ideasgirl; 8 Feb 2023 at 07:56 PM.
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  10. #40
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Skin Switch

    Quote Originally Posted by ideasgirl View Post
    Code:
    [08-Feb-2023 17:32:23 UTC] Request URI: /sandbox/?skin=sophy_blue, IP address: 24.55.69.103
    #1  each() called at [/home/ideas22/public_html/sandbox/includes/templates/sophy_blue/common/html_header.php:72]
    #2  require(/home/ideas22/public_html/sandbox/includes/templates/sophy_blue/common/html_header.php) called at [/home/ideas22/public_html/sandbox/index.php:42]
    --> PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/ideas22/public_html/sandbox/includes/templates/sophy_blue/common/html_header.php on line 72.
    That's the "multilingual section" of the header.

    I replaced it copying that part from responsive_classic and still not success.
    Wrong log. This is the correct:

    HTML Code:
    [08-Feb-2023 18:56:33 UTC] Request URI: /sandbox/zen158/?skin=sophy_blue, IP address: 24.55.69.103
    #1  require_once() called at [/home/ideas22/public_html/sandbox/zen158/includes/languages/sophy_blue/english.php:633]
    #2  include_once(/home/ideas22/public_html/sandbox/zen158/includes/languages/sophy_blue/english.php) called at [/home/ideas22/public_html/sandbox/zen158/includes/classes/ResourceLoaders/FilesLanguageLoader.php:39]
    #3  Zencart\LanguageLoader\FilesLanguageLoader->loadFileDefineFile() called at [/home/ideas22/public_html/sandbox/zen158/includes/classes/ResourceLoaders/CatalogFilesLanguageLoader.php:54]
    #4  Zencart\LanguageLoader\CatalogFilesLanguageLoader->loadMainLanguageFiles() called at [/home/ideas22/public_html/sandbox/zen158/includes/classes/ResourceLoaders/CatalogFilesLanguageLoader.php:19]
    #5  Zencart\LanguageLoader\CatalogFilesLanguageLoader->loadInitialLanguageDefines() called at [/home/ideas22/public_html/sandbox/zen158/includes/classes/ResourceLoaders/LanguageLoader.php:29]
    #6  Zencart\LanguageLoader\LanguageLoader->loadInitialLanguageDefines() called at [/home/ideas22/public_html/sandbox/zen158/includes/init_includes/overrides/init_templates.php:105]
    #7  require_once(/home/ideas22/public_html/sandbox/zen158/includes/init_includes/overrides/init_templates.php) called at [/home/ideas22/public_html/sandbox/zen158/includes/autoload_func.php:40]
    #8  require(/home/ideas22/public_html/sandbox/zen158/includes/autoload_func.php) called at [/home/ideas22/public_html/sandbox/zen158/includes/application_top.php:237]
    #9  require(/home/ideas22/public_html/sandbox/zen158/includes/application_top.php) called at [/home/ideas22/public_html/sandbox/zen158/index.php:25]
    --> PHP Warning: require_once(includes/languages/english/email_extras.php): failed to open stream: No such file or directory in /home/ideas22/public_html/sandbox/zen158/includes/languages/sophy_blue/english.php on line 633.
    
    [08-Feb-2023 18:56:33 UTC] PHP Fatal error:  require_once(): Failed opening required 'includes/languages/english/email_extras.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/ideas22/public_html/sandbox/zen158/includes/languages/sophy_blue/english.php on line 633
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

 

 
Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. how to install free template skin into my old skin?
    By andrewmax81 in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 14 Nov 2009, 04:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR