forked from eromba/taskstep
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrss.php
44 lines (38 loc) · 1.16 KB
/
rss.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
Header('Content-type: text/xml');
//Same as bookmarklet code
$dirstuff = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']);
$full = "http://".$_SERVER['HTTP_HOST'].$dirstuff;
?>
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>TaskStep</title>
<link><?php echo $full ?></link>
<description>TaskStep Items Feed</description>
<language>en-us</language>
<generator>IceMelon RSS Feeder</generator>
<?php
include("config.php");
include("includes/functions.php");
connect();
$result = mysql_query("SELECT * FROM items");
while ($r=mysql_fetch_assoc($result))
{
$title=htmlentities($r["title"]);
$date = ($r["date"] != 00-00-0000) ? $r["date"]." | " : '';
$notes=htmlentities($r["notes"]);
$url=htmlentities($r["url"]);
$done=$r["done"];
$id=$r["id"];
$context=htmlentities($r["context"]);
$project=htmlentities($r["project"]);
$rssnotes = ($notes != "") ? " | ".$notes : '';
echo "\t\t<item>\n";
echo "\t\t\t<title>".$title."</title>\n";
echo "\t\t\t<link>".$full."edit.php?id=".$id."</link>\n";
echo "\t\t\t<description>".$date.$project." | ".$context.$rssnotes."</description>\n";
echo "\t\t</item>\n";
}?>
</channel>
</rss>