chrometweaks.org

What is the best personal, free web site iPage hosting service?

Click Here To View All Answers...


Got a quick question: What is the best personal, free web site iPage hosting service? Many thanks for any response. Second question of mine... I am trying to get the categories box looking nice but I'm having a hard time doing so. YOu can check it out at.

Http://www.importwerks.com.

I dont understand why it's so far down and why there is white behind the text? I thought it woudl be transparent!.

Here is the code:.

<?php.

/*.

 $Id: categories.php,v 1.17 2002/03/07 20:53:58 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2001 osCommerce.

 Released under the GNU General Public License.

*/.

// Categories_tree written by Gideon Romm from Symbio Technologies, LLC.

Function tep_show_category($cid, $cpath, $COLLAPSABLE) {.

 global $categories_string, $languages_id, $HTTP_GET_VARS;.

 global $level;.

 $selectedPath = array();.

 .

// Get all of the categories on this level.

 $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 = "$cid" 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))  {.

   if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }.

   $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;.

// Add category link to $categories_string.

   for ($a=1; $a<$level{$categories['categories_id']}; $a++) {.

     $categories_string .= "&nbsp;&nbsp;";.

   }.

   $categories_string .= '<tr><td background="http://www.importwerks.com/catalog/images/blankbutton.gif"><a class="infoBoxContents" href="';.

   $cPath_new = $cpath;.

   if ($level{$categories['parent_id']} > 0) {.

     $cPath_new .= "_";.

   }.

   $cPath_new .= $categories['categories_id'];.

   $cPath_new_text = "cPath="$cPath_new;.

   .

   $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);.

   $categories_string .= '">';.

   if ($HTTP_GET_VARS['cPath']) {.

     $selectedPath = split("_", $HTTP_GET_VARS['cPath']);.

   }.

   if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '<b>'; }.

   if ($level{$categories['categories_id']} <> 1) { $categories_string .= '-'; }.

   $categories_string .= $categories['categories_name'];.

   if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string .= ''; }.

   if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '</b>'; }.

   $categories_string .= '</a></td></tr>';.

   if (SHOW_COUNTS == 'true') {.

     $products_in_category = tep_count_products_in_category($categories['categories_id']);.

     if ($products_in_category > 0) {.

       $categories_string .= '&nbsp;('$products_in_category')';.

     }.

   }.

   $categories_string .= '<br>';.

// If I have subcategories, get them and show them.

//    if (tep_has_category_subcategories($categories['categories_id'])) {.

//      if ($COLLAPSABLE) {.

//        if (in_array($categories['categories_id'], $selectedPath)) {.

//         tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE);.

//        }.

//      }.

//      else { tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE); }.

//    }.

 }.

}.

?>.

<! categories //>.

         <tr>.

           <td>.

<?php.

 $info_box_contents = array();.

 $info_box_contents[] = array('align' => 'left',.

                              'text'  => BOX_HEADING_CATEGORIES.

                             );.

 new infoBoxHeading($info_box_contents, true, false);.

 $categories_string = '';.

// tep_show_category(<top category_id>, <top cpath>, <0,'',1=Collapsable tree, 0,'',0=staticshow all>).

 tep_show_category(0,'',1);.

 $info_box_contents = array();.

 $info_box_contents[] = array('align' => 'left',.

                              'text'  => $categories_string.

                             );.

 new infoBox($info_box_contents);.

?>.

           </td>.

         </tr>.

<! categories_eof //>.

Please help me out! thanks..

Comments (58)

I'm stumped. I'm not so sure what is the answer. I'll do some investigation and get back to you if I bump into an answer. You should email the people at iPage as they probably could give you an answer..

Comment #1

BTW: this line of code:.

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);.

Is going to add the <A HREF="some_file.php">some file</a> code to the page..

The tep_href_link is the function for adding the <A HREF="...></A> you may not need the <A> </a> tags that are ahead of the this function..

Monte..

Comment #2

Im sorry but that just confused me more. The code I have posted is still the same, I havent changed anything. I would appreciate if you can tell me what I have wrong w/ the code I posted...

