root/releases/0.1.1b/_weblog/rss091.php

Revision 2, 1.6 kB (checked in by sven, 3 years ago)

importing elgg-0.1.1a

Line 
1 <?php
2
3     //    ELGG weblog RSS 0.91 page
4
5     // Run includes
6         require("../includes.php");
7         
8         run("profile:init");
9         run("friends:init");
10         run("weblogs:init");
11         
12         global $profile_id;
13         global $individual;
14         global $page_owner;
15         
16         $individual = 1;
17         
18         header("Content-type: text/xml");
19         
20         if (isset($page_owner)) {
21             
22             echo <<< END
23 <?xml version="1.0"?><!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.91.dtd">
24
25 <rss version="0.91">
26 END;
27             $info = db_query("select * from users where ident = $page_owner");
28             if (sizeof($info) > 0) {
29                 $info = $info[0];
30                 $name = htmlentities(stripslashes($info->name));
31                 $username = htmlentities(stripslashes($info->username));
32                 $sitename = sitename;
33                 $mainurl = htmlentities(url . $username . "/weblog/");
34                 echo <<< END
35   <channel>
36     <title>$name : Weblog</title>
37     <description>The weblog for $name, hosted on $sitename.</description>
38     <language>en-gb</language>
39     <link>$mainurl</link>
40 END;
41                 $entries = db_query("select * from weblog_posts where owner = $page_owner and access = 'PUBLIC' order by posted desc limit 10");
42                 if (sizeof($entries) > 0) {
43                     foreach($entries as $entry) {
44                         $title = htmlentities(stripslashes($entry->title));
45                         $link = url . $username . "/weblog/" . $entry->ident . ".html";
46                         $body = htmlentities(run("weblogs:text:process",stripslashes($entry->body)));
47                         echo <<< END
48     <item>
49         <title>$title</title>
50         <link>$link</link>
51         <description>$body</description>
52     </item>
53 END;
54                     }
55                 }
56                 echo <<< END
57   </channel>
58 </rss>
59 END;
60         }
61     }
Note: See TracBrowser for help on using the browser.