| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
// this is now only used for tag-search feeds |
|---|
| 5 |
|
|---|
| 6 |
// Run includes |
|---|
| 7 |
require("../includes.php"); |
|---|
| 8 |
|
|---|
| 9 |
run("weblogs:init"); |
|---|
| 10 |
run("profile:init"); |
|---|
| 11 |
|
|---|
| 12 |
global $individual; |
|---|
| 13 |
global $page_owner; |
|---|
| 14 |
|
|---|
| 15 |
$individual = 1; |
|---|
| 16 |
|
|---|
| 17 |
$sitename = (sitename); |
|---|
| 18 |
|
|---|
| 19 |
$output = ""; |
|---|
| 20 |
|
|---|
| 21 |
$tag = trim($_REQUEST['tag']); |
|---|
| 22 |
|
|---|
| 23 |
if (isset($page_owner)) { |
|---|
| 24 |
|
|---|
| 25 |
$rssactivity = sprintf(gettext("Activity tagged with %s"),$tag); |
|---|
| 26 |
|
|---|
| 27 |
$info = db_query("select * from users where ident = $page_owner"); |
|---|
| 28 |
if (sizeof($info) > 0) { |
|---|
| 29 |
$info = $info[0]; |
|---|
| 30 |
$name = (stripslashes($info->name)); |
|---|
| 31 |
$username = (stripslashes($info->username)); |
|---|
| 32 |
$mainurl = (url . $username . "/"); |
|---|
| 33 |
$rssurl = $mainurl . "rss/" . urlencode(trim($_REQUEST['tag'])); |
|---|
| 34 |
$url = url; |
|---|
| 35 |
$rssdescription = sprintf(gettext("Activity for %s, hosted on %s."),$name,$sitename); |
|---|
| 36 |
$output .= <<< END |
|---|
| 37 |
<?xml-stylesheet type="text/xsl" href="{$rssurl}/rssstyles.xsl"?> |
|---|
| 38 |
<rss version='2.0' xmlns:dc='http://purl.org/dc/elements/1.1/'> |
|---|
| 39 |
<channel xml:base='$mainurl'> |
|---|
| 40 |
<title><![CDATA[$name : $rssactivity]]></title> |
|---|
| 41 |
<description><![CDATA[$rssdescription]]></description> |
|---|
| 42 |
<link>$mainurl</link> |
|---|
| 43 |
END; |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
$output .= run("weblogs:rss:getitems", array($page_owner, 10, $tag)); |
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
$output .= run("files:rss:getitems", array($page_owner, 10, $tag)); |
|---|
| 51 |
|
|---|
| 52 |
$output .= <<< END |
|---|
| 53 |
|
|---|
| 54 |
</channel> |
|---|
| 55 |
</rss> |
|---|
| 56 |
END; |
|---|
| 57 |
} |
|---|
| 58 |
|
|---|
| 59 |
if ($output) { |
|---|
| 60 |
header("Pragma: public"); |
|---|
| 61 |
header("Cache-Control: public"); |
|---|
| 62 |
header('Expires: ' . gmdate("D, d M Y H:i:s", (time()+3600)) . " GMT"); |
|---|
| 63 |
|
|---|
| 64 |
$if_none_match = preg_replace('/[^0-9a-f]/', '', $_SERVER['HTTP_IF_NONE_MATCH']); |
|---|
| 65 |
|
|---|
| 66 |
$etag = md5($output); |
|---|
| 67 |
header('ETag: "' . $etag . '"'); |
|---|
| 68 |
|
|---|
| 69 |
if ($if_none_match == $etag) { |
|---|
| 70 |
header("{$_SERVER['SERVER_PROTOCOL']} 304 Not Modified"); |
|---|
| 71 |
exit; |
|---|
| 72 |
} |
|---|
| 73 |
|
|---|
| 74 |
header("Content-Length: " . strlen($output)); |
|---|
| 75 |
|
|---|
| 76 |
header("Content-type: text/xml"); |
|---|
| 77 |
echo $output; |
|---|
| 78 |
} |
|---|
| 79 |
} |
|---|