Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Location
    Philadelphia, PA, USA
    Posts
    33
    Plugin Contributions
    0

    bug tpl_search.php 'zen_image_submit' missing ?

    Concerning zen-cart-v1.3.7.1-full-patched-07052007 (and 1.3.6 and 1.3.7)...

    Under it's current configuration the 'BUTTON_IMAGE_SEARCH' (button_search.gif) is never drawn.

    I believe that '/includes/templates/template_default/sideboxes/tpl_search.php' is missing a small piece of code, specifically a 'zen_image_submit' command in the 'else' section.

    Current Code (it is a small file so I have inserted it full for clarity)
    Code:
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_search.php 4142 2006-08-15 04:32:54Z drbyte $
     */
      $content = "";
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
      $content .= zen_draw_form('quick_find', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
      $content .= zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT);
      $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();
    
      if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
        $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"') . '<br />' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
        $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
      } else {
        $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . '<br /><input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 50px" />';
        $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
      }
    
      $content .= "</form>";
      $content .= '</div>';
    ?>
    Suggested Corrected Code
    Code:
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_search.php 4142 2006-08-15 04:32:54Z drbyte $
     */
      $content = "";
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
      $content .= zen_draw_form('quick_find', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
      $content .= zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT);
      $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();
    
      if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
        $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"') . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
        $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '" class="smallText">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
      } else {
        $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . zen_image_submit(BUTTON_IMAGE_SEARCH, HEADER_SEARCH_BUTTON);
        $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '" class="smallText">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
      }
    
      $content .= "</form>";
      $content .= '</div>';
    ?>
    Additionally, the addition of 'vertical-align:middle;' to the stylesheet fixes alignment issues.

    Code:
    form, select, input {
    font-size: 1em;
    padding: 0.1em;
    vertical-align:middle;
    }

  2. #2
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default Re: tpl_search.php 'zen_image_submit' missing ?

    Please don't forget to change the code in both side box tpl_search.php and tpl_search_header.php as they have both been coded incorrectly in both files.

 

 

Similar Threads

  1. zen_image_submit
    By davehandley33 in forum General Questions
    Replies: 6
    Last Post: 3 Feb 2014, 11:02 PM
  2. Close php ?> missing from meta_tags.php
    By makenoiz in forum Upgrading to 1.5.x
    Replies: 3
    Last Post: 15 Oct 2012, 09:43 PM
  3. Possible typo in tpl_search.php sidebox
    By JeffD in forum General Questions
    Replies: 2
    Last Post: 7 Oct 2008, 11:47 PM

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