Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2010
    Posts
    243
    Plugin Contributions
    5

    Default PHP Warning: explode() expects at most 3 parameters

    Hi,

    My site has started to create a few myDEBUG files and I have no idea how to fix it, (or actually what it means)
    ---
    [12-Sep-2012 14:12:00] PHP Warning: explode() expects at most 3 parameters, 41 given in /home/mrsbarnes/public_html/salon-test/includes/modules/sideboxes/salontemplate/categories.php on line 31
    [12-Sep-2012 14:12:00] PHP Warning: in_array() expects parameter 2 to be array, null given in /home/mrsbarnes/public_html/salon-test/includes/modules/sideboxes/salontemplate/categories.php on line 31
    ---

    I have added code to this file and on line 31 this is the code
    PHP Code:
     if (!isset($ezpage_id) || !in_array($ezpage_id,explode(",",',2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35'))) { 
    part of a larger block shown below
    PHP Code:
    //BOF NO CAT SIDEBOX ON EZPAGES
     
    if (!isset($ezpage_id) || !in_array($ezpage_id,explode(",",',2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35'))) {
        require(
    $template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes'). '/tpl_categories.php');

        
    $title BOX_HEADING_CATEGORIES;
        
    $title_link false;

        require(
    $template->get_template_dir($column_box_defaultDIR_WS_TEMPLATE$current_page_base,'common') . '/' $column_box_default);
        
        }
    //EOF NO CAT SIDEBOX ON EZPAGES 
    any ideas on what I have done wrong and how I can fix it?

    Thanks

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: myDEBUG files - Please help

    Quote Originally Posted by ray-the-otter View Post
    Hi,

    My site has started to create a few myDEBUG files and I have no idea how to fix it, (or actually what it means)
    ---
    [12-Sep-2012 14:12:00] PHP Warning: explode() expects at most 3 parameters, 41 given in /home/mrsbarnes/public_html/salon-test/includes/modules/sideboxes/salontemplate/categories.php on line 31
    [12-Sep-2012 14:12:00] PHP Warning: in_array() expects parameter 2 to be array, null given in /home/mrsbarnes/public_html/salon-test/includes/modules/sideboxes/salontemplate/categories.php on line 31
    ---

    I have added code to this file and on line 31 this is the code
    PHP Code:
     if (!isset($ezpage_id) || !in_array($ezpage_id,explode(",",',2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35'))) { 
    part of a larger block shown below
    PHP Code:
    //BOF NO CAT SIDEBOX ON EZPAGES
     
    if (!isset($ezpage_id) || !in_array($ezpage_id,explode(",",',2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35'))) {
        require(
    $template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes'). '/tpl_categories.php');

        
    $title BOX_HEADING_CATEGORIES;
        
    $title_link false;

        require(
    $template->get_template_dir($column_box_defaultDIR_WS_TEMPLATE$current_page_base,'common') . '/' $column_box_default);
        
        }
    //EOF NO CAT SIDEBOX ON EZPAGES 
    any ideas on what I have done wrong and how I can fix it?

    Thanks
    The errors appear to relate to the code that you added, so the real question is exactly what are/were you attempting to do that made you add that code in the first place? Whatever it was, you almost certainly need to undo it.

    Cheers
    Rod

  3. #3
    Join Date
    Jul 2010
    Posts
    243
    Plugin Contributions
    5

    Default Re: myDEBUG files - Please help

    I want to hide the categories sidebox on all ezpages. So I implemented this snippet from the Zen Cart Tutorials/FAQ section. http://www.zen-cart.com/content.php?238

    The myDEBUG are files not created every time, I'd say I had about 6 myDEBUG files for this error out of about 100 EZpage views........

    Any ideas?

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: myDEBUG files - Please help

    Code:
    explode(",",',2,3,4,5,6,7,8,9,
    You start the list in the explode with a comma; it should start with the first term. This might cause the other errors.

  5. #5
    Join Date
    Jul 2010
    Posts
    243
    Plugin Contributions
    5

    Default Re: myDEBUG files - Please help

    wow, I'd never of noticed that! Thank you for your help!!!!

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: myDEBUG files - Please help

    Actually, I think you could simplify the test. If not on an ez-page, the ez-page id should not be set at all, and if the ez-page id is set, you are on an ez-page so a test for what number it is not is undesired.
    I would make it just
    PHP Code:
    //BOF NO CAT SIDEBOX ON EZPAGES
     
    if (!isset($ezpage_id)) {
        require( 

  7. #7
    Join Date
    Jul 2010
    Posts
    243
    Plugin Contributions
    5

    Default Re: myDEBUG files - Please help

    Oh thank you, you're very kind!
    I shall give this ago as soon as I have finished the 1.5.1 updates

 

 

Similar Threads

  1. Replies: 9
    Last Post: 20 Jan 2014, 09:21 PM
  2. Replies: 2
    Last Post: 20 Jan 2014, 07:21 PM
  3. PHP Warning: str_repeat() expects exactly 2 parameters,
    By lala rock in forum General Questions
    Replies: 4
    Last Post: 28 Feb 2012, 02:44 AM
  4. htmlspecialchars() expects at most 3 parameters, 4 given
    By jewelsexports in forum General Questions
    Replies: 2
    Last Post: 10 Mar 2011, 04:00 PM
  5. Replies: 0
    Last Post: 26 Jun 2010, 12:29 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