CroNiX Posted October 10, 2008 Share Posted October 10, 2008 Do you have error reporting turned on? Also, you are still missing your closing curly brace on your foreach loop...add one more just below: $page['content'] .= "<li><a href=\"subcategory.php?sCatID=$subcatID\">$bold_value</a></li>\n"; Quote Link to comment Share on other sites More sharing options...
sandbudd Posted October 10, 2008 Author Share Posted October 10, 2008 CroNix okay its official Im an idiot... It is working I have so many browsers open that when I made the changes you suggest I was refreshing the wrong page...lol... Wow thanks for all your help. Quote Link to comment Share on other sites More sharing options...
sandbudd Posted October 10, 2008 Author Share Posted October 10, 2008 here is what works <?php require_once('includes/init.php'); $page['products'] = $catalog->getCategories(); $category = $catalog->getCategoryInfo($core->pageVar('catID', siteCore::VARTYPE_INT)); $page['content'] = "<h2>".$category['CategoryName']."</h2>\n<div class=\"mainContent\">\n"; if(count($category['Subcats'])>0) { $page['content'] .= "<ul>\n"; foreach($category['Subcats'] as $subcatID => $subcatName){ $bold_value = in_array($subcatID, $bolded_ids) ? "<strong>$subcatName (TOP 20)</strong>" : $subcatName; $page['content'] .= "<li><a href=\"subcategory.php?sCatID=$subcatID\">$bold_value</a></li>\n"; } } $page['content'] .= "</ul>\n"; $page['content'] .= "</div>"; print_page(); ?> Quote Link to comment Share on other sites More sharing options...
CroNiX Posted October 10, 2008 Share Posted October 10, 2008 Its working now? Great! You really need to turn on error reporting. It would have told you some of these errors...like the missing braces...Very hard to debug with no error reporting... Of course, only enable error reporting during coding time, not for production Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.