From 4a990db44980aee2b88c1ceecfe71e697d173556 Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 18 Sep 2009 08:25:29 +0100 Subject: Added license link and use atom for excerpt Added optional license rdf link to feeds Use atom for excerpt feed also --- includes/atom.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'includes/atom.php') 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 . "\n"); print("\t\n"); + if (isset($license_rdf) && !empty($license_rdf)) + print("\t\n"); if (isset($copyright) && !empty($copyright)) print("\t" . $copyright . "\n"); $description = extract_description($body); @@ -46,9 +48,9 @@ function atom_header($metadatafile) print("\t" . $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\n"); @@ -63,11 +65,15 @@ function create_entry($dir, $file) print("\t\t" . $author . "\n"); print("\t\t\n"); + if (isset($license_rdf) && !empty($license_rdf)) + print("\t\t\n"); + $summary = extract_description($body); if (!empty($summary)) print("\t\t" . $summary . "\n"); - print("\t\t
" . $body . "
\n"); + if ($full) + print("\t\t
" . $body . "
\n"); $category = ereg_replace("^text", "", $dir); /* dir after text */ if (!empty($category)) @@ -76,17 +82,17 @@ function create_entry($dir, $file) print("\t
\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); -- cgit v1.2.3