Comment #3

Hello Shayrgob,.

I'm not exactly sure what is wrong with your code but when I look at this line of code I downloaded by view source:.

<td align="left" class="boxText">http://www.importwerks.com/catalog/index.php?145"><img src="images/blankbutton.gif" border="0" alt="" width="115" height="25"><img src="images/pixel_trans.gif" border="0" alt="" width="5" height="1">Acura</a></td>.

And compare it to the original code you posted:.

$categories_string .= '<tr><td background="http://www.importwerks.com/catalog/images/blankbutton.gif"><a class="infoBoxContents" href="';.

Your orignal code looks like the blankbutton.gif file is part of the <TD> tag, which is probably what you want, but the downloaded source looks like the blankbutton.gif file is separate. Thats why I thought the code had changed. I would recommend. Taking out the pieces of code you added and try adding in one piece at a time..

Monte..

Comment #4

Ok, let me start over again. Here is the clean code w/o anything done to it:.

<?php.

/*.

 $Id: categories.php,v 1.17 2002/03/07 20:53:58 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2001 osCommerce.

 Released under the GNU General Public License.

*/.

// Categories_tree written by Gideon Romm from Symbio Technologies, LLC.

Function tep_show_category($cid, $cpath, $COLLAPSABLE) {.

 global $categories_string, $languages_id, $HTTP_GET_VARS;.

 global $level;.

 $selectedPath = array();.

 .

// Get all of the categories on this level.

 $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 = "$cid" 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))  {.

   if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }.

   $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;.

// Add category link to $categories_string.

   for ($a=1; $a<$level{$categories['categories_id']}; $a++) {.

     $categories_string .= "&nbsp;&nbsp;";.

   }.

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

   $cPath_new = $cpath;.

   if ($level{$categories['parent_id']} > 0) {.

     $cPath_new .= "_";.

   }.

   $cPath_new .= $categories['categories_id'];.

   $cPath_new_text = "cPath="$cPath_new;.

   .

   $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);.

   $categories_string .= '">';.

   if ($HTTP_GET_VARS['cPath']) {.

     $selectedPath = split("_", $HTTP_GET_VARS['cPath']);.

   }.

   if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '<b>'; }.

   if ($level{$categories['categories_id']} == 1) { $categories_string .= '<u>'; }.

   $categories_string .= $categories['categories_name'];.

   if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string .= ' ->'; }.

   if ($level{$categories['categories_id']} == 1) { $categories_string .= '</u>'; }.

   if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '</b>'; }.

   $categories_string .= '</a>';.

   if (SHOW_COUNTS) {.

     $products_in_category = tep_count_products_in_category($categories['categories_id']);.

     if ($products_in_category > 0) {.

       $categories_string .= '&nbsp;('$products_in_category')';.

     }.

   }.

   $categories_string .= '<br>';.

// If I have subcategories, get them and show them.

   if (tep_has_category_subcategories($categories['categories_id'])) {.

     if ($COLLAPSABLE) {.

       if (in_array($categories['categories_id'], $selectedPath)) {.

         tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE);.

       }.

     }.

     else { tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE); }.

   }.

 }.

}.

?>.

<! categories //>.

         <tr>.

           <td>.

<?php.

 $info_box_contents = array();.

 $info_box_contents[] = array('align' => 'left',.

                              'text'  => BOX_HEADING_CATEGORIES.

                             );.

 new infoBoxHeading($info_box_contents, true, false);.

 $categories_string = '';.

// tep_show_category(<top category_id>, <top cpath>, <1=Collapsable tree, 0=staticshow all>).

 tep_show_category(0,'',1);.

 $info_box_contents = array();.

 $info_box_contents[] = array('align' => 'left',.

                              'text'  => $categories_string.

                             );.

 new infoBox($info_box_contents);.

?>.

           </td>.

         </tr>.

<! categories_eof //>.

All I need to do is have a pic in the background of every link there. How do I do this?..

Comment #5

I am trying to get the categories box looking nice but I'm having a hard time doing so. YOu can check it out at.

Http://www.importwerks.com.

