Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 60
  1. #21
    Join Date
    Sep 2006
    Location
    Jacksonville, FL
    Posts
    236
    Plugin Contributions
    0

    help question Re: Switching templates at run time

    Sorry for the confusion, kuroi... I'll try changing the flash where its embedded instead of the whole template... Do you know where I should do this? Also, Id like for my subcategories of video to have the same swf as my video category, the software sub-cats to have the same swf as my software cat etc.
    John L.
    MultiMedia Designer

  2. #22
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    database error Re: Switching templates at run time

    You would do it where you embedded the flash file.

    There are two possible solutions for having the categories and sub categories display the same flash movie. The simplest to implement would be to simply give each case a list of categories in string form upon which to act e.g.
    case "1":
    case "1_3":
    case "1_4":
    case "1_5":
    <code to embed 1st flash movie>;
    break;

    case: "2":
    case: "2_6":
    case: "2_7":
    <code to embed 2nd flash movie>;
    break;

    etc.
    But this is crude and a pain to maintain, so better would be to right a small PHP string function to return anything before an underscore, and call it to get the top level category and throw away the rest of the $_GET['cPath'].
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #23
    Join Date
    Sep 2006
    Location
    Jacksonville, FL
    Posts
    236
    Plugin Contributions
    0

    help question Re: Switching templates at run time

    kuroi,

    i dont have very much experience with PHP so dont laugh too hard when ya see this. i believe my flash is embedded in my tpl_header. heres what i have in my tpl_header:

    Code:
    <?php 
    
    case: "1":
    echo get_flashed('header','820','113'); 
    break;
    
    case: "2":
    case: "2_6":
    echo get_flashed('header_video','820','113');
    break;
    
    ?>
    and im getting the following error:

    Code:
    Parse error: parse error, unexpected T_CASE in /home/content/s/t/u/studiostyles/html/TEST/includes/templates/jlawless/common/tpl_header.php on line 89
    Not sure where i went wrong there... any help outta this mess would be appreciated.
    John L.
    MultiMedia Designer

  4. #24
    Join Date
    Sep 2006
    Location
    Jacksonville, FL
    Posts
    236
    Plugin Contributions
    0

    Default Re: Switching templates at run time

    OK! Ive got the "crude" version working and I can see why it would be crude because i would have to keep repeating these cases for all of my categories plus id have to remember to do this every time i needed to upload

    Code:
     if($_GET['cPath']) {
        switch($_GET['cPath']) {
    case 1: //sports
    echo get_flashed('header','820','113');
    break;
    case 2: //event holiday
    echo get_flashed('header','820','113');
    break;
    case 6: //video
    echo get_flashed('header_video','820','113'); 
    break;
      }
     }

    how would i go about doing this?
    But this is crude and a pain to maintain, so better would be to right a small PHP string function to return anything before an underscore, and call it to get the top level category and throw away the rest of the $_GET['cPath'].
    John L.
    MultiMedia Designer

  5. #25
    Join Date
    Sep 2006
    Location
    Jacksonville, FL
    Posts
    236
    Plugin Contributions
    0

    help question Re: Switching templates at run time

    ALSO, when I add a product to the category... i get the following error message:

    Code:
    Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/t/u/studiostyles/html/TEST/includes/application_top.php:263) in /home/content/s/t/u/studiostyles/html/TEST/includes/functions/functions_general.php on line 81
    anyone know what that might be about?
    John L.
    MultiMedia Designer

  6. #26
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Switching templates at run time

    In a clean install of the current version of Zen Cart, the line referenced by your error is in the middle of a comment block so couldn't have caused the problem.

    I rather assume therefore assume that you are either using an older version, or have modded the current version with something that has replaced the default functions_general file. Could you provide more background?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #27
    Join Date
    Sep 2006
    Location
    Jacksonville, FL
    Posts
    236
    Plugin Contributions
    0

    Default Re: Switching templates at run time

    Im using zc version 1.3.5. i am also using the nnez_flo mod for my flash. does this mean i need to upgrade or can i just modify the functions_general.php?
    John L.
    MultiMedia Designer

  8. #28
    Join Date
    Sep 2006
    Location
    Jacksonville, FL
    Posts
    236
    Plugin Contributions
    0

    help question Re: Switching templates at run time

    here is the code found around that line in the functions_general.php:

    Code:
    // clean up URL before executing it
    
      while (strstr($url, '&&')) $url = str_replace('&&', '&', $url);
    
      while (strstr($url, '&amp;&amp;')) $url = str_replace('&amp;&amp;', '&amp;', $url);
    
      // header locates should not have the &amp; in the address it breaks things
    
      while (strstr($url, '&amp;')) $url = str_replace('&amp;', '&', $url);
    
    
    
        header('Location: ' . $url);
    
    
    
        zen_exit();
    
      }
    John L.
    MultiMedia Designer

  9. #29
    Join Date
    Sep 2006
    Location
    Jacksonville, FL
    Posts
    236
    Plugin Contributions
    0

    Default Re: Switching templates at run time

    My flash does not come up at all in my index or any other page that doesnt contain a cPath. Here's my code:

    Code:
     if(isset($_GET['cPath'])) {
        switch((int)$_GET['cPath']) {
    case 6: //video - change out case numbers with category id numbers
    echo get_flashed('header_video','820','113'); 
    break;
    case 7: //software - change out case numbers with category id numbers
    echo get_flashed('header_software','820','113'); 
    break;
    default: //default
    echo get_flashed('header_templates','820','113');
    break;
      }
     }
    John L.
    MultiMedia Designer

  10. #30
    Join Date
    Sep 2006
    Location
    Jacksonville, FL
    Posts
    236
    Plugin Contributions
    0

    Idea or Suggestion Re: Switching templates at run time

    SOLUTION:

    i fixed the last problem with the following:

    Code:
    <?php
       
     if(isset($_GET['cPath'])) {
        switch((int)$_GET['cPath']) {
    case 6: //video - change out case numbers with category id numbers
    echo get_flashed('header_video','820','113'); 
    break;
    case 7: //software - change out case numbers with category id numbers
    echo get_flashed('header_software','820','113'); 
    break;
    default: //default
    echo get_flashed('header_templates','820','113');
    break;
      }
     }
     else echo get_flashed('header_templates','820','113');
    ?>
    seems to work so far....

    Still dont know what the prob is with getting the following error when i add a product to my category:

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/t/u/studiostyles/html/TEST/includes/application_top.php:263) in /home/content/s/t/u/studiostyles/html/TEST/includes/functions/functions_general.php on line 81
    John L.
    MultiMedia Designer

 

 
Page 3 of 6 FirstFirst 12345 ... LastLast

Similar Threads

  1. switching templates
    By RichardH in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Jul 2008, 10:36 PM
  2. Switching php version in WAMP5 causes install to run
    By GreggShort in forum Installing on a Windows Server
    Replies: 2
    Last Post: 27 Jul 2007, 06:06 AM
  3. switching between templates
    By fairview in forum General Questions
    Replies: 4
    Last Post: 9 Apr 2007, 02:44 PM
  4. switching templates
    By onakat in forum Customization from the Admin
    Replies: 6
    Last Post: 3 Apr 2007, 10:18 AM

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