$tblstart"; if(!$action and $log){ $rat="$radio=rating value"; $ratelist=" $rat=0> 0   $rat=1> 1   $rat=2> 2   $rat=3> 3   $rat=4> 4   $rat=5> 5   $rat=6> 6   $rat=7> 7   $rat=8> 8   $rat=9> 9   $rat=10> 10 "; print "
$tccellh width=150>  $tccellh>  $tccell1>Rating: $tccell2l>$ratelist $tccell1>  $tccell2l> $inph=action VALUE=rateuser> $inph=userid VALUE=$id> $inps=submit VALUE='Give rating!'>
"; } if($_POST[action]=='rateuser' && $userid!=$loguserid){ if($rating<0) $rating=0; if($rating>10) $rating=10; mysql_query("DELETE FROM userratings WHERE userfrom=$loguserid AND userrated=$userid"); mysql_query("INSERT INTO userratings (userfrom,userrated,rating) VALUES ($loguserid,$userid,$rating)"); print "$tccell1>Thank you, $loguser[name], for rating this user.
".redirect('index.php','return to the board',0); } if($action=='viewvotes' && $isadmin){ $users=mysql_query('SELECT id,name FROM users'); while($user=mysql_fetch_array($users)) $username[$user[id]]=$user[name]; $ratings=mysql_query("SELECT userfrom,userrated,rating FROM userratings WHERE userrated=$id"); if(@mysql_num_rows($ratings)) while($rating=mysql_fetch_array($ratings)) $fromlist.="$rating[rating] from ".$username[$rating[userfrom]].'
'; else $fromlist="None."; $ratings=mysql_query("SELECT userfrom,userrated,rating FROM userratings WHERE userfrom=$id"); if(@mysql_num_rows($ratings)) while($rating=mysql_fetch_array($ratings)) $votelist.="$rating[rating] for ".$username[$rating[userrated]].'
'; else $votelist='None.'; print " $tccellh>Votes for $username[$id]: $tccellh>Votes from $username[$id]: $tccell1l>$fromlist $tccell1l>$votelist "; } print $tblend.$footer; printtimedif($startingtime); ?>