how do I choose a random quota_id from a set?
Using Jamroom
Hi Michael,
After looking at these a few times, your version actually makes sense to me a little. Like an algebra equation. The nomenclature is foreign to me, but I think I can understand the math.
Paul's version is a little more familiar looking with the if/then format I'm used to seeing in the templates. However, someone would have to step me through the math, because I am not "getting it" in that format.
In any case, am I correct in assuming these versions can be added right to the templates? So in the case of your code, would it look like this in practice for "Featured Artists? (index_artists.tpl).
{$options = ['7', '7','6']}
{$key = array_rand($options)}
{$wanted = $options[$key]}
{jrCore_list module="jrProfile" quota_id=$wanted}
{jrCore_list module="jrProfile" order_by="_profile_id random" limit="4" quota_id="$wanted" search1="profile_active = 1" template="index_artists_row.tpl"require_image="profile_image"}
Then for featured songs, I assume only the module specific information would change, so it would look like? (index_songs.tpl).
{$options = ['7', '7','6']}
{$key = array_rand($options)}
{$wanted = $options[$key]}
{jrCore_list module="jrAudio" quota_id=$wanted}
{jrCore_list module="jrAudio" order_by="audio_title random" quota_id="$wanted" limit="4" template="index_songs_row.tpl" require_image="audio_image"}
Do I have this straight now, or am I still lost?
updated by @ken-rich: 12/06/14 06:18:29AM