echo JText::_('COM_ACCOUNT_LABEL_CATEGORY'); ?> </td> <td class="table-header" colspan="2">#</td> </tr> <?php if (count($lists) > 0) { foreach ($lists as $list) { ?> <tr> <td><?php echo $list->category; ?> </td> <td><?php echo $Category->countMessageByCategoryId($list->id, $type); ?> </td> <td> <span> <a href="<?php echo JRoute::_('index.php?option=com_account&view=account&task=categories&action=remove&category=' . $list->id); ?> "><?php echo JText::_('COM_ACCOUNT_LABEL_CATEGORY_REMOVE'); ?> </a> </span> </td> </tr> <?php
?> ><a href="#all"><?php echo JText::_('COM_STREAM_BLOG_LABEL_ALL_CATEGORY'); ?> </a></li> <?php $cCategory = new StreamCategory(); // get blog entries rom database $blogLists = $cCategory->getBlogs(); if ($blogLists) { $categories = array(); // we want to sort which category contains the most entries foreach ($blogLists as $key => $blogs) { $categories[$key]['category'] = $blogs->category; $categories[$key]['id'] = $blogs->id; $categories[$key]['count'] = $cCategory->countMessageByCategoryId($blogs->id); } function sortByMessageCount(&$arr, $col) { $sortCol = array(); foreach ($arr as $key => $row) { $sortCol[$key] = $row[$col]; } array_multisort($sortCol, SORT_DESC, $arr); } sortByMessageCount($categories, 'count'); ?> <?php /* limit for category in the navigation area */ $CATEGORY_LIMIT = 3; $CATEGORY_LIMIT--;