Difference between revisions of "Carma list"

From TMM Wiki
Jump to navigationJump to search
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
}}
 
}}
  
= carma_list_videos =
+
= carma_list and carma_list_all =
* Purpose: Display a list of video galleries on any template.
+
* Purpose: Retrieve actor, location, category or group data for one specific gallery or the whole database
* Usage: {carma_list_videos count=20 start=0 section=1}
+
* Usage: {carma_list list="actors,locations"}
* Required: none
+
* Required: list
* Optional: count, start, section, order, tpl, easy_keys, data_only, assign_prefix, assign, display_on_assign, actors, locations, categories, groups
+
* Optional: galid, var, count, start, siteid, section, active, order, alpha_letters
* Default Templates Used: show_videos
+
* Version: 1.3.0.1 or greater
* Variables created: $carma_content, $carma_content_count, $params
+
* Default Templates Used: none
 +
* Variables created: $carma_list, $params
  
 
== Parameters ==
 
== Parameters ==
Line 20: Line 21:
 
! Default Value
 
! Default Value
 
! Example
 
! Example
 +
|-
 +
| '''list'''
 +
| '''Defines what type of data you want carma_list to return.'''
 +
| '''actors, locations, categories, groups, producers, orientation, type, quality, gender, race, hair, pubic, tits, dick, or body'''
 +
| '''None.'''
 +
| '''list="actors"'''
 +
|-
 +
| galid
 +
| Only get the matching list for this gallery
 +
| Any valid gallery I.D. number
 +
| None.
 +
| galid="123"
 
|-
 
|-
 
| [[count]]
 
| [[count]]
| Show this many videos
+
| Maximum number of results to display (Click link for details)
 +
| Zero or any whole number greater than zero
 +
| 50
 +
| count=20
 +
|-
 +
| [[start]]
 +
| Hide all results lower than this number (Click link for details)
 
| Any whole number greater than zero
 
| Any whole number greater than zero
| 20 (Shows 20 videos)
+
| ''None.'' (Doesn't hide any results)
| count=5
+
| start=10
 
|-
 
|-
| start
+
| siteid
| Don't show the videos lower than this number
+
| The site the items belong to
| Any whole number, zero or greater
+
| Any valid site I.D. number
| 0 (Shows all videos)
+
| None.
| start=20
+
| siteid="123"
 
|-
 
|-
 
| section
 
| section
| Which section the items belong to
+
| The section to get items from
| A comma-delimited list of section I.D.s or a specific section I.D
+
| A comma-delimited list of section I.D.s or a specific section I.Ds.
| None.  Uses the current section.
+
| None.
 
| section="123"
 
| section="123"
 
|-
 
|-
| order
 
| what order to sort the videos in
 
| active, caption
 
 
| active
 
| active
| order="caption"
+
| Limit the search to active content (requires siteid and section variables to be set)
|-
 
| [[tpl]]
 
| Display videos using this template
 
| Any valid template name
 
| list_videos (Display videos using the list_videos template)
 
| tpl="my_template"
 
|-
 
| easy_keys
 
| Use continuous keys instead of keys based on the gallery's I.D. in the $carma_content array.
 
 
| 1
 
| 1
| None. Does not use continuous keys
+
| None. (Does not limit to active content.)
| easy_keys="1"
+
| active="1"
 
|-
 
|-
| data_only
+
| order
| Put the videos in an array
+
| Which order to sort the gals in
| 1
+
| active, caption, name
| ''None.'' Displays videos
+
| name
| data_only=1
+
| order="active"
|-
 
| [[assign_prefix]]
 
| Prefix output variables with this word.  (Click link for details)
 
| Any valid Smarty variable name
 
| ''None.'' (No prefix is used)
 
| assign_prefix="myvar"
 
|-
 
| [[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]]
+
| alpha_letters
| Display videos even when the assign parameter (above) is used
+
| Only grab the list starting with these letters
| 1
+
| A comma-delimited list of letters
| ''None'' If assign is used, no videos are displayed
+
| None.
| display_on_assign=1
+
| alpha_letters="A,B,C"
 
|-
 
|-
| actors
+
| var
| Get information about actors
+
| The Smarty variable to assign data too
| 1
+
| Any valid Smarty variable
| None.  Does not get this information
+
| carma_list
| actors="1"
+
| var="my_variable"
|-
 
| locations
 
| Get information about locations
 
| 1
 
| None.  Does not get this information
 
| locations="1"
 
|-
 
| categories
 
| Get information about categories
 
| 1
 
| None.  Does not get this information
 
| categories="1"
 
|-
 
| groups
 
| Get information about groups
 
| 1
 
| None.  Does not get this information
 
| groups="1"
 
|-
 
| full_metadata
 
| Put the following information in variables: total length, total size, name, clip_count, files, files size, and files length
 
| 1
 
| None.  Does not store full metadata
 
| full_metadata="1"
 
 
|}
 
|}
 
== full_metadata Variables ==
 
By default, the following [[Smarty]] variables are created when you enable the ''full_metadata'' parameter
 
 
* {$entry.type_data.wmv.total_length}
 
* {$entry.type_data.wmv.total_size}
 
* {$entry.type_data.wmv.name}
 
* {$entry.type_data.wmv.clip_count}
 
* {$entry.type_data.wmv.files} an array of clips
 
