click here.'; exit; } /** define tab name for this page **/ $gTab = 'home'; require_once('classes/Dir.php'); require_once('includes/auth.inc.php'); require_once('templates/'.$gDirConfig['tmpl'].'/Layout.php'); require_once('classes/DirSmarty.php'); require_once('util.php'); /** gets current category information **/ $category =& $gDirDb->getCategoryByPath($_GET['category']); $gDirSmarty->assign_by_ref('category', $category); $gDirSmarty->assign_by_ref('category_info', $category); $title = ($category['id'] > 0) ? $category['title'] : $gDirConfig['site']; $gDirSmarty->assign_by_ref('title', $title); $gDirSmarty->assign_by_ref('description', $category['meta_description']); $gDirSmarty->assign_by_ref('keywords', $category['meta_keywords']); $gDirSmarty->assign_by_ref('header', $title); /** menu display **/ $gDirSmarty->assign('menu', $gDirLayout->print_menu($category['id'])); /** breadcrumb formation **/ $breadcrumb = ($category['id'] > 0) ? $gDirLayout->print_breadcrumb($category['id']) : ''; $gDirSmarty->assign_by_ref('breadcrumb', $breadcrumb); /** categories box formation **/ $num_subcategories = $gDirConfig['subcats_display'] ? $gDirConfig['subcats_display'] : 0; $categories =& $gDirDb->getCategoriesByParent($category['id'], FALSE, $num_subcategories); $categories = $categories ? $gDirLayout->print_categories($categories, $gDirConfig['num_categories_cols'], $num_subcategories) : ''; $gDirSmarty->assign_by_ref('categories', $categories); /** gets current page and defines start position **/ $page = (int)$_GET['page']; $page = ($page < 1) ? 1 : $page; $start = ($page - 1) * $gDirConfig['num_index_links']; /** gets number of links for this category **/ $total_links =& $gDirDb->getNumLinksByCategory($category['id']); $gDirSmarty->assign_by_ref('total_links', $total_links); /** get links for this category **/ $featured_top = ($gDirConfig['order_featured'] && $gDirConfig['featured_links']) ? TRUE : FALSE; $links =& $gDirDb->getLinksByCategory($category['id'], $start, $gDirConfig['num_index_links'], $featured_top, $gDirEditor['id']); $gDirSmarty->assign_by_ref('links', $links); $gDirSmarty->assign('url', $gDirConfig['base'].$gDirConfig['dir'].$category['path'].'/index%1.html'); /** get related categories **/ if ($gDirConfig['related']) { $related_categories =& $gDirDb->getRelatedCategoriesById($category['id']); $related_categories = $related_categories ? $gDirLayout->print_categories($related_categories) : ''; $gDirSmarty->assign_by_ref('related_categories', $related_categories); } /** get neighbour categories **/ if ($gDirConfig['neighbour']) { $neighbour_categories =& $gDirDb->getNeighbourCategoriesById($category['id']); $neighbour_categories = $neighbour_categories ? $gDirLayout->print_categories($neighbour_categories) : ''; $gDirSmarty->assign_by_ref('neighbour_categories', $neighbour_categories); } /** get featured links **/ if ($gDirConfig['featured_links']) { $featured_links =& $gDirDb->getFeaturedLinks($category['id'], $gDirConfig['num_featured_display']); $gDirSmarty->assign_by_ref('featured_links', $featured_links); } /** get partner links **/ if ($gDirConfig['partner_links']) { $partner_links =& $gDirDb->getPartnerLinks($category['id'], $gDirConfig['num_partner_display']); $gDirSmarty->assign_by_ref('partner_links', $partner_links); } /** statistics display **/ $gDirSmarty->assign_by_ref('num_links', $gDirDb->getNumLinks($category['id'])); $gDirSmarty->assign_by_ref('num_categories', $gDirDb->getNumCategoriesById($category['id'])); $gDirSmarty->display('index.tpl'); ?>