Skip to content

Commit

Permalink
Do not display empty categories on Bootstrap Forums Skin (disp=front)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsolipa committed Feb 10, 2016
1 parent f4643bb commit 7836f00
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions skins/bootstrap_forums_skin/_front.disp.php
Expand Up @@ -93,17 +93,16 @@
if( $root_Chapter->meta )
{ // Meta category
$chapters_children = $root_Chapter->get_children( true );
?>
<header class="panel-heading meta_category"><a href="<?php echo $root_Chapter->get_permanent_url(); ?>" class="forumlink"><?php echo $root_Chapter->dget( 'name' ); ?></a></header>
<?php
$meta_header_displayed = false;
}
else
{ // Simple category with posts
$chapters_children = array( $root_Chapter );
}
?>
<section class="table table-hover">
<section class="table table-hover">
<?php
}

foreach( $chapters_children as $Chapter )
{ // Loop through categories:
if( $Chapter->lock )
Expand All @@ -118,6 +117,17 @@
$chapter_icon_title = T_('Forum (contains several topics)');
$legend_icons['forum_default'] = 1;
}

if ( $postcount_in_category = get_postcount_in_category( $Chapter->ID ) )
{
if ( $root_Chapter->meta && ! $meta_header_displayed )
{ // Moved here to to display it only if the category is not empty
$meta_header_displayed = true;
?>
<header class="panel-heading meta_category"><a href="<?php echo $root_Chapter->get_permanent_url(); ?>" class="forumlink"><?php echo $root_Chapter->dget( 'name' ); ?></a></header>
<section class="table table-hover">
<?php
}
?>
<article class="container group_row">
<div class="ft_status__ft_title col-lg-8 col-md-7 col-sm-7 col-xs-6">
Expand Down Expand Up @@ -148,14 +158,15 @@
</div>
</div>
<div class="ft_count col-lg-1 col-md-1 col-sm-1 col-xs-2">
<?php printf( T_('%s topics'), '<div><a href="'. $Chapter->get_permanent_url() .'">'.get_postcount_in_category( $Chapter->ID ).'</a></div>' ); ?>
<?php printf( T_('%s topics'), '<div><a href="'. $Chapter->get_permanent_url() .'">'.$postcount_in_category.'</a></div>' ); ?>
</div>
<div class="ft_count second_of_class col-lg-1 col-md-1 col-sm-1 col-xs-2"><?php printf( T_('%s replies'), '<div><a href="'. $Chapter->get_permanent_url() .'">'.get_commentcount_in_category( $Chapter->ID ).'</a></div>' ); ?></div>
<div class="ft_date col-lg-2 col-md-3 col-sm-3"><?php echo $Chapter->get_last_touched_date( 'D M j, Y H:i' ); ?></div>
<!-- Apply this on XS size -->
<div class="ft_date_shrinked col-xs-2"><?php echo $Chapter->get_last_touched_date( 'm/j/y' ); ?></div>
</article>
<?php
}
}
?>
</section>
Expand Down

0 comments on commit 7836f00

Please sign in to comment.