Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Possible typo in tpl_search.php sidebox

    We don't use css buttons but we do use custom buttons but button didn't show up properly in the search sidebox. Looking in tpl_search.php code I see:

    Code:
      if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
        $content .= zen_draw_input_field('keyword', '', 'class="input3"', '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', '', 'class="input3"', '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>';
      }
    However, this seems backwards and to get the custom button to show up I had to change the first line to read:

    Code:
    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'no')
    Is this a bug or something I'm misunderstanding?

    Thanks,
    Jeff

  2. #2
    Join Date
    Jan 2004
    Posts
    66,442
    Plugin Contributions
    279

    Default Re: Possible typo in tpl_search.php sidebox

    What exactly do you mean by "custom button" ?

    The logic in the file is this:
    1. if using the CSS-based buttons to replace all buttons with css-generated objects, then it builds a submit button using css image
    2. otherwise, it builds using browser image

    Sounds like you want different functionality ... to use a "regular" image, instead of browser-generated button.

    So, not exactly a bug ... just a not-yet-implemented feature.

    What you've got will "work" for your current needs, but should be refined for the feature to be implemented more efficiently.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2007
    Posts
    1
    Plugin Contributions
    0

    css problem Re: Possible typo in tpl_search.php sidebox

    Even though it's been a long time since the last post in this thread, I have the same problem as JeffD. I want to use my own button images for the search buttons. Thus I have the "CCS Buttons" switch set to off in the layout settings. It looks like that just for the search buttons Zen does not support a custom button image for searching.

    For the time being I have flipped the branches of the "if" statement in tpl_search_header.php, but this seems to be counter-intuitive. The answer from DrByte was hard to understand also because Zen does NOT appear to be using a CSS file based style here, but rather a simple hard coded size.

    One more question if you don't mind: Where are the php constants defined for switches and field names? I don't mean the text substitution constants in the various language folders, but constants such as IMAGE_USE_CSS_BUTTONS or PRODUCT_MODEL that refer to data and and switch fields. I have used the Zen toolkit search and also grep'ed the daylights out of the whole source tree and I can't find "define();" statements for these types of constants anywhere.

 

 

Similar Threads

  1. tpl_search.php 'zen_image_submit' missing ?
    By refriend in forum Bug Reports
    Replies: 1
    Last Post: 7 Aug 2007, 08:26 AM

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