TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 447
  • Total: 447

[bugtracker] Child categorie not list when there is no articles in parent category

Started by gcivili, March 11, 2009, 08:43:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gcivili

Hi All

In admin, when in parent category are not present articles do not show the child categories

I edit TPortalAdmin.template.php


  // any articles then?
  if(!empty($context['TPortal']['editarticles']))
  {

   echo '
    <tr class="catbg"><td colspan="6">'.$context['TPortal']['currentcategory'].'</td></tr>';
   // any childcategories?
   if(!empty($context['TPortal']['childcategories']))
   {
    foreach($context['TPortal']['childcategories'] as $cat => $link)
     echo '
    <tr class="titlebg2">
     <td colspan="6">' , $txt['tp-childcategories'] , '</td>
    </tr>
    <tr class="windowbg">
     <td colspan="6">' , $link , '</td>
    </tr>';
   }
   echo '
    <tr class="catbg3">
     <td>'.$txt['tp-pos'].' / '.$txt['tp-name'].'</td>
     <td width="5%"> '.$txt['tp-author'].'</td>
     <td width="20%"> '.$txt['tp-date'].'</td>
     <td width="10%"> '.$txt['tp-display'].'</td>
     <td width="1%"> '.$txt['tp-featured'].'</td>
     <td width="1%"> '.$txt['tp-delete'].'</td>
    </tr>';
   if( !empty($context['TPortal']['pageindex']))
    echo '
   <tr class="titlebg2"><td colspan="6">'.$context['TPortal']['pageindex'].'</td></tr>';
   
   foreach($context['TPortal']['editarticles'] as $alink)

   

I changed in this way


   if(!empty($context['TPortal']['editarticles']) || !empty($context['TPortal']['childcategories'])) {
     echo '
    <tr class="catbg"><td colspan="6">'.$context['TPortal']['currentcategory'].'</td></tr>';
  }

  // any childcategories?
  if(!empty($context['TPortal']['childcategories']))
  {
    foreach($context['TPortal']['childcategories'] as $cat => $link)
     echo '
    <tr class="titlebg2">
     <td colspan="6">' , $txt['tp-childcategories'] , '</td>
    </tr>
    <tr class="windowbg">
     <td colspan="6">' , $link , '</td>
    </tr>';
   
   echo '
    <tr class="catbg3">
     <td>'.$txt['tp-pos'].' / '.$txt['tp-name'].'</td>
     <td width="5%"> '.$txt['tp-author'].'</td>
     <td width="20%"> '.$txt['tp-date'].'</td>
     <td width="10%"> '.$txt['tp-display'].'</td>
     <td width="1%"> '.$txt['tp-featured'].'</td>
     <td width="1%"> '.$txt['tp-delete'].'</td>
    </tr>';
   if( !empty($context['TPortal']['pageindex']))
    echo '
   <tr class="titlebg2"><td colspan="6">'.$context['TPortal']['pageindex'].'</td></tr>';
  }

  // any articles then?
  if(!empty($context['TPortal']['editarticles']))
  {
   
   foreach($context['TPortal']['editarticles'] as $alink)
   
   .............
   

   

now work ...

bloc

- Child categories were hidden if parent category was empty of articles. TP Admin. Fixed for TP 1.0 beta4

Thanks for the bugfix. :)

This website is proudly hosted on Crocweb Cloud Website Hosting.