I have a Joomla module that basically displays a list of categories. Next to the category name, the number of items in that particular category is displayed using the line below
<em>(<?php echo $row->counter ;?>) </em>
The items in the categories are set to either ‘open’, ‘close’ or ‘frozen’ and I am trying to make it so that it only displays the number of ‘open’ items and does not include any close or frozen items.
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
$document =& JFactory::getDocument();
$html = '<link href="'.JURI::base(). 'modules/mod_glance_categories/css/style.css" rel="stylesheet" type="text/css" />';
$document->addCustomTag( $html );
$n = 0;
if(count($rows) > 0){
?>
<table width="100%" cellpadding="0" cellspacing="0">
<?php
foreach ( $rows as $row )
{
$n++;
if($n ==1){?>
<tr>
<?php
}
if($n <= $columns){
?>
<td align="left" valign="top" >
<?php $link_proj_categ = JRoute::_('index.php?option=com_glance&task=categproj&id='.$row->id);?>
<a href="<?php echo $link_proj_categ;?>" class="tpf_tcatnode">
<strong><?php echo $row->categories; ?></strong>
<em>(<?php echo $row->counter ;?>) </em>
</a>
</td>
<?php
}
if($n == $columns){?>
</tr>
<?php
$n =0;
}
}
$n++;
if($n <= $columns){
for($x=$n;$x<=$columns;$x++){?>
<td> </td>
<?php
}?>
</tr>
<?php
} ?>
</table>
<?php } ?>