include("header.php");
print("
Popular Photos
");
include("mysql/sqldb.php");
$res = mysql_query("SELECT * FROM votes ORDER BY (ups/downs) DESC LIMIT 0,15");
$i = 0;
$j = 1;
$num = mysql_numrows($res);
while ($i < $num) {
$sid = mysql_result($res,$i,"storyid");
$u = mysql_result($res,$i,"ups");
$d = mysql_result($res,$i,"downs");
@$t = $u / $d;
if (strpos($t, ".")) {
$t = explode(".", $t);
$t1 = $t[0];
$t2 = substr($t[1], 0, 1);
$t = "$t1.$t2";
}
$tmp = mysql_query("SELECT * FROM stories WHERE id='$sid' LIMIT 1");
$title = @mysql_result($tmp,0,"title");
$title2 = strip_title($title);
if (!$title) { $i++;$j++; } else {
print("$j: $title ($t%)");
$i++;
$j++;
}
}
print("");
mysql_close();
include("footer.php");