Jump to content

Azraeliitti

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Azraeliitti

  1. The solution in hiding categories was painfully simple after I really started figuring it out. All it needed was just a little addition to SQL query that sorted categories with bigger level than 2 out. I haven't really started implementing that script but from what I saw on that example page, I'm just wondering if that can work out when main categories are already linked to other pages?EDIT: Moreover, there is already method for opening the categories in the script and statements when they're closed. Can't pasting same methods twice in java over the script cause problems?
  2. Nope, but that's almost better. If I could do that and get figured out how to prevent level 3 categories from showing up in the menu tree it would rule Edit: Unless you can make level 3 to show and hide as a submenu for level 2 too.
  3. We have a webshop with lots of products and some categories have several subcategories, subcategories of subcategories etc etc. When no category is chosen, it displays only the main categories and when you open a category, it will drop down *all* the subcategories. My intention is to only show subcategory level 2 ($s['cs_category_level'] == 2) when the site drop downs the subcategories which should reduce their amount notably. Sadly, my scripting skills aren't good enough to actually add anything new to the code rather than copypasting the portions of the old code, so could someone help out with it?: //-----------------------------------------------------------------// Lets show the dynamic links of the product categories.//----------------------------------------------------------------- $result = mysql_query ("SELECT * FROM $clover_shop_categories WHERE cs_category_title IS NOT NULL ORDER BY cs_category_listing_position asc"); if (mysql_num_rows ($result)) { unset ($navecho_open, $nav_echo_closed, $nav_open_this_one); echo "<TABLE cellpadding=2 cellspacing=0 border=0 width=\"100%\ height=\"100%\">\n\n"; while ($s = mysql_fetch_array ($result)) { if ($s['cs_category_level'] == 1) { if ($nav_open_this_one && $nav_echo_open) { echo $nav_echo_open; } else { echo $nav_echo_closed; } unset ($nav_echo_open, $nav_echo_closed, $nav_open_this_one); } $nav_echo_open .= "<TR><TD class=\"nav_open\"><P class=\"nav_open\">"; if ($s['cs_category_level'] != 1) { for ($i = 2; $i <= $s['cs_category_level']; $i++) { if ($i == $s['cs_category_level']) { $nav_echo_open .= " <img src=\"logos/tree_corner.gif\" width=\"11\" height=\"11\" alt=\"\">"; } else { $nav_echo_open .= " <img src=\"logos/tree_empty.gif\" width=\"11\" height=\"11\" alt=\"\">"; } } } if ($c == $s[cs_category_id]) $nav_echo_open .= "<B>"; $nav_echo_open .= "<a href=\"$config[cs_setting_cat_url]/product_catalog.php?c=$s[cs_category_id]\" class=\"nav_open\">$s[cs_category_title]</a>"; if ($c == $s[cs_category_id]) $nav_echo_open .= "</B>"; $nav_echo_open .= "</P></TD></TR>\n\n"; if ($s['cs_category_level'] == 1) { $nav_echo_closed .= "<TR><TD class=\"nav_closed\"><P class=\"nav_closed\">"; for ($i = 2; $i <= $s['cs_category_level']; $i++) { if ($i == $s['cs_category_level']) { $nav_echo_closed .= " <img src=\"logos/tree_corner.gif\" width=\"11\" height=\"11\" alt=\"\">"; } else { $nav_echo_closed .= " <img src=\"logos/tree_empty.gif\" width=\"11\" height=\"11\" alt=\"\">"; } } $nav_echo_closed .= "<a href=\"$config[cs_setting_cat_url]/product_catalog.php?c=$s[cs_category_id]\" class=\"nav_closed\">$s[cs_category_title]</a>"; $nav_echo_closed .= "</P></TD></TR>\n\n"; } if ($c == $s['cs_category_id']) $nav_open_this_one = 1; } if ($nav_open_this_one && $nav_echo_open) { echo $nav_echo_open; } else { echo $nav_echo_closed; } echo "</TABLE>\n\n"; unset ($nav_echo_open, $nav_echo_closed, $nav_open_this_one); }
  4. Thanks for your reply, I'll get to it.
  5. I am working to enhance this commercial website link removed (it's in finnish). There are lots of categories on the website that can take over 2 pages to scroll after they've been opened and I've noticed it being really annoying when every time you open a category, it refreshes the page and throws you back into the top of the page. I don't have much experience with PHP, so does anyone know how to fix this issue?
×
×
  • Create New...