I saw a couple of people asking at the TFL and Codegrrl forums about customizing Enth 3.1 to show the number of listings joined per category. Something similar to what I have here.


This involves tinkering with show_joined.php.
Lines 88-102:

PHP:
  1. echo '<ul class="show_joined_list_items">';
  2.  
  3. if( $intro )
  4. echo '<li> <a href="' . $page . $connector . 'cat=all">All ' .
  5. 'listings (' . count( get_joined( 'approved' ) ) . ')</a> </li>';
  6.  
  7. // are there pending listings?
  8. if( $intro && count( get_joined( 'pending' ) )> 0 )
  9. echo '<li> <a href="' . $page . $connector .
  10. 'cat=pending">All Pending approval</a> </li>';
  11.  
  12. foreach( $cats as $cat )
  13. echo '<li> <a href="' . $page . $connector . 'cat=' . $cat['catid'] .
  14. '">' . $cat['text'] . '</a> </li>';
  15. echo '</ul>';

change that to these:

PHP:
  1. echo '<ul class="show_joined_list_items">';
  2.  
  3. if( $intro )
  4. echo '<li> <a href="' . $page . $connector . 'cat=all">All ' .
  5. 'listings (' . count( get_joined( 'approved' ) ) . ')</a> </li>';
  6.  
  7. // are there pending listings?
  8. if( $intro && count( get_joined( 'pending' ) )> 0 )
  9. echo '<li> <a href="' . $page . $connector .
  10. 'cat=pending">All Pending approval (' . count( get_joined( 'pending' ) ) . ' FLs)</a></li>';
  11.  
  12. foreach( $cats as $cat )
  13. echo '<li> <a href="' . $page . $connector . 'cat=' . $cat['catid'] .
  14. '">' . $cat['text'] . ' (' . count( get_joined_by_category( $cat['catid'] ) ) . ' FLs)</a></li>';
  15. echo '</ul>';

If you want to show that one in columns, try using TABLEs and TDs. I used SPANs in mine so that I could tinker with the hovering. XD And this also works for Enth3.1.1.


Post a new comment