Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Letter 'n' on some category pages?!?


Guest

Recommended Posts

The site URL is http://www.wiredco.com/catalog/index.php

Any category with subcats is adding an 'n' for each subcat... very odd.

 

Click 'Adapters' to see a row of 12 'n' below the word 'Categories' but above the subcats (12 subcats here)

 

Click 'Ham Radio' to see 3 'n' (3 subcats here)

 

 

I'm sure it's a silly typo in the code, but where?

 

Thank you for taking the time to help!

 

:blink:

Link to comment
Share on other sites

They are in the code that is constructing the expanded sub categories on your left, but because in the code they falling in between </td>n<tr> tags and the like they are output in the main content.

 

                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_54"><br>DVI to SVGA</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_45"><br>F Adapters</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_44"><br>Gender Changers</a></td>n              </tr>n              <tr>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_46"><br>Keyboard</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_55"><br>Mouse</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_47"><br>Null Modem</a></td>n              </tr>n              <tr>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_48"><br>Power Supply</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_49"><br>RCA</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_57"><br>RJ45</a></td>n              </tr>n              <tr>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_58"><br>S-Video</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_50"><br>Serial</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_103"><img src="images/M73101.jpg" border="0" alt="Telephone" title=" Telephone " width="100" height="80"><br>Telephone</a></td>n              </tr>n              <tr>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_51"><br>USB</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_52"><br>VGA</a></td>n                <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.wiredco.com/catalog/index.php?cPath=22_53"><br>XLR</a></td>n              </tr>

 

I think they should be \n, which puts a new line in the html code (which formats the HTML if you look at the source for the page, has no effect to the page as the user sees it).

 

You'll need to look at the code where the categories menu is constructed, they must be in there somewhere

Link to comment
Share on other sites

Ugh... I've spent too much time trying to find this little error. I know just enough about osCommerce to be dangerous, but this one is eluding me.

 

Can anyone point me to a specific file to pore over? I understand the nature of the problem and the resolution, but not the location...

 

 

Cheers!

 

 

 

 

They are in the code that is constructing the expanded sub categories on your left, but because in the code they falling in between </td>n<tr> tags and the like they are output in the main content.

I think they should be \n, which puts a new line in the html code (which formats the HTML if you look at the source for the page, has no effect to the page as the user sees it).

 

You'll need to look at the code where the categories menu is constructed, they must be in there somewhere

Link to comment
Share on other sites

My guess is that you edited your language files (maybe other files as well?) using the file manager that comes with osCommerce. There is a bug in it that will add the n to pages. Never ever use the file manager. Although I think the n shows up where the words are, not like it is doing here... so I am unsure.

 

If you have used the editer and need a place to start I would start with the catalog/includes/languages/english.php and probably the catalog/includes/languages/english/index.php files.

 

There are many other threads about the n or \n so you may want to look around. There may be other suggestions.

 

 

Or as mike suggested you could try looking at your catalog/includes/boxes/catagories.php for a floating n in there somewhere.

 

You might also want to take a look at your index.php file. The more I think about it the more this makes sense... Look for this or something very close to this, mine may be a bit different I have edited the page but it is close to the beginning of the file.

<?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_DESCRIPTION . " 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($categories_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_DESCRIPTION . " 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_DESCRIPTION . " 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($categories_query);

? ?$rows = 0;
? ?while ($categories = tep_db_fetch_array($categories_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_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</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;
?>

There may be a floating n in there that could be causing the problem because the n is showing up above where the subcatagories are listed.

 

 

 

 

Trying to think where else it could be... but those are the only things that come to mind. If I think of anything else I will be back. lol :)

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

My guess is....... but those are the only things that come to mind. If I think of anything else I will be back. lol :)

 

Thank you! I was getting a headache, so I switched to product entry for a while. I think I may have used the File Manager exactly once, that will teach me.... :lol:

 

Great information, I'll have a look and report back what I find for the future benefit of others in the same situation.

 

Again, a warm thank you from yours truly....

Link to comment
Share on other sites

The site URL is http://www.wiredco.com/catalog/index.php

Any category with subcats is adding an 'n' for each subcat... very odd.

 

Click 'Adapters' to see a row of 12 'n' below the word 'Categories' but above the subcats  (12 subcats here)

 

Click 'Ham Radio' to see 3 'n' (3 subcats here)

I'm sure it's a silly typo in the code, but where?

 

Thank you for taking the time to help!

 

:blink:

 

Hi,

 

Please have a look here:

 

Solution

 

Regards,

Edze

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...