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.
This commit is contained in:
vyshane 2006-02-10 03:03:29 +00:00
parent 55e87e5386
commit d1dbc96fea

View File

@ -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 '<a href="'. $rsspath .'"><img src="'. $rsspix .'" title="'. strip_tags($tooltiptext) .'" alt="" /></a>';