From d1dbc96fea762360155c0cd11a988fb018c12be2 Mon Sep 17 00:00:00 2001 From: vyshane Date: Fri, 10 Feb 2006 03:03:29 +0000 Subject: [PATCH] Modified function rss_get_link() so that we ignore $userid if it is empty when we build the path to the XML file. We need this for RSS feeds for the data module, where it does not make sense to generate an XML file for each user when they will all be seeing the same feed. --- lib/rsslib.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/rsslib.php b/lib/rsslib.php index dcc3c419bc2..0129a118d6c 100644 --- a/lib/rsslib.php +++ b/lib/rsslib.php @@ -16,11 +16,17 @@ function rss_get_link($courseid, $userid, $modulename, $id, $tooltiptext='') { } if ($CFG->slasharguments) { - $rsspath = "$CFG->wwwroot/rss/file.php/$courseid/$userid/$modulename/$id/rss.xml"; + $rsspath = "$CFG->wwwroot/rss/file.php/$courseid"; } else { - $rsspath = "$CFG->wwwroot/rss/file.php?file=/$courseid/$userid/$modulename/$id/rss.xml"; + $rsspath = "$CFG->wwwroot/rss/file.php?file=/$courseid"; } - + if (!empty($userid)) { + $rsspath .= "/$userid/$modulename/$id/rss.xml"; + } + else { + $rsspath .= "/$modulename/$id/rss.xml"; + } + $rsspix = $CFG->pixpath .'/i/rss.gif'; return '';