I dont understand why it's so far down and why there is white behind the text? I thought it woudl be transparent!.

Here is the code:.

<?php.

/*.

 $Id: categories.php,v 1.17 2002/03/07 20:53:58 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2001 osCommerce.

 Released under the GNU General Public License.

*/.

// Categories_tree written by Gideon Romm from Symbio Technologies, LLC.

Function tep_show_category($cid, $cpath, $COLLAPSABLE) {.

 global $categories_string, $languages_id, $HTTP_GET_VARS;.

 global $level;.

 $selectedPath = array();.

 .

// Get all of the categories on this level.

 $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 = "$cid" 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))  {.

   if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }.

   $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;.

// Add category link to $categories_string.

   for ($a=1; $a<$level{$categories['categories_id']}; $a++) {.

     $categories_string .= "&nbsp;&nbsp;";.

   }.

   $categories_string .= '<tr><td background="http://www.importwerks.com/catalog/images/blankbutton.gif"><a class="infoBoxContents" href="';.

   $cPath_new = $cpath;.

   if ($level{$categories['parent_id']} > 0) {.

     $cPath_new .= "_";.

   }.

   $cPath_new .= $categories['categories_id'];.

   $cPath_new_text = "cPath="$cPath_new;.

   .

   $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);.

   $categories_string .= '">';.

   if ($HTTP_GET_VARS['cPath']) {.

     $selectedPath = split("_", $HTTP_GET_VARS['cPath']);.

   }.

   if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '<b>'; }.

   if ($level{$categories['categories_id']} <> 1) { $categories_string .= '-'; }.

   $categories_string .= $categories['categories_name'];.

   if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string .= ''; }.

   if (in_array($categories['categories_id'], $selectedPath)) { $categories_string .= '</b>'; }.

   $categories_string .= '</a></td></tr>';.

   if (SHOW_COUNTS == 'true') {.

     $products_in_category = tep_count_products_in_category($categories['categories_id']);.

     if ($products_in_category > 0) {.

       $categories_string .= '&nbsp;('$products_in_category')';.

     }.

   }.

   $categories_string .= '<br>';.

// If I have subcategories, get them and show them.

//    if (tep_has_category_subcategories($categories['categories_id'])) {.

//      if ($COLLAPSABLE) {.

//        if (in_array($categories['categories_id'], $selectedPath)) {.

//         tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE);.

//        }.

//      }.

//      else { tep_show_category($categories['categories_id'], $cPath_new, $COLLAPSABLE); }.

//    }.

 }.

}.

?>.

<! categories //>.

         <tr>.

           <td>.

<?php.

 $info_box_contents = array();.

 $info_box_contents[] = array('align' => 'left',.

                              'text'  => BOX_HEADING_CATEGORIES.

                             );.

 new infoBoxHeading($info_box_contents, true, false);.

 $categories_string = '';.

// tep_show_category(<top category_id>, <top cpath>, <0,'',1=Collapsable tree, 0,'',0=staticshow all>).

 tep_show_category(0,'',1);.

 $info_box_contents = array();.

 $info_box_contents[] = array('align' => 'left',.

                              'text'  => $categories_string.

                             );.

 new infoBox($info_box_contents);.

?>.

           </td>.

         </tr>.

<! categories_eof //>.

Please help me out! thanks..

Comment #6

Hello,.

Try viewing your source code after you make your modifications. I viewed your source and it doesn't seem to match the code you posted, maybe your are working on it, this is what I saw:.

<td align="left" class="boxText">http://www.importwerks.com/catalog/index.php?145"><img src="images/blankbutton.gif" border="0" alt="" width="115" height="25">.

<img src="images/pixel_trans.gif" border="0" alt="" width="5" height="1">.

Acura</a></td></tr><br>http://www.importwerks.com/catalog/index.php?336">.

<img src="images/blankbutton.gif" border="0" alt="" width="115" height="25">.

I would take the downloaded source and compare to the original and try to find where the error lies..

Monte..

Comment #7


This question was taken from a support group/message board and re-posted here so others can learn from it.