Carma count

From TMM Wiki
Jump to navigationJump to search
CARMA
  Template Functions
CARMA Template Functions
carma_actor_photo_name
carma_comments_display
carma_comments_form
carma_count
carma_favorite
carma_gal_custom
carma_get_extended
carma_list
carma_list_favorites
carma_list_gals
carma_list_third_party_content
carma_list_videos
carma_login_log
carma_most_viewed
carma_newest
carma_news
carma_poll
carma_retrieve_sections
carma_search
carma_actors_search
carma_show_gal
carma_show_video
carma_top_actors
carma_top_rated
carma_upcoming
print_page_numbers
Template Function Aliases
carma_comment_display
carma_display_comment
carma_display_comments
carma_extended
carma_extended_data
carma_get_extended_data
carma_list_all
Common Parameters
assign
assign_prefix
count
data_only
display_on_assign
start
tpl

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>