Carma actor photo name

From TMM Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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_actor_photo_name

Prints the URL to an actor's photo. It's only useful on an actor pages that don't call carma_list or similar functions.

Parameters

(Required parameters in bold)

Parameter Description Possible Values Default Value Example
actorid The actor's I.D. number Any valid actor I.D. number none actorid="123"
assign Place the URL to the actor's photo in this variable Any valid Smarty variable name without the leading dollar sign photo assign="myvar"
assign_prefix Prefix this value to the variable's name Any valid Smarty variable name without the leading dollar sign none (Value of photo is used by itself) assign_prefix="myprefix_"
display_on_assign Output the image URL even if the assign parameter is used 1 None. (Does not output image URL) display_on_assign=1

Output

  • Without assign: the URL to the image; URL placed in $photo Smarty variable
  • With assign: no output, URL placed in variable set by assign
  • With assign and display_on_assign: the URL to the image; URL placed in variable set by assign

Short Example

Note: you need to create a symbolic link from the CARMA cms_actors/ directory to a web-accessible actors/ directory to use this template function.
Template Code

<img src="{carma_actor_photo_name actorid=123}"/>

HTML Code After Smarty Runs

<img src="/actors/actor123.jpg"/>

Long Example

The following example will produce the actor photo or "[no photo]" -- and doesn't require creating the symbolic link described above:

{carma_actor_photo_name actorid=123 assign="has_photo"} 
{if $has_photo}
   <img src="view_image.php?actorid={$actor.actorid}&width=600&height=800">
{else}
   [no photo]
{/if}

Notes

If you use the example values for $assign and $assign_prefix above, the final variable name will be, "$myprefix_myvar".

See Also