Index: syndication.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/syndication/syndication.module,v
retrieving revision 1.38
diff -u -w -b -r1.38 syndication.module
--- syndication.module 2 Mar 2005 03:22:33 -0000 1.38
+++ syndication.module 21 Apr 2005 15:24:20 -0000
@@ -8,7 +8,7 @@
$items = array();
if ($may_cache) {
- $items[] = array('path' => 'syndication', 'title' => t('syndication'),
+ $items[] = array('path' => 'syndication', 'title' => t('RSS feeds'),
'access' => user_access('access content'),
'callback' => 'syndication_page',
'weight' => 6);
@@ -24,8 +24,15 @@
elseif ($op == 'view') {
if (user_access("access content")) {
$block["subject"] = t("Syndicate");
- $block["content"] = theme('xml_icon', url('node/feed'));
- $block["content"] .= '
'. l(t("more"), "syndication", array ("title" => t("Review all XML feeds exported by %sn", array ("%sn" => variable_get("site_name", "Drupal"))))). "
\n";
+ $pagetype = arg(0);
+ if ($pagetype == 'blog') {
+ $userid = arg(1);
+ $linkurl = is_numeric($userid) ? "blog/$userid/feed" : "blog/feed";
+ } else {
+ $linkurl = 'node/feed';
+ }
+ $block["content"] = theme('xml_icon', url("$linkurl/feed"));
+ $block["content"] .= ''. l(t("more"), "RSS", array ("title" => t("Review all XML feeds exported by %sn", array ("%sn" => variable_get("site_name", "Drupal"))))). "
\n";
return $block;
}
}
@@ -60,13 +67,14 @@
$result = db_query("SELECT uid, name FROM {users} WHERE name LIKE '%s' AND uid > 0 ORDER BY changed DESC", '%'. $edit["name"]. '%');
if (db_num_rows($result)) {
while ($account = db_fetch_object($result)) {
- $link[] = l(t("%s's RSS feed", array ("%s" => $account->name)), "blog/feed/$account->uid");
+ $link = array();
+ $link[] = l(t("%s's RSS feed", array ("%s" => $account->name)), "blog/$account->uid/feed");
$link[] = l(t("%s's blog", array ("%s" => $account->name)), "blog/$account->uid");
- $link[] = l(t("%s's profile", array ("%s" => $account->name)), "user/view/$account->uid");
- }
- $row[] = "$i. ". theme("links", $link);
+ $link[] = l(t("%s's profile", array ("%s" => $account->name)), "user/$account->uid");
+ $search_output .= "$i. ". theme("links", $link) . '
';
$i++;
- $output = form_item(t("Search Results"), implode($row, "
")). "
";
+ }
+ $output = form_item(t("Search Results"), $search_output);
}
else {
form_set_error('name', t("Username not found."));
@@ -76,7 +84,7 @@
$output .= "". t("At %sn, %all and each user, have an RSS feed for their blog.", array ("%sn" => variable_get("site_name", "Drupal"), "%all" => $all)). "
";
$result = db_query_range("SELECT DISTINCT(u.uid), u.name FROM {users} u INNER JOIN {node} n ON u.uid = n.uid WHERE n.type = 'blog' AND n.status = 1", 0, 16);
while ($account = db_fetch_object($result)) {
- $url = "blog/feed/$account->uid";
+ $url = "blog/$account->uid/feed";
$authors[] = l(t("%s's feed", array ("%s" => $account->name)), $url);
}
$output .= $authors ? form_item(t("Recent Blog Authors"), implode($authors, ", ")) : "";
***** CVS exited normally with code 1 *****