From 356df28e4e060b5e009045c359040341666f4614 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 27 May 2001 10:32:20 +0000 Subject: - Various small improvements: no bug fixes though but I moved a few things around. --- modules/syndication.module | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'modules') diff --git a/modules/syndication.module b/modules/syndication.module index 3ea4bdc7d..952088fcb 100644 --- a/modules/syndication.module +++ b/modules/syndication.module @@ -19,26 +19,26 @@ function syndication_cron() { } } -function syndication_bundle($feed) { - if ($feed->attribute) { +function syndication_bundle($attribute) { + if ($attribute) { // compose query: - $keys = explode(",", $feed->attribute); + $keys = explode(",", $attribute); foreach ($keys as $key) $where[] = "attribute LIKE '%". trim($key) ."%'"; - $result = db_query("SELECT * FROM item WHERE ". implode(" OR ", $where)); + $result = db_query("SELECT * FROM item WHERE ". implode(" OR ", $where) ." ORDER BY timestamp DESC"); while ($item = db_fetch_object($result)) { $output .= "
  • link) ."\">". check_output($item->title) ."
  • "; } - return "$feed->title"; + return "$output"; } } -function syndication_view_block() { - $result = db_query("SELECT * FROM bundle"); +function syndication_view_bundle() { + $result = db_query("SELECT * FROM bundle ORDER BY title"); while ($bundle = db_fetch_object($result)) { - $output .= syndication_bundle($bundle); + $output .= "$bundle->title"; } return $output; } @@ -172,6 +172,7 @@ function syndication_get_bundle($bid) { function syndication_view_feed() { $result = db_query("SELECT f.*, COUNT(i.iid) AS items FROM feed f LEFT JOIN item i ON f.fid = i.fid GROUP BY f.fid ORDER BY f.title"); + $output .= "

    Feed overview

    "; $output .= "\n"; $output .= " \n"; while ($feed = db_fetch_object($result)) { @@ -179,12 +180,9 @@ function syndication_view_feed() { } $output .= "
    titleattributesitemslast updatenext updateoperations
    \n"; - return $output; -} - -function syndication_view_bundle() { $result = db_query("SELECT * FROM bundle ORDER BY title"); + $output .= "

    Bundle overview

    "; $output .= "\n"; $output .= " \n"; while ($bundle = db_fetch_object($result)) { @@ -204,7 +202,7 @@ function syndication_view_item() { $output .= "
    titleattributesoperations
    \n"; $output .= " \n"; while ($item = db_fetch_object($result)) { - $output .= " \n"; + $output .= " \n"; } $output .= "
    timefeeditem
    ". format_date($item->timestamp, "custom", "H:i") ."fid\">". check_output($item->feed) ."link) ."\">". check_output($item->title) ."". ($item->description ? "
    ". check_output($item->description) ."" : "") ."
    iid]\" VALUE=\"". check_form($item->attribute) ."\" SIZE=\"50\">
    ". format_date($item->timestamp, "custom", "m/d/y") ."
    ".format_date($item->timestamp, "custom", "H:i") ."
    fid\">". check_output($item->feed) ."link) ."\">". check_output($item->title) ."". ($item->description ? "
    ". check_output($item->description) ."" : "") ."
    iid]\" VALUE=\"". check_form($item->attribute) ."\" SIZE=\"50\">
    \n"; $output .= "\n"; @@ -216,7 +214,7 @@ function syndication_view_item() { function syndication_admin() { global $op, $id, $type, $edit; - print "add new bundle | add new feed | available blocks | bundle overview | feed overview | item overview | help
    "; + print "add new bundle | add new feed | available bundles | available items | overview | help
    "; switch($op) { case "help": @@ -228,9 +226,6 @@ function syndication_admin() { else print syndication_form_feed(); break; - case "block": - print syndication_view_block(); - break; case "edit": if ($type == "bundle") print syndication_form_bundle(syndication_get_bundle($id)); -- cgit v1.2.3