* {$entry.type_data.wmv.files_size} an array of clips sizes
 
* {$entry.type_data.wmv.files_length}
 
 
  
 
== Description ==
 
== Description ==
Displays the count video content sets starting at start for the current
+
This function retrieves a list of actors, locations, categories or
or a given (set of) section(s). It uses the show_videos template to
+
groups. By default CARMA retrieves all actors, locations, categories,
display this information.
+
and groups stored in the CARMA database. If you only want to retrieve a
 +
list matching a specific gallery, define galid in the call to
 +
carma_list. The variables are stored in an array. For example,
 +
actors are stored as $carma_list.actor[], categories are stored as
 +
$carma_list.category[]. Each item in the array is again an array with
 +
each field being one of the fields in the corresponding database table.
  
== Examples ==
+
== Example ==
 +
<pre>
 +
{carma_list siteid=$siteid count=500 order="name ASC" list="actors,locations,groups,categories" }
  
=== Paging ===
+
<form method="get" action="index.php">
This function has built in paging. You just need to set start to be the start of output and it will go to 'count'. On the next call it has to be start+count  and the go backward it would be start-count. Out default list_videos template takes care of the math for you, but you need to add the start value to the function call like this:
+
<input type="hidden" name="section" value="{$secid}">
{carma_list_videos count=20 section=1 start=$smarty.request.start }
+
Actor: <select size="5" name="actor">
 +
        {foreach from=$carma_list.actor item=actor}
 +
          <option value="{$actor.actorid}">{$actor.name}</option>
 +
        {/foreach}
 +
      </select> <br>
 +
Category: <select size="5" name="category">
 +
            {foreach from=$carma_list.category item=category}
 +
              <option value="{$category.catid}">{$category.name}</option>
 +
            {/foreach}
 +
          </select> <br>
  
$smarty.request.start  will always contain the page's start value.
+
Group: <select size="5" name="group">
 +
            {foreach from=$carma_list.group item=group}
 +
              <option value="{$group.gid}">{$group.name}</option>
 +
            {/foreach}
 +
          </select> <br>
 +
       
 +
Location: <select size="5" name="location">
 +
            {foreach from=$carma_list.location item=location}
 +
              <option value="{$location.locid}">{$location.name}</option>
 +
            {/foreach}
 +
          </select> <br>
 +
<input type="submit" name="searching" value="Search">
 +
</pre>

Latest revision as of 10:25, 26 July 2011

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_list and carma_list_all

  • Purpose: Retrieve actor, location, category or group data for one specific gallery or the whole database
  • Usage: {carma_list list="actors,locations"}
  • Required: list
  • Optional: galid, var, count, start, siteid, section, active, order, alpha_letters
  • Version: 1.3.0.1 or greater
  • Default Templates Used: none
  • Variables created: $carma_list, $params

Parameters

(Required parameters in bold)

Parameter Description Possible Values Default Value Example
list Defines what type of data you want carma_list to return. actors, locations, categories, groups, producers, orientation, type, quality, gender, race, hair, pubic, tits, dick, or body None. list="actors"
galid Only get the matching list for this gallery Any valid gallery I.D. number None. galid="123"
count Maximum number of results to display (Click link for details) Zero or any whole number greater than zero 50 count=20
start Hide all results lower than this number (Click link for details) Any whole number greater than zero None. (Doesn't hide any results) start=10
siteid The site the items belong to Any valid site I.D. number None. siteid="123"
section The section to get items from A comma-delimited list of section I.D.s or a specific section I.Ds. None. section="123"
active Limit the search to active content (requires siteid and section variables to be set) 1 None. (Does not limit to active content.) active="1"
order Which order to sort the gals in active, caption, name name order="active"
alpha_letters Only grab the list starting with these letters A comma-delimited list of letters None. alpha_letters="A,B,C"
var The Smarty variable to assign data too Any valid Smarty variable carma_list var="my_variable"

Description

This function retrieves a list of actors, locations, categories or groups. By default CARMA retrieves all actors, locations, categories, and groups stored in the CARMA database. If you only want to retrieve a list matching a specific gallery, define galid in the call to carma_list. The variables are stored in an array. For example, actors are stored as $carma_list.actor[], categories are stored as $carma_list.category[]. Each item in the array is again an array with each field being one of the fields in the corresponding database table.

Example

{carma_list siteid=$siteid count=500 order="name ASC" list="actors,locations,groups,categories" }

<form method="get" action="index.php">
<input type="hidden" name="section" value="{$secid}">
Actor: <select size="5" name="actor">
        {foreach from=$carma_list.actor item=actor}
          <option value="{$actor.actorid}">{$actor.name}</option>
        {/foreach}
       </select> <br>
Category: <select size="5" name="category">
            {foreach from=$carma_list.category item=category}
              <option value="{$category.catid}">{$category.name}</option>
            {/foreach}
          </select> <br>

Group: <select size="5" name="group">
            {foreach from=$carma_list.group item=group}
              <option value="{$group.gid}">{$group.name}</option>
            {/foreach}
          </select> <br>
         
Location: <select size="5" name="location">
            {foreach from=$carma_list.location item=location}
              <option value="{$location.locid}">{$location.name}</option>
            {/foreach}
          </select> <br>
<input type="submit" name="searching" value="Search">