b7c51642de09b1664afa06f55f5b35c0e0f648da
3 class rss
extends model
{
5 public function display() {
6 require_once("view/rss.php");
9 public function display_items() {
10 $result = $this->db
->query("SELECT date_posted, title, text, url
11 FROM notes ORDER BY date_posted DESC
13 while ($entry = $result->fetch_object()) {
14 $title = $entry->title
;
15 $date_posted = $entry->date_posted
;
16 $url = "http://dylansserver.com/note/" . $entry->url
;
18 $text = strip_tags($text);
19 $end_of_first_sentence = strpos($text, '.');
20 if ($end_of_first_sentence) {
21 $end_of_second_sentence = strpos($text, '.', ($end_of_first_sentence +
1));
22 if ($end_of_second_sentence) {
23 $description = substr($text, '0', ($end_of_second_sentence +
1));
25 $description = substr($text, '0', ($end_of_first_sentence +
1));
29 echo " <title>$title</title>";
30 echo " <link>$url</link>";
31 echo " <guid>$url</guid>";
32 echo " <description>$description</description>";