Changeset 830
- Timestamp:
- 12/05/06 09:15:26 (2 years ago)
- Files:
-
- branches/wheeljack/php/lib/function.MTAssetCount.php (modified) (1 diff)
- branches/wheeljack/php/lib/mtdb_base.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/wheeljack/php/lib/function.MTAssetCount.php
r821 r830 2 2 function smarty_function_MTAssetCount($args, &$ctx) { 3 3 $args['blog_id'] = $ctx->stash('blog_id'); 4 $ assets = $ctx->mt->db->fetch_assets($args);5 return count($assets);4 $count = $ctx->mt->db->asset_count($args); 5 return $count; 6 6 } branches/wheeljack/php/lib/mtdb_base.php
r825 r830 1495 1495 } 1496 1496 return $results; 1497 } 1498 1499 function asset_count($args) { 1500 if (isset($args['blog_id'])) { 1501 $blog_filter = 'and asset_blog_id = '.intval($args['blog_id']); 1502 } 1503 1504 # Adds a type filter 1505 if (isset($args['type'])) { 1506 $type_filter = "and asset_class ='" . $args['type'] . "'"; 1507 } 1508 1509 $count = $this->get_var(" 1510 select count(*) 1511 from mt_asset 1512 where 1513 1 = 1 1514 $blog_filter 1515 $type_filter 1516 "); 1517 return $count; 1497 1518 } 1498 1519
