chrometweaks.org

Does anyone use BlueHost as their iPage web host?

Click Here To View All Answers...


First question I got is Does anyone use BlueHost as their iPage web host? Thanks for any answer. 2nd question I got is.. Hello,.

I created a box for categories and added a drop down to it instead of the standard one. It is not displaying the categories it displays '..' Here is the code, I know there is a problem somewhere in the display list part..

Thanks for any help, as always it is apperciated.

~ J ~.

<?php.

 $categories_query = tep_db_query("select c.categories_id, d.categories_id, d.categories_name from ".

TABLE_CATEGORIES" c, "TABLE_CATEGORIES_DESCRIPTION" d where c.categories_id = d.categories_id order by categories_name");.

 if ($number_of_rows = tep_db_num_rows($categories_query)) {.

?>.

<! categories //>.

         <tr>.

           <td>.

<?php.

   $info_box_contents = array();.

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

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

   if ($number_of_rows <= MAX_DISPLAY_CATEGORIES_IN_A_LIST).

{.

// Display a list.

     $categories_list = '';.

     .

     while ($categories = tep_db_fetch_array($categories_query)).

  {.

       $categories_name = ((strlen($categories['categories_name']) >.

MAX_DISPLAY_CATEGORIES_NAME_LEN) ? substr($categories['categories_name'], 0,.

MAX_DISPLAY_CATEGORIES_NAME_LEN)'..' : $categories['categories_name']);.

 if (isset($HTTP_GET_VARS['categories_id']) &&.

($HTTP_GET_VARS['categories_id'] == $categories['categories_id'])).

$categories_name = '<b>'$categories_name .'</b>';.

       $categories_list .= '<a href="'tep_href_link(FILENAME_DEFAULT,.

'categories_id='$categories['categories_id'])'">'$categories_name ..

'</a><br>';.

     }.

     $categories_list = substr($categories_list, 0, -4);.

     $info_box_contents = array();.

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

   } else {.

// Display a drop-down.

     $categories_array = array();.

     if (MAX_categories_LIST < 2).

  {.

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

     }.

     while ($categories = tep_db_fetch_array($categories_query)).

  {.

       $categories_name = ((strlen($categories['categories_name']) >.

MAX_DISPLAY_CATEGORIES_NAME_LEN) ? substr($categories['categories_name'], 0,.

MAX_DISPLAY_CATEGORIES_NAME_LEN)'..' : $categories['categories_name']);.

       $categories_array[] = array('id' => $categories['categories_id'],.

                                      'text' => $categories_name);.

     }.

     $info_box_contents = array();.

     $info_box_contents[] = array('form' => tep_draw_form('categories',.

Tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),.

                                  'text' =>.

Tep_draw_pull_down_menu('categories_id', $categories_array,.

(isset($HTTP_GET_VARS['categories_id']) ? $HTTP_GET_VARS['categories_id'] :.

''), 'onChange="this.form.submit();" size="'MAX_categories_LIST'".

Style="width: 100%"')tep_hide_session_id());.

   }.

   new infoBox($info_box_contents);.

?>.

           </td>.

         </tr>.

<! categories_eof //>.

<?php.

 }.

?>..

Comments (13)

You betcha! but you might want to make sure and wait for someone else to confirm this as I am not completely sure. Better yet, why don't you call the iPage guys because they can give you an answer better...

Comment #1

Jennifer,.

I am trying to create the same thing check out.

My Post.

Maybe we can come up with something together..

Jason..

Comment #2

Can any one help here. I have been searching and trying to come up with the samething..

Jason..

Comment #3

I almost have it working, just need to get the categories_id passed in the url as cPath=categories_id. I will post the code as soon as I get it working...

Comment #4

Ok dude, knock yourself out, warning though, it is messy! (BUT - it works!).

~ J ~.

<?php.

/*.

 $Id: manufacturers.php,v 1.19 2003/06/09 22:17:13 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2003 osCommerce.

 Released under the GNU General Public License.

*/.

 $categories_query = tep_db_query("select c.categories_id, d.categories_id, d.categories_name from ".

TABLE_CATEGORIES" c, "TABLE_CATEGORIES_DESCRIPTION" d where c.categories_id = d.categories_id order by categories_name");.

 if ($number_of_rows = tep_db_num_rows($categories_query)) {.

?>.

<! categories //>.

         <tr>.

           <td>.

<?php.

   $info_box_contents = array();.

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

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

   if ($number_of_rows <= MAX_DISPLAY_CATEGORIES_IN_A_LIST) {.

// Display a list.

     $categories_list = '';.

     while ($categories = tep_db_fetch_array($categories_query)) {.

       $categories_name = ((strlen($categories['categories_name']) >.

MAX_DISPLAY_CATEGORIES_NAME_LEN) ? substr($categories['categories_name'], 0,.

MAX_DISPLAY_CATEGORIES_NAME_LEN)'..' : $categories['categories_name']);.

If (isset($HTTP_GET_VARS['categories_id']) &&.

($HTTP_GET_VARS['categories_id'] == $categories['categories_id'])).

$categories_name = '<b>'$categories_name .'</b>';.

$categories_list .= '<a href="'tep_href_link(FILENAME_DEFAULT,.

'cPath='$categories['categories_id'])'">'$categories_name ..

'</a><br>';.

}.

  $categories_list = substr($categories_list, 0, -4);.

     $info_box_contents = array();.

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

   } else {.

   .

// Display a drop-down.

     $categories_array = array();.

     if (MAX_CATEGORIES_LIST < 2) {.

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

     }.

     while ($categories = tep_db_fetch_array($categories_query)) {.

     .

// WE ARE NOT GOING TO DO IT THIS WAY (10-5-04).

       // $categories_name = ((strlen($categories['categories_name']) >.

 //MAX_DISPLAY_CATEGORIES_NAME_LEN) ? substr($categories['categories_name'], 0,.

 //MAX_DISPLAY_CATEGORIES_NAME_LEN)'.test2.' : $categories['categories_name']);.

 //MAX_DISPLAY_CATEGORIES_NAME_LEN)'.test2.' : $categories['categories_name']);.

 // DISPLAYS CATEGORY NAME (10-5-04).

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

       $categories_array[] = array('id' => $categories['categories_id'],.

                                      'text' => $categories_name);.

     }.

// WE ARE NOT GOING TO DO IT THIS WAY (10-5-04).

  /*   $info_box_contents = array();.

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

                                  'text' => tep_draw_pull_down_menu('categories_id', $categories_array, (isset($HTTP_GET_VARS['categories_id']) ? $HTTP_GET_VARS['categories_id'] :.

''), 'onChange="this.form.submit();" size="'MAX_CATEGORIES_LIST'".

Style="width: 100%"')tep_hide_session_id()); */.

// HERE WE CHNAGED 'category_id' TO 'cPath' (10-5-04).

 $info_box_contents = array();.

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

                                  'text' => tep_draw_pull_down_menu('cPath', $categories_array, (isset($HTTP_GET_VARS['categories_id']) ? $HTTP_GET_VARS['categories_id'] : ''), 'onChange="this.form.submit();" size="'MAX_CATEGORIES_LIST'" style="width: 100%"')tep_hide_session_id());.

   } // end of else (line 82).

   new infoBox($info_box_contents);.

?>.

           </td>.

         </tr>.

<! categories_eof //>.

<?php.

 }.

?>..

Comment #5

The is also a contribution for this:.

Http://www.oscommerc...tions,46/page,3.

..

-Frank..

Comment #6

For some bizarre reason I can't get any of the dropdown's to work with my categories.php- it's like I change the file but the file isn't changing. Doesn't mess it up or anything- just no change. Any suggestions?..

Comment #7

What does it display in the drop down? Is it just on the index.php page or on all the pages? Do you have a url where it can be viewed?.

~ J ~..

Comment #8

It doesn't display the drop down at all- the categories remain standard..

It can be seen here:.

Http://oddsandinsonline.com/catalog/.

I tried a couple of different contribs but categories4 seemed the simplest so that's what's on it now...

Comment #9

Ok, I installed it and tested it and it worked for me. You did not comment out the old categories list I noticed so I also tested it with the old list, the old list was still working as well as the new drop down..

Did you modify the code in any way? All you had to do was replace the catalog/include/boxes/categories.php with the new one is that what you did?..

Comment #10

No, it was a simple drop-in so I just backed up my old categories.php and then dropped this one in. I didn't modify anything and there were no instructions to comment anything out...

Comment #11

Yeah sorry about the comment out, I test with the new code by commenting out old. It is pretty weird - I looked at the site, it seems like it is not passing the cPath to the url (which is how it gets the cat_id)...

Comment #12

Strange, isn't it? It's almost like it's not pulling the categories.php from includes/boxes until you look at the page source and then you see that it must be...

Comment #13

Guess what? Today I had to add a new category- suddenly it's showing up properly as a dropdown- go figure! Thanks for trying to help though :o)..

Comment #14


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