# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . define('NO_GUI', 1); global $db; global $_USER; $page = (int)$_GET['page']; $start = getStart($page); $user = $_GET['u']; $params = PARAMS; if ($params == 'profile') { if(!$user) die('Missing user'); $userid = $db->getIdByUser($user); if(!$userid) die('Invalid user'); $result = $db->getNotes('archive', $start, NOTES_PER_PAGE, $userid); if(!$result) $items = array(); $title = __('RSS notes feed for: ') . $user; $desc = __('Notes of the selected user'); $link = 'rss/profile?user='.urlencode($user); createRSS($result, $title, $desc, $link); } elseif ($params == 'friends') { if(!$user) die('Missing user'); $userid = $db->getIdByUser($user); if(!$userid) die('Invalid user'); $result = $db->getNotes('friendsof', $start, NOTES_PER_PAGE, $userid); if(!$result) $items = array(); $title = __('RSS notes feed for friends of: ') . $user; $desc = __('Notes of the friends of the selected user'); $link = 'rss/friends?user='.urlencode($user); createRSS($result, $title, $desc, $link); } elseif ($params == 'tag') { $extra = EXTRA; if (!$db->checkTag($extra)) die('There are no notes with this tag'); else { $result = $db->getNotes('tag', $start, NOTES_PER_PAGE, $extra); $title = __('RSS notes feed for the tag: #').$extra; $desc = __('Notes that contain the tag #').$extra; $link = 'rss/tag/'.urlencode($extra); createRSS($result, $title, $desc, $link); } } ?>