DCD.RB
06-30-2018, 06:39 AM
Hi,
I'm running into an issue with trying to do multiple Avatars with fields. If someone has it enabled, it would randomize between the 2 fields where they've inputted the 2 images they want.
<if condition="$post['field10'] == 'Yes'">
<td class="alt2 avatarcol"><a href="member.php?$session[sessionurl]u=$post[userid]">
<script type="text/javascript">
var total_images = 2;
var random_number = Math.floor((Math.random()*total_images));
var random_img = new Array();
random_img[0] = '<img src="$post[field11]" width="auto height="100%" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />';
random_img[1] = '<img src="$post[field12]" width="auto height="100%" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />';
document.write(random_img[random_number]);
</script>
</a></td>
<else />
<if condition="$show['avatar']">
<div class="smallfont"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" width="auto height="100%" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>
</if>
<if>
What happens instead is if it's enabled on the user account, that user cannot see all Avatars. Can someone please help me?
Thanks!
I'm running into an issue with trying to do multiple Avatars with fields. If someone has it enabled, it would randomize between the 2 fields where they've inputted the 2 images they want.
<if condition="$post['field10'] == 'Yes'">
<td class="alt2 avatarcol"><a href="member.php?$session[sessionurl]u=$post[userid]">
<script type="text/javascript">
var total_images = 2;
var random_number = Math.floor((Math.random()*total_images));
var random_img = new Array();
random_img[0] = '<img src="$post[field11]" width="auto height="100%" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />';
random_img[1] = '<img src="$post[field12]" width="auto height="100%" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />';
document.write(random_img[random_number]);
</script>
</a></td>
<else />
<if condition="$show['avatar']">
<div class="smallfont"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" width="auto height="100%" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>
</if>
<if>
What happens instead is if it's enabled on the user account, that user cannot see all Avatars. Can someone please help me?
Thanks!