Technology Insights

ZenCart Search Button Image Not Displaying

I installed ZenCart recently for a project I am working on and was playing around with the default design including switching some of the buttons around. I noticed that the search sidebox search button was not displaying. After a little bit of digging around I noticed an error in the code. The file that needs to be modified is the <zencart-root>/includes/templates/template_default/sideboxes/tpl_search.php template as noted below.

[quickcode:Old tpl_search.php]
* Side Box Template
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license 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>’;


It should actually look like the below.

Technology Insights

How To Easily Post Code Snippets In Your WordPress Blog

Ever since we started this site I have been struggling with posting code snippets into WordPress blog posts. First I was attempting to use the <pre> and <code> tags but they would blow out the side of my Mandingo theme with two columns. I would then try to go through the code and break the lines at the right places trying to do the formatting myself… no a brilliant idea. Justin whom also posts on this site suggested Markdown which works great. I even put some effort into learning it and don’t mind using it at all. I installed the Text Control plugin and replaced its markdown.php with Markdown Extras markdown.php file which worked like a charm. My problem was that I was still blowing out the side of my theme. After a fairly long search I found a plugin that I did not find on but directly on the developers site called QuickCode which you can locate here

Technology Errors

Compiling ruby on OS X 10.5: readline.c:703: error: ‘filename_completion_function’ undeclared

When compiling Ruby 1.8.6 (in this case, p287) on OS X 10.5, you may encounter an error similar to the following:

readline.c: In function ‘filename_completion_proc_call’:
readline.c:703: error: ‘filename_completion_function’ undeclared (first use in this function)
readline.c:703: error: (Each undeclared identifier is reported only once
readline.c:703: error: for each function it appears in.)
readline.c:703: warning: assignment makes pointer from integer without a cast
readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: warning: assignment makes pointer from integer without a cast
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1

Some sites suggest you will need to apply a series of patches to correct this issue and compile for Leopard, but this is not the case. Everything you need comes with OS X by default.