diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-01-06 11:39:43 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-01-06 11:39:43 +0000 |
commit | 8511d9fb45bb2f5a016f0dd13b22a67d448c0d37 (patch) | |
tree | cde1eb77e8ef1f1f55818182a108d5997125f379 /modules/headline.module | |
parent | b604c438945f6d94472a470d2b09ad2b63c58651 (diff) | |
download | brdo-8511d9fb45bb2f5a016f0dd13b22a67d448c0d37.tar.gz brdo-8511d9fb45bb2f5a016f0dd13b22a67d448c0d37.tar.bz2 |
A batch of patches:
- configuration:
+ renamed $db_name to $db_user
+ renamed $db_base to $db_name
- fixed small diary glitch
- fixed initial-comment-score problem
- fixed comment rating bug: improved the API and updated the
themes
- removed some tabs from Steven ;)
- fixed backend warnings and improved robustness
I'm not happy yet with the headline grabber - it generates
too many SQL errors.
- some small cosmetic changes in comment.module
- fixed minor glitch in format_interval()
Diffstat (limited to 'modules/headline.module')
-rw-r--r-- | modules/headline.module | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/modules/headline.module b/modules/headline.module index 278043be1..358a1cc04 100644 --- a/modules/headline.module +++ b/modules/headline.module @@ -27,11 +27,13 @@ function headline_blocks() { // Load backend from database: $backend = new backend($channel->id); - - // Read headline from backend class: - $content = ""; - for (reset($backend->headline); $headline = current($backend->headline); next($backend->headline)) { - $content .= "<LI>$headline</LI>\n"; + + if ($backend->headlines) { + unset($content); + foreach ($backend->headlines as $headline) $content .= "<LI>$headline</LI>\n"; + } + else { + $content = "no headlines available\n"; } // Print backend box to screen: @@ -79,13 +81,16 @@ function headline_block() { $result = db_query("SELECT * FROM channel"); while ($channel = db_fetch_object($result)) { $backend = new Backend($channel->id); - $content = ""; - if ($backend->headline) { - for (reset($backend->headline); $headline = current($backend->headline); next($backend->headline)) { + if ($backend->headlines) { + unset($content); + foreach ($backend->headlines as $headline) { $content .= "<LI>$headline</LI>\n"; } } + else { + $content = "no headlines available"; + } $blocks[$channel->id]["subject"] = $backend->site; $blocks[$channel->id]["content"] = $content; @@ -111,7 +116,7 @@ function headline_admin_main() { $output .= "<TR>\n"; $output .= " <TD><A HREF=\"$backend->url\">$backend->site</A></TD>\n"; $output .= " <TD><A HREF=\"mailto:$backend->contact\">$backend->contact</A></TD>\n"; - $output .= " <TD ALIGN=\"center\">". format_interval(time() - $backend->timestamp) ." ago</TD>\n"; + $output .= " <TD ALIGN=\"center\">". ($backend->timestamp == 1 ? "failed" : format_interval(time() - $backend->timestamp) ." ago") ."</TD>\n"; $output .= " <TD ALIGN=\"center\"><A HREF=\"admin.php?mod=headline&op=refresh&id=$backend->id\">refresh</A></TD>\n"; $output .= " <TD ALIGN=\"center\"><A HREF=\"admin.php?mod=headline&op=delete&id=$backend->id\">delete</A></TD>\n"; $output .= "</TR>\n"; |