Forums / General Questions / Possible typo in tpl_search.php sidebox

Possible typo in tpl_search.php sidebox

Locked
Results 1 to 3 of 3
This thread is locked. New replies are disabled.
13 Sep 2006, 16:42
#1
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

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:

  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:

if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'no')


Is this a bug or something I'm misunderstanding?

Thanks,
Jeff
15 Sep 2006, 04:23
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

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.
07 Oct 2008, 22:47
#3
seclectic avatar

seclectic

New Zenner

Join Date:
Jun 2007
Posts:
1
Plugin Contributions:
0

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. :shocking: