IP4IT Staff
asked on
OScommerce online shop not working
Hi all
I have an OScommerce online shop
When i click on the link from my site to my shop i get the following error
Warning: require(DIR_WS_LANGUAGES/F ILENAME_DE FAULT) [function.require]: failed to open stream: No such file or directory in /home/cass/public_html/sho p/index.ph p on line 33
Warning: require(DIR_WS_LANGUAGES/F ILENAME_DE FAULT) [function.require]: failed to open stream: No such file or directory in /home/cass/public_html/sho p/index.ph p on line 33
Fatal error: require() [function.require]: Failed opening required 'DIR_WS_LANGUAGES/FILENAME _DEFAULT' (include_path='.:/usr/lib/ php:/usr/l ocal/lib/p hp') in /home/cass/public_html/sho p/index.ph p on line 33
Is there anything I can do to fix this myself
I have some experience in html sites but not a lot and no experience in php sites
Thanks for your help
I have an OScommerce online shop
When i click on the link from my site to my shop i get the following error
Warning: require(DIR_WS_LANGUAGES/F
Warning: require(DIR_WS_LANGUAGES/F
Fatal error: require() [function.require]: Failed opening required 'DIR_WS_LANGUAGES/FILENAME
Is there anything I can do to fix this myself
I have some experience in html sites but not a lot and no experience in php sites
Thanks for your help
It is probably caused by wrongly set permissions or ownership. Check these settings and see what they are set to. The webserver daemon (either www, www-data, apache or wwwrun) needs at least read access
"Post index.php code here so we can take a look at it."
In a vanilla installation that line is
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
In a vanilla installation that line is
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
ASKER
hi Bardobrave:
thanks for your help
hope this helps
#<?php
/*
$Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
require('includes/applicat ion_top.ph p');
// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORI ES . " where categories_id = '" . (int)$current_category_id . "'");
$cateqories_products = tep_db_fetch_array($catego ries_produ cts_query) ;
if ($cateqories_products['tot al'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($catego ry_parent_ query);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="maincont_tb">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top" class="maincont_left_td">< table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0" class="leftbar_tb">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<?php
if ($category_depth == 'nested') {
$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTI ON . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($catego ry_query);
?>
<td width="100%" valign="top" class="maincont_mid_td"><? php require(DIR_WS_INCLUDES . 'sub_header.php'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0" class="middle_tb">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_imag e'], $category['categories_name '], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_ trans.gif' , '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<?php
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array );
for($i=0, $n=sizeof($category_links) ; $i<$n; $i++) {
$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTI ON . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$categories = tep_db_fetch_array($catego ries_query );
if ($categories['total'] < 1) {
// do nothing, go through the loop
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTI ON . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTI ON . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}
$number_of_categories = tep_db_num_rows($categorie s_query);
$rows = 0;
while ($categories = tep_db_fetch_array($catego ries_query )) {
$rows++;
$cPath_new = tep_get_path($categories[' categories _id']);
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER _ROW) . '%';
echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEF AULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_im age'], $categories['categories_na me'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_na me'] . '</a></td>' . "\n";
if ((($rows / MAX_DISPLAY_CATEGORIES_PER _ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER _ROW)) && ($rows != $number_of_categories)) {
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
}
}
// needed for the new products module shown below
$new_products_category_id = $current_category_id;
?>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_ trans.gif' , '100%', '10'); ?></td>
</tr>
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
</tr>
</table></td>
</tr>
</table></td>
<?php
} elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manu facturers_ id'])) {
// create column list
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
'PRODUCT_LIST_MANUFACTURER ' => PRODUCT_LIST_MANUFACTURER,
'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
asort($define_list);
$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
if ($value > 0) $column_list[] = $key;
}
$select_column_list = '';
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
switch ($column_list[$i]) {
case 'PRODUCT_LIST_MODEL':
$select_column_list .= 'p.products_model, ';
break;
case 'PRODUCT_LIST_NAME':
$select_column_list .= 'pd.products_name, ';
break;
case 'PRODUCT_LIST_MANUFACTURER ':
$select_column_list .= 'm.manufacturers_name, ';
break;
case 'PRODUCT_LIST_QUANTITY':
$select_column_list .= 'p.products_quantity, ';
break;
case 'PRODUCT_LIST_IMAGE':
$select_column_list .= 'p.products_image, ';
break;
case 'PRODUCT_LIST_WEIGHT':
$select_column_list .= 'p.products_weight, ';
break;
}
}
// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['man ufacturers _id'])) {
if (isset($HTTP_GET_VARS['fil ter_id']) && tep_not_null($HTTP_GET_VAR S['filter_ id'])) {
// We are asked to show only a specific category
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_pr ice, NULL) as specials_new_products_pric e, IF(s.status, s.specials_new_products_pr ice, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORI ES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manuf acturers_i d'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filte r_id'] . "'";
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_pr ice, NULL) as specials_new_products_pric e, IF(s.status, s.specials_new_products_pr ice, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manuf acturers_i d'] . "'";
}
} else {
// show the products in a given categorie
if (isset($HTTP_GET_VARS['fil ter_id']) && tep_not_null($HTTP_GET_VAR S['filter_ id'])) {
// We are asked to show only specific catgeory
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_pr ice, NULL) as specials_new_products_pric e, IF(s.status, s.specials_new_products_pr ice, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORI ES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filte r_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_pr ice, NULL) as specials_new_products_pric e, IF(s.status, s.specials_new_products_pr ice, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORI ES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
}
}
if ( (!isset($HTTP_GET_VARS['so rt'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['so rt'], 0, 1) > sizeof($column_list)) ) {
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by pd.products_name";
break;
}
}
} else {
$sort_col = substr($HTTP_GET_VARS['sor t'], 0 , 1);
$sort_order = substr($HTTP_GET_VARS['sor t'], 1);
switch ($column_list[$sort_col-1] ) {
case 'PRODUCT_LIST_MODEL':
$listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_NAME':
$listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
break;
case 'PRODUCT_LIST_MANUFACTURER ':
$listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_QUANTITY':
$listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_IMAGE':
$listing_sql .= " order by pd.products_name";
break;
case 'PRODUCT_LIST_WEIGHT':
$listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_PRICE':
$listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
}
}
?>
<td width="100%" valign="top" class="maincont_mid_td"><? php require(DIR_WS_INCLUDES . 'sub_header.php'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0" class="middle_tb">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<?php
// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
if (isset($HTTP_GET_VARS['man ufacturers _id'])) {
$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORI ES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTI ON . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manuf acturers_i d'] . "' order by cd.categories_name";
} else {
$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORI ES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
}
$filterlist_query = tep_db_query($filterlist_s ql);
if (tep_db_num_rows($filterli st_query) > 1) {
echo ' <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';
if (isset($HTTP_GET_VARS['man ufacturers _id'])) {
echo tep_draw_hidden_field('man ufacturers _id', $HTTP_GET_VARS['manufactur ers_id']);
$options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
} else {
echo tep_draw_hidden_field('cPa th', $cPath);
$options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
}
echo tep_draw_hidden_field('sor t', $HTTP_GET_VARS['sort']);
while ($filterlist = tep_db_fetch_array($filter list_query )) {
$options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
}
echo tep_draw_pull_down_menu('f ilter_id', $options, (isset($HTTP_GET_VARS['fil ter_id']) ? $HTTP_GET_VARS['filter_id' ] : ''), 'onchange="this.form.submi t()"');
echo tep_hide_session_id() . '</form></td>' . "\n";
}
}
// Get the right image for the top-right
$image = DIR_WS_IMAGES . 'table_background_list.gif ';
if (isset($HTTP_GET_VARS['man ufacturers _id'])) {
$image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manuf acturers_i d'] . "'");
$image = tep_db_fetch_array($image) ;
$image = $image['manufacturers_imag e'];
} elseif ($current_category_id) {
$image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$image = tep_db_fetch_array($image) ;
$image = $image['categories_image'] ;
}
?>
<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_ trans.gif' , '100%', '10'); ?></td>
</tr>
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
</tr>
</table></td>
<?php
} else { // default page
?>
<td width="100%" valign="top" class="maincont_mid_td">
<?php require(DIR_WS_INCLUDES . 'sub_header.php'); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
</tr>
<?php
include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS );
?>
</table>
</td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_ trans.gif' , '100%', '5'); ?></td>
</tr>
</table>
<?php require(DIR_WS_INCLUDES . 'sub_footer.php'); ?>
</td>
<?php
}
?>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top" class="maincont_right_td"> <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0" class="rightbar_tb">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
thanks for your help
hope this helps
#<?php
/*
$Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
require('includes/applicat
// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query
$cateqories_products = tep_db_fetch_array($catego
if ($cateqories_products['tot
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($catego
if ($category_parent['total']
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="maincont_tb">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top" class="maincont_left_td"><
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<?php
if ($category_depth == 'nested') {
$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTI
$category = tep_db_fetch_array($catego
?>
<td width="100%" valign="top" class="maincont_mid_td"><?
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_imag
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<?php
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array
for($i=0, $n=sizeof($category_links)
$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTI
$categories = tep_db_fetch_array($catego
if ($categories['total'] < 1) {
// do nothing, go through the loop
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTI
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTI
}
$number_of_categories = tep_db_num_rows($categorie
$rows = 0;
while ($categories = tep_db_fetch_array($catego
$rows++;
$cPath_new = tep_get_path($categories['
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER
echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEF
if ((($rows / MAX_DISPLAY_CATEGORIES_PER
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
}
}
// needed for the new products module shown below
$new_products_category_id = $current_category_id;
?>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_
</tr>
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
</tr>
</table></td>
</tr>
</table></td>
<?php
} elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manu
// create column list
$define_list = array('PRODUCT_LIST_MODEL'
'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
'PRODUCT_LIST_MANUFACTURER
'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
asort($define_list);
$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
if ($value > 0) $column_list[] = $key;
}
$select_column_list = '';
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
switch ($column_list[$i]) {
case 'PRODUCT_LIST_MODEL':
$select_column_list .= 'p.products_model, ';
break;
case 'PRODUCT_LIST_NAME':
$select_column_list .= 'pd.products_name, ';
break;
case 'PRODUCT_LIST_MANUFACTURER
$select_column_list .= 'm.manufacturers_name, ';
break;
case 'PRODUCT_LIST_QUANTITY':
$select_column_list .= 'p.products_quantity, ';
break;
case 'PRODUCT_LIST_IMAGE':
$select_column_list .= 'p.products_image, ';
break;
case 'PRODUCT_LIST_WEIGHT':
$select_column_list .= 'p.products_weight, ';
break;
}
}
// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['man
if (isset($HTTP_GET_VARS['fil
// We are asked to show only a specific category
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_pr
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_pr
}
} else {
// show the products in a given categorie
if (isset($HTTP_GET_VARS['fil
// We are asked to show only specific catgeory
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_pr
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_pr
}
}
if ( (!isset($HTTP_GET_VARS['so
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by pd.products_name";
break;
}
}
} else {
$sort_col = substr($HTTP_GET_VARS['sor
$sort_order = substr($HTTP_GET_VARS['sor
switch ($column_list[$sort_col-1]
case 'PRODUCT_LIST_MODEL':
$listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_NAME':
$listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
break;
case 'PRODUCT_LIST_MANUFACTURER
$listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_QUANTITY':
$listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_IMAGE':
$listing_sql .= " order by pd.products_name";
break;
case 'PRODUCT_LIST_WEIGHT':
$listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_PRICE':
$listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
}
}
?>
<td width="100%" valign="top" class="maincont_mid_td"><?
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<?php
// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
if (isset($HTTP_GET_VARS['man
$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORI
} else {
$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORI
}
$filterlist_query = tep_db_query($filterlist_s
if (tep_db_num_rows($filterli
echo ' <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';
if (isset($HTTP_GET_VARS['man
echo tep_draw_hidden_field('man
$options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
} else {
echo tep_draw_hidden_field('cPa
$options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
}
echo tep_draw_hidden_field('sor
while ($filterlist = tep_db_fetch_array($filter
$options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
}
echo tep_draw_pull_down_menu('f
echo tep_hide_session_id() . '</form></td>' . "\n";
}
}
// Get the right image for the top-right
$image = DIR_WS_IMAGES . 'table_background_list.gif
if (isset($HTTP_GET_VARS['man
$image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manuf
$image = tep_db_fetch_array($image)
$image = $image['manufacturers_imag
} elseif ($current_category_id) {
$image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$image = tep_db_fetch_array($image)
$image = $image['categories_image']
}
?>
<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_
</tr>
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
</tr>
</table></td>
<?php
} else { // default page
?>
<td width="100%" valign="top" class="maincont_mid_td">
<?php require(DIR_WS_INCLUDES . 'sub_header.php'); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
</tr>
<?php
include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS
?>
</table>
</td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_
</tr>
</table>
<?php require(DIR_WS_INCLUDES . 'sub_footer.php'); ?>
</td>
<?php
}
?>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top" class="maincont_right_td">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php');
ASKER
hi all and thanks again
all the permissions are set to
files 644
folders 755
all the permissions are set to
files 644
folders 755
Have you set up the OsCommerce configuration file in includes/configure.php? What value does DIR_WS_INCLUDES have in there?
ASKER
hi bportlock:
the permissions on includes/configure.php were set to 777 i have changed this to 644 but still not working
is this what your looking for
thanks
define('DIR_WS_HTTP_CATALO G', '/shop/');
define('DIR_WS_HTTPS_CATAL OG', '/shop/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
the permissions on includes/configure.php were set to 777 i have changed this to 644 but still not working
is this what your looking for
thanks
define('DIR_WS_HTTP_CATALO
define('DIR_WS_HTTPS_CATAL
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS',
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES',
Seems like the system is unable to found the default value for language files when no specific language is passed.
There is a languages/ directory on your project? Does it contains any file? Have these file/s the same name/content than those on languages* directories?
There is a languages/ directory on your project? Does it contains any file? Have these file/s the same name/content than those on languages* directories?
ASKER
ASKER
"Have these file/s the same name/content than those on languages* directories?"
how can i check this?
thanks
how can i check this?
thanks
Ok, I'm guessing here so much, because I don't work usually on php, but this is what I think is happening on your project.
When accesing to the page, seems that there is no default language passed to the project, so the default language file is called.
This file should be one of the three included in your languages directory (english.php, espanol.php or german.php), and this should be defined by FILENAME_DEFAULT variable.
Probably here this variable has no value or has a value different from those three filenames, then, when the code executes, the file is not found and the error strikes.
To solve it you should modify the value of FILENAME_DEFAULT variable (I'm not sure where it can be defined) or create a file in your language directory that matches with it current value.
What language have you defined as you preferred language in your browser and what browser are you using?
When accesing to the page, seems that there is no default language passed to the project, so the default language file is called.
This file should be one of the three included in your languages directory (english.php, espanol.php or german.php), and this should be defined by FILENAME_DEFAULT variable.
Probably here this variable has no value or has a value different from those three filenames, then, when the code executes, the file is not found and the error strikes.
To solve it you should modify the value of FILENAME_DEFAULT variable (I'm not sure where it can be defined) or create a file in your language directory that matches with it current value.
What language have you defined as you preferred language in your browser and what browser are you using?
ASKER
would this file have anything to do with it
/public_html/shop/includes /boxes/lan guages.php
php
/*
$Id: languages.php,v 1.15 2003/06/09 22:10:48 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
?>
<!-- languages //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES);
new infoBoxHeading($info_box_c ontents, false, false, false, $column_location);
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
}
$languages_string = '';
reset($lng->catalog_langua ges);
while (list($key, $value) = each($lng->catalog_languag es)) {
$languages_string .= ' <a href="' . tep_href_link(basename($PH P_SELF), tep_get_all_get_params(arr ay('langua ge', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
}
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => $languages_string);
new infoBox($info_box_contents , $column_location);
?>
</td>
</tr>
<!-- languages_eof //-->
/public_html/shop/includes
php
/*
$Id: languages.php,v 1.15 2003/06/09 22:10:48 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
?>
<!-- languages //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES);
new infoBoxHeading($info_box_c
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
}
$languages_string = '';
reset($lng->catalog_langua
while (list($key, $value) = each($lng->catalog_languag
$languages_string .= ' <a href="' . tep_href_link(basename($PH
}
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => $languages_string);
new infoBox($info_box_contents
?>
</td>
</tr>
<!-- languages_eof //-->
ASKER
sorry lads
this looks more like what you are talking about
/public_html/shop/includes /classes/l anguage.ph p
<?php
/*
$Id: language.php 1739 2007-12-20 00:52:16Z hpdl $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
browser language detection logic Copyright phpMyAdmin (select_lang.lib.php3 v1.24 04/19/2002)
Copyright Stephane Garin <sgarin@sgarin.com> (detect_language.php v0.1 04/02/2002)
*/
class language {
var $languages, $catalog_languages, $browser_languages, $language;
function language($lng = '') {
$this->languages = array('ar' => 'ar([-_][[:alpha:]]{2})?|a rabic',
'bg' => 'bg|bulgarian',
'br' => 'pt[-_]br|brazilian portuguese',
'ca' => 'ca|catalan',
'cs' => 'cs|czech',
'da' => 'da|danish',
'de' => 'de([-_][[:alpha:]]{2})?|g erman',
'el' => 'el|greek',
'en' => 'en([-_][[:alpha:]]{2})?|e nglish',
'es' => 'es([-_][[:alpha:]]{2})?|s panish',
'et' => 'et|estonian',
'fi' => 'fi|finnish',
'fr' => 'fr([-_][[:alpha:]]{2})?|f rench',
'gl' => 'gl|galician',
'he' => 'he|hebrew',
'hu' => 'hu|hungarian',
'id' => 'id|indonesian',
'it' => 'it|italian',
'ja' => 'ja|japanese',
'ko' => 'ko|korean',
'ka' => 'ka|georgian',
'lt' => 'lt|lithuanian',
'lv' => 'lv|latvian',
'nl' => 'nl([-_][[:alpha:]]{2})?|d utch',
'no' => 'no|norwegian',
'pl' => 'pl|polish',
'pt' => 'pt([-_][[:alpha:]]{2})?|p ortuguese' ,
'ro' => 'ro|romanian',
'ru' => 'ru|russian',
'sk' => 'sk|slovak',
'sr' => 'sr|serbian',
'sv' => 'sv|swedish',
'th' => 'th|thai',
'tr' => 'tr|turkish',
'uk' => 'uk|ukrainian',
'tw' => 'zh[-_]tw|chinese traditional',
'zh' => 'zh|chinese simplified');
$this->catalog_languages = array();
$languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
while ($languages = tep_db_fetch_array($langua ges_query) ) {
$this->catalog_languages[$ languages[ 'code']] = array('id' => $languages['languages_id'] ,
'name' => $languages['name'],
'image' => $languages['image'],
'directory' => $languages['directory']);
}
$this->browser_languages = '';
$this->language = '';
$this->set_language($lng);
}
function set_language($language) {
if ( (tep_not_null($language)) && (isset($this->catalog_lang uages[$lan guage])) ) {
$this->language = $this->catalog_languages[$ language];
} else {
$this->language = $this->catalog_languages[D EFAULT_LAN GUAGE];
}
}
function get_browser_language() {
$this->browser_languages = explode(',', getenv('HTTP_ACCEPT_LANGUA GE'));
for ($i=0, $n=sizeof($this->browser_l anguages); $i<$n; $i++) {
reset($this->languages);
while (list($key, $value) = each($this->languages)) {
if (eregi('^(' . $value . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$ i]) && isset($this->catalog_langu ages[$key] )) {
$this->language = $this->catalog_languages[$ key];
break 2;
}
}
}
}
}
?>
this looks more like what you are talking about
/public_html/shop/includes
<?php
/*
$Id: language.php 1739 2007-12-20 00:52:16Z hpdl $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
browser language detection logic Copyright phpMyAdmin (select_lang.lib.php3 v1.24 04/19/2002)
Copyright Stephane Garin <sgarin@sgarin.com> (detect_language.php v0.1 04/02/2002)
*/
class language {
var $languages, $catalog_languages, $browser_languages, $language;
function language($lng = '') {
$this->languages = array('ar' => 'ar([-_][[:alpha:]]{2})?|a
'bg' => 'bg|bulgarian',
'br' => 'pt[-_]br|brazilian portuguese',
'ca' => 'ca|catalan',
'cs' => 'cs|czech',
'da' => 'da|danish',
'de' => 'de([-_][[:alpha:]]{2})?|g
'el' => 'el|greek',
'en' => 'en([-_][[:alpha:]]{2})?|e
'es' => 'es([-_][[:alpha:]]{2})?|s
'et' => 'et|estonian',
'fi' => 'fi|finnish',
'fr' => 'fr([-_][[:alpha:]]{2})?|f
'gl' => 'gl|galician',
'he' => 'he|hebrew',
'hu' => 'hu|hungarian',
'id' => 'id|indonesian',
'it' => 'it|italian',
'ja' => 'ja|japanese',
'ko' => 'ko|korean',
'ka' => 'ka|georgian',
'lt' => 'lt|lithuanian',
'lv' => 'lv|latvian',
'nl' => 'nl([-_][[:alpha:]]{2})?|d
'no' => 'no|norwegian',
'pl' => 'pl|polish',
'pt' => 'pt([-_][[:alpha:]]{2})?|p
'ro' => 'ro|romanian',
'ru' => 'ru|russian',
'sk' => 'sk|slovak',
'sr' => 'sr|serbian',
'sv' => 'sv|swedish',
'th' => 'th|thai',
'tr' => 'tr|turkish',
'uk' => 'uk|ukrainian',
'tw' => 'zh[-_]tw|chinese traditional',
'zh' => 'zh|chinese simplified');
$this->catalog_languages = array();
$languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
while ($languages = tep_db_fetch_array($langua
$this->catalog_languages[$
'name' => $languages['name'],
'image' => $languages['image'],
'directory' => $languages['directory']);
}
$this->browser_languages = '';
$this->language = '';
$this->set_language($lng);
}
function set_language($language) {
if ( (tep_not_null($language)) && (isset($this->catalog_lang
$this->language = $this->catalog_languages[$
} else {
$this->language = $this->catalog_languages[D
}
}
function get_browser_language() {
$this->browser_languages = explode(',', getenv('HTTP_ACCEPT_LANGUA
for ($i=0, $n=sizeof($this->browser_l
reset($this->languages);
while (list($key, $value) = each($this->languages)) {
if (eregi('^(' . $value . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$
$this->language = $this->catalog_languages[$
break 2;
}
}
}
}
}
?>
It seems to be related, but not very sure of your problem being there.
Maybe it would be intheresting to get a glimpse into the database's TABLE_LANGUAGES table and see what info it has.
Are you using a browser in a language different from english, german or spanish?
Maybe it would be intheresting to get a glimpse into the database's TABLE_LANGUAGES table and see what info it has.
Are you using a browser in a language different from english, german or spanish?
ASKER
hi Bardobrave:
my browser set to english
i have tried firefox and ie8 and have the same issue in both
i have also tried from a few workstations and the same result
i will look into how to get the database's TABLE_LANGUAGES and post them up
thanks for your help
my browser set to english
i have tried firefox and ie8 and have the same issue in both
i have also tried from a few workstations and the same result
i will look into how to get the database's TABLE_LANGUAGES and post them up
thanks for your help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here seems to be some path error with DIR_WS_LANGUAGES/FILENAME_
Post index.php code here so we can take a look at it.