Difference between revisions of "Member Favorites"

From TMM Wiki
Jump to navigationJump to search
 
m
Line 1: Line 1:
 
{{CARMA1 Manual
 
{{CARMA1 Manual
| show_skins_and_templates_section = true
+
| show_templates_admin_section = true
 
}}
 
}}
  

Revision as of 13:44, 23 September 2008

CARMA
Templates Admin
Members Area Templates
Tour Templates
Member Favorites
Smarty Loops
Smarty Caching
Smarty print array
Base Templates
User Variables
Rating System

CARMA 1.3.1.0 lets members mark videos, photos, actors, or custom tags as favorites and access them through two new template functions: carma_favorite and carma_list_favorites.

Listing Favorites

carma_list_favorites prints a member's favorite content. You can output all favorite content or select only a single favorite type. By default, the output of this folder is controlled by the template list

Examples

  • To output all member's favorites:
{carma_list_favorites}
  • To output all content favorites (video and photo sets):
{carma_list_favorites get='gals'}
  • To output all photo set favorites:
{carma_list_favorites get='gals' type='gal'}
  • To output all video set favorites:
{carma_list_favorites get='gals' type='video'}
  • To output all actor favorites:
{carma_list_favorites get='actors'}
  • To output all custom favorites:
{carma_list_favorites get='custom'}
  • To output all custom favorites with section tag of clips:
{carma_list_favorites get='custom' section_name='clips'}


Add/Removing Favorites

Mark content as a favorite template function carma_favorite. This outputs a link that either adds or deletes this content to their favorites. By default, this function uses the template favorite for its output.

Examples

For favorite videos and photos:

  • {carma_favorite galid=$galid}
  • {carma_favorite galid=$smarty.request.galid}
  • {carma_favorite galid=42}

For favorite actor:

  • {carma_favorite actorid=11}

To create a custom favorite:

  • {carma_favorite section_name=”fav_type” caption=”title” data=”anything you want here”}

The fields section_name and caption are required for custom favorites. The field, data, can be any Smarty variable; for example: if you want to bookmark a page, you can set data to the page's URL and set caption to page's title. Section differs for each group of favorites you're tracking; for example: you can have a section for 'clips' and a section for 'photos', and then track the each member's favorite clips and the favorite photos separately.

To bookmark the current page:

{capture name=link}
http://{$smarty.server.HTTP_HOST}{rebuild_link encode=1}
{/capture}
{carma_favorite section_name='clips' caption=$filename data=$smarty.capture.link}

You can also use the code above to create a list of a member's favorite video clips (instead of making the entire video set a favorite).

See Also

For more information on the available parameters for these two template functions, please refer to the following articles: