Changeset 5539
- Timestamp:
- 03/05/08 21:02:26 (7 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
interface/blog/category.php (modified) (1 diff)
-
lib/view/view.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/interface/blog/category.php
r5285 r5539 9 9 10 10 $cache = new pageCache; 11 $category = empty($suri['value']) ? 0 : getCategoryIdByLabel($blogid, $suri['value']); 12 11 if(!isset($suri['id'])) { 12 $category = empty($suri['value']) ? 0 : getCategoryIdByLabel($blogid, $suri['value']); 13 } else { 14 $category = $suri['id']; 15 $suri['value'] = getCategoryLabelById($blogid, $category); 16 } 13 17 if(!doesHaveOwnership() && getCategoryVisibility($blogid, $category) < 2) 14 18 $category = null; -
trunk/lib/view/view.php
r5534 r5539 405 405 406 406 function getCategoriesView($totalPosts, $categories, $selected, $xhtml = false) { 407 global $blogURL, $service ;407 global $blogURL, $service, $blog; 408 408 requireModel('blog.category'); 409 409 requireLibrary('blog.skin'); … … 418 418 foreach ($category1['children'] as $category2) { 419 419 if( doesHaveOwnership() || getCategoryVisibility($blogid, $category2['id']) > 1) { 420 array_push($children, array('id' => $category2['id'], 'label' => $category2['name'], 'value' => (doesHaveOwnership() ? $category2['entriesInLogin'] : $category2['entries']), 'link' => "$blogURL/category/" . URL::encode($category2['label'],$service['useEncodedURL']), 'children' => array())); 420 array_push($children, 421 array('id' => $category2['id'], 422 'label' => $category2['name'], 423 'value' => (doesHaveOwnership() ? $category2['entriesInLogin'] : $category2['entries']), 424 'link' => "$blogURL/category/" . ($blog['useSlogan'] ? URL::encode($category2['label'],$service['useEncodedURL']) : $category2['id']), 425 'children' => array() 426 ) 427 ); 421 428 $categoryCount = $categoryCount + (doesHaveOwnership() ? $category2['entriesInLogin'] : $category2['entries']); 422 429 } … … 425 432 $parentCategoryCount = (doesHaveOwnership() ? $category1['entriesInLogin'] - $categoryCountAll : $category1['entries'] - $categoryCountAll); 426 433 if($category1['id'] != 0) { 427 array_push($tree['children'], array('id' => $category1['id'], 'label' => $category1['name'], 'value' => $categoryCount + $parentCategoryCount, 'link' => "$blogURL/category/" . URL::encode($category1['label'],$service['useEncodedURL']), 'children' => $children)); 434 array_push($tree['children'], 435 array('id' => $category1['id'], 436 'label' => $category1['name'], 437 'value' => $categoryCount + $parentCategoryCount, 438 'link' => "$blogURL/category/" . ($blog['useSlogan'] ? URL::encode($category1['label'],$service['useEncodedURL']) : $category1['id']), 439 'children' => $children) 440 ); 428 441 } 429 442 $categoryCount = 0;
