Difference between revisions of "Carma count"
From TMM Wiki
Jump to navigationJump to searchLine 83: | Line 83: | ||
Prints the number of matching content, categories, locations, groups, or actors. | Prints the number of matching content, categories, locations, groups, or actors. | ||
− | == Example | + | == Example 2 == |
If you wanted to output the individual total content amount for your video and photo sets for sections 1,6, and 9 you could using this smarty code: | If you wanted to output the individual total content amount for your video and photo sets for sections 1,6, and 9 you could using this smarty code: | ||
Latest revision as of 05:14, 8 February 2010
carma_count
Prints how many content sets, categories, locations, groups, or actors match a search.
Parameters
(Required parameters in bold)
Parameter | Description | Possible Values | Default Value | Example |
---|---|---|---|---|
count_type | The thing to count | content, categories, locations, groups, actors | None. | count_type="actors" |
type | Type of content to get | gal or video | None. | type="video" |
category | Get just the categories in this list | Comma-separated list of things to get | None. | category="123" |
location | Get just the locations in this list | Comma-separated list of things to get | None. | location="123" |
group | Get just the groups in this list | Comma-separated list of things to get | None. | group="123" |
actor | Get just the actors in this list | Comma-separated list of things to get | None. | actor="123" |
producer | Get just the producers in this list | Comma-separated list of things to get | None. | producer="123" |
live_content | Only count live content | 1 | None. | live_content="1" |
assign | Name of the Smarty variable that stores the output | Any valid Smarty variable name | None. Output is displayed, not stored | assign="my_var" |
display_on_assign | Display comments even when the assign parameter (above) is used | 1 | None. If assign is used, no comments are displayed | display_on_assign=1 |
Example 1
{carma_count count_type=content section=1}
Output 1
Prints the number of matching content, categories, locations, groups, or actors.
Example 2
If you wanted to output the individual total content amount for your video and photo sets for sections 1,6, and 9 you could using this smarty code:
Total Videos: {carma_count count_type=content section="1,6,9" type=video}<br> Total Photos: {carma_count count_type=content section="1,6,9" type=gal}<br>
Output 2
Which would print out something like
Total Videos: 41<br> Total Photos: 21<br>