I'm trying to create a ranking for a page. The idea is when a user gets a point, he'll receive a silver star. Once he obtains three silver stars, he'll get a bronze one and if he gets three bronze ones, he'll have a golden star. Up to here the code works perfectly but I need new ideas to search for other alternatives, if it's possible without %variables, maybe having the score in a file txt. There are a lot of users, for that reason I'll have lots of %variables. I'm also trying that the users with more golden stars remain above/at the top. I'm looking forward to your replies
Code:
alias ranking {
  inc $+(%,silver,.,$1)
  if $($+(%,silver,.,$1),2) > 3 { set $+(%,silver,.,$1) 1 | inc $+(%,bronze,.,$1) }
  if $($+(%,bronze,.,$1),2) > 3 { set $+(%,bronze,.,$1) 1 | inc $+(%,gold,.,$1) }
  if $read(ranking.html,s,$1) { write -dl $+ $readn ranking.html }
  write -il $+ $readn ranking.html $1 $iif($($+(%,gold,.,$1),2), $str(<img src="C14-027.jpg" width="15" height="12">,$($+(%,gold,.,$1),2))) $iif($($+(%,bronze,.,$1),2), $str(<img src="C14-029.jpg" width="15" height="12">,$($+(%,bronze,.,$1),2))) $str(<img src="C14-028.jpg" width="15" height="12">,$($+(%,silver,.,$1),2)) </br> 
}



Last edited by kwell; 28/09/08 12:11 AM.