Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

infobox header not working on categories box


lindsayanng

Recommended Posts

Posted

I have been trying non stop to get my infobox headerto show in my categories box. i tried to do it on my own first, and when that failed, i resorted to a contribution..

 

here is the code for the box:

 

<?php
/*
 $Id: categories.php,v 1.23 2002/11/12 14:09:30 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 function tep_show_category($counter) {
global $foo, $categories_string, $id;

for ($a=0; $a<$foo[$counter]['level']; $a++) {
  $categories_string .= "  ";
}

$categories_string .= '<a href="';

if ($foo[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $foo[$counter]['path'];
}

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
$categories_string .= '">';

if ( ($id) && (in_array($counter, $id)) ) {
  $categories_string .= '<b>';
}

// display category name
$categories_string .= $foo[$counter]['name'];

if ( ($id) && (in_array($counter, $id)) ) {
  $categories_string .= '</b>';
}

if (tep_has_category_subcategories($counter)) {
  $categories_string .= '->';
}

$categories_string .= '</a>';

if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= ' (' . $products_in_category . ')';
  }
}

$categories_string .= '<br>';

if ($foo[$counter]['next_id']) {
  tep_show_category($foo[$counter]['next_id']);
}
 }
?>
<!-- categories //-->

<!-- This is where you will include you custom box header, left column and open up your Cell for your center column
Make sure you leave the first 2 tags in here "<tr> and <td>"  they maintain the control over your entire page.
If you remove these tags all of you info will be shifted below you categories box on your pages.  If you dont
Believe me, try it....lol. //-->

<tr>
 <td> 
<table width="144" border="0" cellspacing="0" cellpadding="1" class="infoboxborder">
  <tr>
	<td>		  <table width=100% border=0 cellpadding=0 cellspacing=0 class="infoBoxContents">
		<tr> 
		  <td colspan=3 width="100%"> <img src="images/boxes/table_categories.gif"></td>
		</tr>
		<tr> 
		  <td width="100%"> 
			<?php
$categories_string = '';

 $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='" . $languages_id ."' order by sort_order, cd.categories_name");
 while ($categories = tep_db_fetch_array($categories_query))  {
$foo[$categories['categories_id']] = array(
									'name' => $categories['categories_name'],
									'parent' => $categories['parent_id'],
									'level' => 0,
									'path' => $categories['categories_id'],
									'next_id' => false
								   );

if (isset($prev_id)) {
  $foo[$prev_id]['next_id'] = $categories['categories_id'];
}

$prev_id = $categories['categories_id'];

if (!isset($first_element)) {
  $first_element = $categories['categories_id'];
}
 }

 //------------------------
 if ($cPath) {
$new_path = '';
$id = split('_', $cPath);
reset($id);
while (list($key, $value) = each($id)) {
  unset($prev_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 = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
  $category_check = tep_db_num_rows($categories_query);
  if ($category_check > 0) {
	$new_path .= $value;
	while ($row = tep_db_fetch_array($categories_query)) {
	  $foo[$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($prev_id)) {
		$foo[$prev_id]['next_id'] = $row['categories_id'];
	  }

	  $prev_id = $row['categories_id'];

	  if (!isset($first_id)) {
		$first_id = $row['categories_id'];
	  }

	  $last_id = $row['categories_id'];
	}
	$foo[$last_id]['next_id'] = $foo[$value]['next_id'];
	$foo[$value]['next_id'] = $first_id;
	$new_path .= '_';
  } else {
	break;
  }
}
 }
 tep_show_category($first_element); 

 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
						   'text'  => $categories_string
						  );
 new infoBox($info_box_contents);
?>
			<!-- This is where you will close your center cell and include your right side of your box
and then finally close out your custom box.  Be sure and leave the "</td> and </tr>" tags.
they ensure the sanctity of your overall page layout. //-->
		  </td>
		</tr>
	  </table>
	</td>
  </tr>
</table>	
 </td>
</tr>


<!-- categories_eof //-->

 

The image is there, but the issue is that the website isnt even showing broken image, its still using the basic oscommerce header.. Is there something overriding that box??

 

Any help is greatly appreicated

 

to see it in action, go here

www.bscphoto.com/catalog

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted

Is your cache enabled? If so go to admin-->tools. Select cache. Click the icon on the far right of categories to clear the cache.

Posted

yep.. I did a shft + refresh which automatically resets the cache in my browser. I always use that when i make changes rhat i want to see right away.. this is the ONLY one that will not show..

 

you check it.. i'm sure your browser would DEFINITELY show it if it WAS there.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted
yep.. I did a shft + refresh which automatically resets the cache in my browser. I always use that when i make changes rhat i want to see right away.. this is the ONLY one that will not show..

 

you check it.. i'm sure your browser would DEFINITELY show it if it WAS there.

No No. I'm talking about the cache control in osc. If you are using that then you need to reset the cache from osc's admin.

Posted

yea. i just did that and it did nothing. i still am not getting the image.. but i thought that when you shft=refresh, you get a fresh page that also resets the cache.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted

Are you sure you uploaded that file as categories.php? Is the collumn_left.php calling categories.php?

 

I ask because it looks as if you are using some kind of a flyout menu. Or is that what that code is?

 

As far as the osc cache. as far as I know to reset it you have to do it from the admin. The osc cache is written to a file on your server. When you reset it in admin you are deleting it from your server. Hope that makes sense.

Posted

OMG!! i totally forgot!! its calling for categories_css.php

 

OMG i need to take a week off from coding.. really.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Posted
OMG!! i totally forgot!! its calling for categories_css.php

 

OMG i need to take a week off from coding.. really.

:lol: :lol: :lol: Been there. Done that. Will be there again. I call it halftimers.

Archived

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

×
×
  • Create New...