From 207588f1c22363887385434957b74d48d1b7c564 Mon Sep 17 00:00:00 2001
From: Michael R Sweet Bad option '$argv[$i]'!Delete Article #$id
\n");
@@ -132,9 +191,12 @@ switch ($op)
$row = db_next($result);
html_start_links(1);
- html_link("Return to Article List", "$PHP_SELF?L");
- html_link("Modify Article", "$PHP_SELF?M$id");
- html_link("Delete Article #$id", "$PHP_SELF?D$id");
+ html_link("Return to Articles", "$PHP_SELF?L$options");
+ if ($LOGIN_USER)
+ {
+ html_link("Modify Article", "$PHP_SELF?M$id$options");
+ html_link("Delete Article #$id", "$PHP_SELF?D$id$options");
+ }
html_end_links();
print("Article #$id
\n");
@@ -146,29 +208,98 @@ switch ($op)
."currently hidden from public view.\n");
$temp = htmlspecialchars($row['title']);
- print(" \n");
+ print("Title: $temp \n");
$temp = htmlspecialchars($row['abstract']);
- print("Title: $temp \n");
+ print("Abstract: $temp \n");
- $temp = htmlspecialchars($row['contents']);
- print("Abstract: $temp \n");
+ $temp = format_text($row['contents']);
+ print("Contents: $temp \n");
print("Contents: $temp
No Articles found.
\n"); @@ -177,33 +308,95 @@ switch ($op) exit(); } - html_start_table(array("Title","Abstract","Contents")); + if ($index >= $count) + $index = $count - ($count % $ARTICLE_PAGE_MAX); + if ($index < 0) + $index = 0; + + $start = $index + 1; + $end = $index + $ARTICLE_PAGE_MAX; + if ($end > $count) + $end = $count; + + $prev = $index - $ARTICLE_PAGE_MAX; + if ($prev < 0) + $prev = 0; + $next = $index + $ARTICLE_PAGE_MAX; - while ($row = db_next($result)) + print("$count article(s) found, showing $start to $end:
\n"); + + if ($count > $ARTICLE_PAGE_MAX) + { + print(""); + if ($index > 0) + print("[ Previous $ARTICLE_PAGE_MAX ]"); + print(" | "); + if ($end < $count) + { + $next_count = min($ARTICLE_PAGE_MAX, $count - $end); + print("[ Next $next_count ]"); + } + print(" |
"); + if ($index > 0) + print("[ Previous $ARTICLE_PAGE_MAX ]"); + print(" | "); + if ($end < $count) + { + $next_count = min($ARTICLE_PAGE_MAX, $count - $end); + print("[ Next $next_count ]"); + } + print(" |