0) {
while ($row = mysql_fetch_array($result)) {
if (!$fl) {
$fl = $row['first'];
}
$used[ $row['first'] ] = true;
}
}
$links = array();
for($i=ord('a'); $i<=ord('z'); $i++ ) {
$l = chr($i);
if (isset($used[$l])) {
$links[] = make_link($PHP_SELF.'?let='.$l, ''.$l.'' );
} else {
$links[] = $l;
}
}
$jumpbar = '
' .
'' .
'Jump to: ' .
join (' | ', $links ) .
'
| ' .
"
\n" .
"
\n\n";
echo $jumpbar;
if (!$let) {
$let = $fl;
}
echo '';
$query = "SELECT *, UNIX_TIMESTAMP(ts) AS xwhen, IF(votes=0, 10, rating/votes) AS rate FROM note " .
"WHERE sect LIKE '$let%' ORDER BY sect, rate DESC, id";
$result = mysql_query($query) or die(mysql_error());
$numrows = mysql_num_rows($result);
if ($numrows > 0) {
$last = '';
while ($row = mysql_fetch_array($result)) {
if ($row['sect'] != $last) {
makeTitle($row['sect']);
$last = $row['sect'];
}
makeEntry($row);
}
} else if (!$fl) {
echo 'No entries for any section.
|
';
} else {
echo 'No entries for '.$let.'.
|
';
}
echo '
';
if ($numrows > 10) {
echo $jumpbar;
}
?>