require("include/top.php"); // color_title #248 // color_bottom #68a // color_bg1 #579 // color_bg1 #468 $sql = "SELECT *, (t.av / t.c) AS rat FROM ( SELECT users.id, users.avatar, users.nickname, sum( voteavg ) AS av, count( * ) AS c FROM prods LEFT JOIN users ON users.id = prods.added GROUP BY users.id ) AS t WHERE c > 20 ORDER BY rat ".($_GET["good"]?" DESC":"")." LIMIT 50"; $r = mysql_query($sql); echo "
user | \n"); printf("prods | \n"); printf("avg | \n"); printf("rating | \n"); printf("
---|---|---|---|
"); printf(" ",$o->id,$o->avatar); printf(" %s",$o->id,htmlentities($o->nickname)); printf(" | "); printf("%d | ",$o->c); printf("%.2f | ",$o->av); printf("%.2f | ",$o->rat); echo "