$params['user'] = isset($_GET['user']) ? $_GET['user'] : null;
$params['id'] = isset($_GET['id']) ? $_GET['id'] : null;
+$pathinfo = pathinfo($_SERVER['REQUEST_URI']);
$format = isset($pathinfo['extension']) ? $pathinfo['extension'] : null;
+$endpoint = str_replace('.'.$format, '', $endpoint);
+
$dbh = get_db_connection();
$dbh->beginTransaction();
$q->execute( array( $user['id'] ));
}
}
- if ($params['id']) {
+ else if ($params['id']) {
$q = $dbh->prepare("SELECT *, clumps.id as clump_id
FROM clumps
JOIN users
}
switch ($format) {
-case 'xml' :
+ case 'xml' :
case 'rss' :
include 'rss.php';
exit;
<?php for($i = 0; $row = $q->fetch(); $i++ ): ?>
<item>
- <title><?php echo urlencode($row['title']) ?></title>
- <link><?php echo urlencode($row['url']) ?></link>
+ <title><?php echo $row['title'] ?></title>
+ <link><?php echo $row['url'] ?></link>
<pubDate><?php echo date('r', strtotime($row['date'])); ?></pubDate>
</item>