cvs: php-gtk-web /include shared-manual.inc /manual browse.php
[email protected] ("Colin Viebrock") Fri, 10 Aug 2001 19:12:26 -0000
| Newsgroups | php.gtk |
|---|---|
| Message-ID | <cvscmv997470746@cvsserver> |
cmv Fri Aug 10 15:12:26 2001 EDT
Modified files:
/php-gtk-web/include shared-manual.inc
/php-gtk-web/manual browse.php
Log:
oops
Index: php-gtk-web/include/shared-manual.inc
diff -u php-gtk-web/include/shared-manual.inc:1.17 php-gtk-web/include/shared-manual.inc:1.18
--- php-gtk-web/include/shared-manual.inc:1.17 Fri Aug 10 15:09:11 2001
+++ php-gtk-web/include/shared-manual.inc Fri Aug 10 15:12:25 2001
@@ -164,7 +164,7 @@
}
-function makeEntry($date,$name,$blurb,$rating=0,$id=0,) {
+function makeEntry($date,$name,$blurb,$rating=0,$id=0) {
global $MAGIC_COOKIE;
echo '<tr valign="top">';
@@ -304,7 +304,7 @@
} else {
foreach($notes as $note) {
- makeEntry($note['xwhen'], $note['user'], $note['note'], $note['id'] );
+ makeEntry($note['xwhen'], $note['user'], $note['note'], $note['rate'], $note['id'] );
}
echo "<tr bgcolor=\"#d0d0d0\" valign=\"top\">\n";
Index: php-gtk-web/manual/browse.php
diff -u php-gtk-web/manual/browse.php:1.3 php-gtk-web/manual/browse.php:1.4
--- php-gtk-web/manual/browse.php:1.3 Thu Aug 9 17:03:55 2001
+++ php-gtk-web/manual/browse.php Fri Aug 10 15:12:26 2001
@@ -39,7 +39,9 @@
echo '<table border="0" cellpadding="4" cellspacing="0" width="100%">';
-$query = "SELECT *, UNIX_TIMESTAMP(ts) AS my_when FROM note where sect like '$let%' ORDER BY sect, ts";
+$query = "SELECT *, UNIX_TIMESTAMP(ts) AS xwhen, if(votes=0, 0, rating/votes) AS rate FROM note " .
+ "WHERE sect='$title' OR sect='$id' ORDER BY rate DESC, id";
+
$result = mysql_query($query) or die(mysql_error());
$numrows = mysql_num_rows($result);
if ( $numrows > 0) {
@@ -49,7 +51,7 @@
makeTitle( $row['sect'] );
$last = $row['sect'];
}
- makeEntry($row['my_when'], $row['user'], $row['note'], $row['id'] );
+ makeEntry($row['xwhen'], $row['user'], $row['note'], $row['rate'], $row['id'] );
}
} else if (!$fl) {