Difference between revisions of "Carma actor photo name"
From TMM Wiki
Jump to navigationJump to searchm |
(No difference)
|
Latest revision as of 10:15, 7 November 2008
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
- Actor Photos -- Article about displaying actor photos
- carma_list_all -- Uses actor photos if available
- carma_get_extended -- Uses actor photos if available
- carma_top_rated -- Uses actor photos if available
- carma_most_viewed -- Uses actor photos if available
- carma_newest -- Uses actor photos if available
- carma_upcoming -- Uses actor photos if available
- carma_list_gals -- Uses actor photos if available
- carma_list_videos -- Uses actor photos if available
- carma_show_video -- Uses actor photos if available
- carma_top_actors -- Uses actor photos if available
- carma_favorite -- Uses actor photos if available
- carma_search -- Uses actor photos if available
- carma_list_favorites -- Uses actor photos if available