Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Display error, please help :(


Guest

Recommended Posts

Posted

error_manufacturers.jpg

 

Thats what is look like on my front of shop.

 

My admin Max value setting: Length of Manufacturers Name is 18.

 

The Manufacturers dropdown boxs are perfectly fine in any other pages with full name showing but my shop index page.

 

Has anyone came cross same problem before? PLease Please Help. I want to Change box title from Manufacturers to Brand. It is very important for me to sort out this lil error.

 

Thanks

Posted

You want to change "Manufacturers" to "Brand" everywhere it's used? Look for the string 'Manufacturers' in these files: admin/includes/languages/english.php, admin/includes/languages/english/manufacturers.php, includes/languages/english.php and change to 'Brand'. Some files have more than one entry. I'm assuming that you're using ISO-8859-1 encoding. If not, check if some other "language" is in use, such as "english-utf8".

 

As for only 5 letters showing, that shouldn't be hard. Check your database (with phpMyadmin, or with the admin tools), to see if the configuration table sets Length of Manufacturers Name to be only 5. If so, increase it to some reasonable amount. The installation default was 15, so someone was fooling with it.

Posted

You want to change "Manufacturers" to "Brand" everywhere it's used? Look for the string 'Manufacturers' in these files: admin/includes/languages/english.php, admin/includes/languages/english/manufacturers.php, includes/languages/english.php and change to 'Brand'. Some files have more than one entry. I'm assuming that you're using ISO-8859-1 encoding. If not, check if some other "language" is in use, such as "english-utf8".

 

Yer those files are ISO-8859-1 encoding

 

 

// look in your $PATH_LOCALE/locale directory for available locales

// or type locale -a on the server.

// Examples:

// on RedHat try 'en_US'

// on FreeBSD try 'en_US.ISO_8859-1'

// on Windows try 'en', or 'English'

@setlocale(LC_TIME, 'en_GB.ISO_8859-1');

 

As for only 5 letters showing, that shouldn't be hard. Check your database (with phpMyadmin, or with the admin tools), to see if the configuration table sets Length of Manufacturers Name to be only 5. If so, increase it to some reasonable amount. The installation default was 15, so someone was fooling with it.

 

My database value is same as shown in my store admin section as 18.

I tried to change to 6, 10, 15,16 but no affect on my shop. My manufacturers dropdown boxes are now all showing as pic above. What went wrong?

 

Thanks

Posted

That's odd. Your site is behaving as though the entry is 4, not 18. Look in includes/boxes/manufacturers.php and see if the code has been modified by an add-on. The original code is

      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']);

It appears twice in the file. Note that it's not particularly well written... it should be allowing another character (or maybe two) for the untruncated name, to allow for the "..", and the outermost () are unneeded. But anyway, MAX_DISPLAY_MANUFACTURER_NAME_LEN is what comes out of the database from entry Length of Manufacturers Name (or, at least in unmodified code). Perhaps some add-on or custom coding has fooled with it? As I said, the default is 15, and you say that it's been changed to 18, yet it's using only 4! These are plain ASCII names -- no UTF-8 or other multibyte encodings? No hidden junk in the names, such as NULs (00 bytes)?

Posted

Below is the includes/boxes/manufacturers.php

 

I used file compare tool to compare mine with virgin osc install files. No change found :(

 

 

<?php

/*

$Id: manufacturers.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

$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 //-->

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_MANUFACTURERS);

 

new infoBoxHeading($info_box_contents, false, false);

 

if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {

// Display a list

$manufacturers_list = '';

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']);

if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';

$manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';

}

 

$manufacturers_list = substr($manufacturers_list, 0, -4);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => $manufacturers_list);

} else {

// Display a drop-down

$manufacturers_array = array();

if (MAX_MANUFACTURERS_LIST < 2) {

$manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);

}

 

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);

}

 

$info_box_contents = array();

$info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),

'text' => 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 . '" style="width: 100%"') . tep_hide_session_id());

}

 

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- manufacturers_eof //-->

<?php

}

?>

Posted

Hi Mr Phil

 

I looked at my admin cache control, the manufacturers box file has not been updated since yesterday. so I tried to clear my cache file under admin - cache control - Manufacturers box.

 

And my problem is solved. :D

 

Now I am just wondering is it cos my cache folder permission not set right at first?

My cache folder is 777

All files under /catalog/cache/xxx.php are 644

 

Are they right permission?

 

Thanks.

Kai

Posted

644 sounds right for any file. 777 for a directory is a bit suspicious -- I would try 755 first, and only if it doesn't work, 775 and then (as a last resort) 777. 777 is hazardous because any other user sharing your server can write to the directory. If it's only being used as cache, that may not cause problems with your store operation, but still, someone could possibly "borrow" your cache directory to store illegal movie downloads and such stuff. That would be a headache.

 

 

Thanks for your advice mr phil. I will change my cache directory to 755. I dont think there is any problem on my server side as as long as I use SSH to change permission. If my shop doesnt run properly after this change, then I will try 775.

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...