Changeset 2732

Show
Ignore:
Timestamp:
12/27/06 22:14:30 (2 years ago)
Author:
inureyes
Message:
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.1-beta/lib/view/view.php

    r2712 r2732  
    673673    global $blogURL, $owner; 
    674674    $categoryCount = 0; 
     675    $categoryCountAll = 0; 
     676    $parentCategoryCount = 0; 
    675677    $tree = array('id' => 0, 'label' => getCategoryNameById($owner, 0), 'value' => $totalPosts, 'link' => "$blogURL/category", 'children' => array()); 
    676678    foreach ($categories as $category1) { 
    677679        $children = array(); 
    678         if( doesHaveOwnership() || getCategoryVisibility($owner, $category1['id']) > 1) { 
     680        if(doesHaveOwnership() || getCategoryVisibility($owner, $category1['id']) > 1) { 
    679681            foreach ($category1['children'] as $category2) { 
    680682                if( doesHaveOwnership() || getCategoryVisibility($owner, $category2['id']) > 1) { 
     
    682684                    $categoryCount = $categoryCount + (doesHaveOwnership() ? $category2['entriesInLogin'] : $category2['entries']); 
    683685                } 
    684             } 
    685             array_push($tree['children'], array('id' => $category1['id'], 'label' => $category1['name'], 'value' => $categoryCount, 'link' => "$blogURL/category/" . encodeURL($category1['label']), 'children' => $children)); 
     686                $categoryCountAll = $categoryCountAll + (doesHaveOwnership() ? $category2['entriesInLogin'] : $category2['entries']); 
     687            } 
     688            $parentCategoryCount = (doesHaveOwnership() ? $category1['entriesInLogin'] - $categoryCountAll : $category1['entries'] - $categoryCountAll); 
     689            array_push($tree['children'], array('id' => $category1['id'], 'label' => $category1['name'], 'value' => $categoryCount + $parentCategoryCount, 'link' => "$blogURL/category/" . encodeURL($category1['label']), 'children' => $children)); 
    686690            $categoryCount = 0; 
     691            $categoryCountAll = 0; 
     692            $parentCategoryCount = 0; 
    687693        } 
    688694    }