summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/atom.php18
-rw-r--r--includes/header.php2
2 files changed, 13 insertions, 7 deletions
diff --git a/includes/atom.php b/includes/atom.php
index be8d8f8..726c4b6 100644
--- a/includes/atom.php
+++ b/includes/atom.php
@@ -39,6 +39,8 @@ function atom_header($metadatafile)
print("\t<author><name>" . $author . "</name></author>\n");
print("\t<link rel=\"self\" href=\"http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "\" />\n");
+ if (isset($license_rdf) && !empty($license_rdf))
+ print("\t<link rel=\"license\" type=\"application/rdf+xml\" href=\"" . $license_rdf . "\" />\n");
if (isset($copyright) && !empty($copyright))
print("\t<rights>" . $copyright . "</rights>\n");
$description = extract_description($body);
@@ -46,9 +48,9 @@ function atom_header($metadatafile)
print("\t<description>" . $description . "</description>\n");
}
-function create_entry($dir, $file)
+function create_entry($dir, $file, $full)
{
- unset($title, $body, $summary, $author, $language, $category, $updated);
+ unset($title, $body, $summary, $author, $language, $category, $updated, $license_rdf);
include($_SERVER['DOCUMENT_ROOT'] . "/" . $dir . "/" . $file);
print("\t<entry>\n");
@@ -63,11 +65,15 @@ function create_entry($dir, $file)
print("\t\t<author><name>" . $author . "</name></author>\n");
print("\t\t<link rel=\"alternate\" href=\"" . "http://" . $_SERVER['HTTP_HOST'] . "/" . $dir . "/" . $file . "\" />\n");
+ if (isset($license_rdf) && !empty($license_rdf))
+ print("\t\t<link rel=\"license\" type=\"application/rdf+xml\" href=\"" . $license_rdf . "\" />\n");
+
$summary = extract_description($body);
if (!empty($summary))
print("\t\t<summary>" . $summary . "</summary>\n");
- print("\t\t<content type=\"xhtml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">" . $body . "</div></content>\n");
+ if ($full)
+ print("\t\t<content type=\"xhtml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">" . $body . "</div></content>\n");
$category = ereg_replace("^text", "", $dir); /* dir after text */
if (!empty($category))
@@ -76,17 +82,17 @@ function create_entry($dir, $file)
print("\t</entry>\n");
}
-function create_entries_from_dir($dir)
+function create_entries_from_dir($dir, $full=false)
{
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (!is_dir($file)) {
if ($file[0] != "." && ereg(".php$", $file))
- create_entry($dir, $file);
+ create_entry($dir, $file, $full);
}
else {
if ($file[0] != ".")
- create_entries_from_dir($dir . "/" . $file);
+ create_entries_from_dir($dir . "/" . $file, $full);
}
}
closedir($handle);
diff --git a/includes/header.php b/includes/header.php
index cb0ef21..e03a7d6 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -35,7 +35,7 @@ function xhtml_header($title)
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>' . $newtitle . '</title>
<link rel="stylesheet" type="text/css" href="/includes/default.css" />
- <link rel="alternate" type="application/rss+xml" href="/rss.php" title="Excerpt feed" />
+ <link rel="alternate" type="application/atom+xml" href="/atom-excerpt.php" title="Excerpt feed" />
<link rel="alternate" type="application/atom+xml" href="/atom.php" title="Full feed" />
<link rel="icon" href="/graphics/candles.ico" />
</head>