Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

southerngirl

Archived
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Real Name
    Alexis Berenger

southerngirl's Achievements

  1. Ok after lots and lots of time looking :-" :-" , I found the file I need to edit so I can insert the default search function back into the main page. burt was right, they butchered the whole template :blink: Now hopefully some kind soul on this forum can tell help me and show me where and how to put in the simple default search function based on the code below :blush: (I am hoping to save a little money :blush: :blush: so I don't have to hire some coder to insert a simple search function into the code below ) To make it easier for you to see where the code needs to be inserted, I marked the area below in Red. If anyone could help me with this, I would truly appreciate it. Thanks in advance ;) <?php /* $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> <!-- <? // ---- MANUFACTURERS $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); if ($number_of_rows = tep_db_num_rows($manufacturers_query)) { echo '<table cellspacing=0 cellpadding=0 width=177 align=center> '. tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get') .' <tr><td colspan=2><b>Search by manufacturers:</b></td></tr> <tr><td height=2 colspan=2></td></tr> <tr><td colspan=2> '; $manufacturers_array = array(); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']); $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers_name); } echo tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" class=se1') . tep_hide_session_id(); echo ' </td> </form> </table> '; } ?> --> <table cellspacing=0 cellpadding=0 width=747 align=center> <tr><td valign=top> <table cellspacing=0 cellpadding=0> <tr><td width=248><a href=<?=tep_href_link('index.php')?>><img src=images/m01.gif width=248 height=88 border=0></a></td> <td width=499 valign=top> <table cellspacing=0 cellpadding=0 width=499> <tr><td bgcolor=#F4F0ED height=45></td></tr> <tr><td bgcolor=#EFE8E2 height=43> <table cellspacing=0 cellpadding=0> <form> <tr><td width=97 align=right class=ch1>Currencies:</td> <td width=136> <? // CURRENCIES echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'); reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit(); "class=se style="width:106px; font-size: 9px" ') . $hidden_get_variables . tep_hide_session_id(); echo '</form>'; ?> </td> <td bgcolor=#D5C9BE width=1 height=30></td> <td width=18></td> <td><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/m02.gif width=15 height=17 border=0></a></td> <td> <span class=ch1>Shopping Cart</span> <span class=ch2>now in your cart</span> <a class=ml1 href=<?=tep_href_link('shopping_cart.php')?>><?=$cart->count_contents()?> items</a></td> </tr> </form> </table> </td></tr> </table> </td> </tr> </table> </td></tr> <tr><td valign=top> <table cellspacing=0 cellpadding=0> <tr><td width=248 valign=top> <table cellspacing=0 cellpadding=0> <tr><td><img src=images/m04.gif width=248 height=17></td></tr> <tr><td><a href=<?=tep_href_link('index.php')?>><img src=images/b01.gif width=248 height=30 border=0></a></td></tr> <tr><td><a href=<?=tep_href_link('about_us.php')?>><img src=images/b02.gif width=248 height=30 border=0></a></td></tr> <tr><td><a href=<?=tep_href_link('products_new.php')?>><img src=images/b03.gif width=248 height=30 border=0></a></td></tr> <tr><td><a href=<?=tep_href_link('account.php')?>><img src=images/b04.gif width=248 height=30 border=0></a></td></tr> <tr><td><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/b05.gif width=248 height=30 border=0></a></td></tr> <tr><td><a href=<?=tep_href_link('checkout_shipping.php')?>><img src=images/b06.gif width=248 height=30 border=0></a></td></tr> <tr><td><img src=images/m05.gif width=248 height=12></td></tr> </table> </td> <td><img src=images/m06.gif width=252 height=209><a href=<?=tep_href_link('products_new.php')?>><img src=images/m07.gif width=247 height=209 border=0></a></td></tr> </table> </td></tr> <tr><td> <table cellspacing=0 cellpadding=0> <tr><td width=248 valign=top> <table cellspacing=0 cellpadding=0 width=248> <tr><td bgcolor=#FBE3AC height=26 valign=top> <table cellspacing=0 cellpadding=0> <tr><td height=9></td></tr> <tr><td width=142 class=ch1 align=right>Choose your language:</td> <td> <? // LANGUAGES if (!isset($lng) || (isset($lng) && !is_object($lng))) { include(DIR_WS_CLASSES . 'language.php'); $lng = new language; } $languages_string = ''; reset($lng->catalog_languages); while (list($key, $value) = each($lng->catalog_languages)) { $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; } echo $languages_string; ?> </td></tr> </table> CODE FOR SEARCH FUNCTION SHOULD BE INSERTED HERE </td></tr> <tr><td background=images/m11.gif width=248 height=33 valign=top> <table cellspacing=0 cellpadding=0> <tr><td height=11></td></tr> <tr><td class=ch4><span class=ch3>Shop by brand</span></td></tr> </table> </td></tr> <tr><td bgcolor=#F2EADC width=248> <table cellspacing=0 cellpadding=0 width=239 align=center> <tr><td height=5></td></tr> <? // ---- MANUFACTURERS STRING OUTPUT $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); if ($number_of_rows = tep_db_num_rows($manufacturers_query)) { $manufacturers_array = array(); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $output .= $output ? '<tr><td height=1></td></tr>' : ''; $output .= '<tr><td><img src=images/m12.gif width=19 height=19></td><td bgcolor=#E7DCCB width=220 height=19 class=ch5><a class=ml2 href='; $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']); $output .= tep_href_link('index.php', 'manufacturers_id='.$manufacturers['manufacturers_id']). '>'.$manufacturers_name; $output .= '</a></td></tr>'; } echo $output; } ?> <tr><td height=5></td></tr> </table> </td></tr> <tr><td background=images/m14.gif width=248 height=29 valign=top> <table cellspacing=0 cellpadding=0> <tr><td height=8></td></tr> <tr><td class=ch4><span class=ch3>Product Categories</span></td></tr> </table> </td></tr> <tr><td bgcolor=#EEE3D0 width=248 valign=top align=center> <table cellspacing=0 cellpadding=0 width=239 align=center> <tr><td height=5></td></tr> <? // ---- CATEGORIES function tep_show_category($counter) { global $tree, $categories_string, $cPath_array; if(!$tree[$counter]['level']){ $categories_string .= $categories_string ? '<tr><td height=1></td></tr>' : ''; $categories_string .= '<tr><td width=19 height=19><img src=images/m12.gif width=19 height=19></td><td bgcolor=#E7DCCB> <a class=ml2 href='; if ($tree[$counter]['parent'] == 0) { $cPath_new = 'cPath=' . $counter; } else { $cPath_new = 'cPath=' . $tree[$counter]['path']; } $categories_string .= tep_href_link('index.php', $cPath_new) . '>'; // display categry name $categories_string .= $tree[$counter]['name']; $categories_string .= '</a></td></tr>'; }else{ // SUBCATEGORY $categories_string .= '<tr><td width=19 height=19><img src=images/m12.gif width=19 height=19></td><td bgcolor=#E7DCCB> '; for($i=0;$i<$tree[$counter]['le vel'];$i++) $categories_string .= ' '; $categories_string .= ' <a class=ml2 style="font-weight:normal;" href='; if ($tree[$counter]['parent'] == 0) { $cPath_new = 'cPath=' . $counter; } else { $cPath_new = 'cPath=' . $tree[$counter]['path']; } $categories_string .= tep_href_link('index.php', $cPath_new) . '>-'; // display category name $categories_string .= $tree[$counter]['name']; $categories_string .= '</a></td></tr>'; } if ($tree[$counter]['next_id'] != false) { tep_show_category($tree[$counter]['next_id']); } } define(TABLE_CATEGORIES, "categories"); define(TABLE_CATEGORIES_DESCRIPTION, "categories_description"); $categories_string = ''; $tree = array(); $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { $tree[$categories['categories_id']] = array('name' => $categories['categories_name'], 'parent' => $categories['parent_id'], 'level' => 0, 'path' => $categories['categories_id'], 'next_id' => false); if (isset($parent_id)) { $tree[$parent_id]['next_id'] = $categories['categories_id']; } $parent_id = $categories['categories_id']; if (!isset($first_element)) { $first_element = $categories['categories_id']; } } //------------------------ if ($cPath) { $new_path = ''; reset($cPath_array); while (list($key, $value) = each($cPath_array)) { unset($parent_id); unset($first_id); $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); if (tep_db_num_rows($categories_query)) { $new_path .= $value; while ($row = tep_db_fetch_array($categories_query)) { $tree[$row['categories_id']] = array('name' => $row['categories_name'], 'parent' => $row['parent_id'], 'level' => $key+1, 'path' => $new_path . '_' . $row['categories_id'], 'next_id' => false); if (isset($parent_id)) { $tree[$parent_id]['next_id'] = $row['categories_id']; } $parent_id = $row['categories_id']; if (!isset($first_id)) { $first_id = $row['categories_id']; } $last_id = $row['categories_id']; } $tree[$last_id]['next_id'] = $tree[$value]['next_id']; $tree[$value]['next_id'] = $first_id; $new_path .= '_'; } else { break; } } } $categories_string .= ''; tep_show_category($first_element); $categories_string .= ''; echo $categories_string; ?> <tr><td height=5></td></tr> </table> </td></tr> </table> </td> <td width=499 valign=top> <table cellspacing=0 cellpadding=0> <tr><td><a href=<?=tep_href_link('index.php','cPath=61')?>><img src=images/m16.gif width=248 height=105 border=0></a><a href=<?=tep_href_link('index.php','cPath=63')?>><img src=images/m17.gif width=251 height=105 height=105 border=0></a></td></tr> </table>
  2. Thanks Coopco, I'll try that, that should give it some protection :thumbsup: Any ideas on how I could add the default search function on the main page? I have no idea the exact code that I would need. :huh:
  3. That's where I bought the template from (template monster) :( Do you know the code to add the default search function back to the main page? Anyone that can help me, it would be greatly appreciated :)
  4. Hi, I tried telling them but all I got was the run around like they are not responsible for the security issues because it was outsourced work they contracted out to a programmer :( And when I asked them about how to add the default search function on the main page, they said they could not give me support on doing it because I would be modifying their template :( That's why I thought I would post here to see if I anyone could help me :blush: :huh:
  5. Hi, I have the template below but I'm having all kinds of problems setting it up and the place where I got the template is not very helpful :( They seem more content with just brushing me aside after they collected their money :( http://osc.template-help.com/10064/index.php First, when I installed the template, it automatically defaulted to the german language and it won't let me reset it to English. So now I have to manually change each file so it will be in english. Does anyone know of a way of switching it to English? Secondly, the /admin directory is NOT user/password protected so anyone could just type /admin and get full access to the administrative portion without entering a user/pass. I know the default oscommerce software has a user login for the admin part. Talk about security risk with the template I have :( :( Anyone know how I can fix this problem? I love the look of the template so I want to stick with it but my main question is this: On the front page of the template that I have above, I want to add the default search box underneath the "Checkout" link on the left menu (just above the "Choose your language" option). Does anyone know which file specifically I will have to edit so I can add that option? And what code I will have to type? Please help, I would really appreciate it :blush:
×
×
  • Create New...