• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Repeating an image according to a value from the database

#1
[eluser]victorche[/eluser]
I have a simple problem, which makes me crazy since yesterday. Let me show you the code:
Code:
$rows = $this->users->all_users(); // This gives me an array of all users.
One of the values here is the user rating, which is a round value from 1 to 10.
I just want to display a smile emoticon for the rating, instead of a number.
So, for example if an user has rating 8, I want to display one .gif 8 times. Like this (view file):
Code:
{rows}
<p>Username: {username}</p>
<p>Rating: {rating}<img src="emoticon.gif" />{/rating}</p>
{/rows}
Right now, I can display the rating as a number with this view:
Code:
{rows}
<p>Username: {username}</p>
<p>Rating: {rating}</p>
{/rows}
So, how can I make {rating} to become an array, which can repeat the image as many times, as the actual rating value?

Please, help me... As this makes me really crazy Sad


Messages In This Thread
Repeating an image according to a value from the database - by El Forum - 03-20-2011, 11:35 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.