X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;ds=sidebyside;f=index.php;h=8fe04325d6fcb5ec4aca99db08337b2fe99a9060;hb=05250f978cc7e3e1f7df92f20fd18f4667a06f2f;hp=700f69a182a9cb0d81bd7b72821a8dbc57195337;hpb=f870b65ad60d8ea7456384d38f8db6fd01275990;p=dylansserver.git
diff --git a/index.php b/index.php
index 700f69a..8fe0432 100644
--- a/index.php
+++ b/index.php
@@ -30,6 +30,8 @@ abstract class cms {
return 'index';
} else if (isset($_GET['project'])) {
return 'project';
+ } else if (isset($_GET['rss'])) {
+ return 'rss';
}
}
@@ -63,7 +65,7 @@ abstract class cms {
$scripts = "";
$stylesheets = " ";
if (cms::determine_type() == "index") {
- $scripts = "";
$home_link = "http://validator.w3.org/unicorn/check?ucn_uri=dylanstestserver.com&ucn_task=conformance#";
}
echo <<
$stylesheets
$scripts
-
@@ -123,11 +124,11 @@ END_OF_CLOSE;
class index extends cms {
public function display() {
- $this->display_head();
- $this->display_exhibits();
- echo "";
- $this->list_projects();
- echo <<display_head();
+ $this->display_exhibits();
+ echo "";
+ $this->list_projects();
+ echo <<
things i've done for others:
@@ -149,8 +150,7 @@ class index extends cms {
my repositories:
- git://dylanstestserver.com
+ git://dylanstestserver.com
some notes:
@@ -162,12 +162,14 @@ class index extends cms {
OTHER_PROJECTS;
- // Because of the CSS necessary for the animations,
- // the contact link needs to be in #portfolio to clear
- // the floats.
- $this->display_contact();
+ // Because of the CSS necessary for the animations,
+ // the contact link needs to be in #portfolio to clear
+ // the floats.
+ echo "";
+ $this->display_contact();
+ echo " ";
echo " ";
- $this->display_close($show_contact = false);
+ $this->display_close($show_contact = false);
}
protected function display_exhibits() {
@@ -181,7 +183,6 @@ OTHER_PROJECTS;
}
private function list_projects() {
- echo "";
echo <<
my projects:
@@ -417,6 +418,50 @@ class archive extends cms {
}
+class rss extends cms {
+ public function display() {
+ $result = $this->db->query("SELECT date_posted, title, text, url
+ FROM notes ORDER BY date_posted DESC
+ LIMIT 5");
+ echo <<
+
+ dylanstestserver.com/notes/rss
+ http://dylanstestserver.com/notes
+ dylanstestserver.com/notes/rss
+
+END_OF_ENTRY;
+ while ($entry = $result->fetch_object()) {
+ $title = $entry->title;
+ $date_posted = $entry->date_posted;
+ $url = "http://dylanstestserver.com/note/" . $entry->url;
+ $text = $entry->text;
+ $text = strip_tags($text);
+ $end_of_first_sentence = strpos($text, '.');
+ if ($end_of_first_sentence) {
+ $end_of_second_sentence = strpos($text, '.', ($end_of_first_sentence + 1));
+ if ($end_of_second_sentence) {
+ $description = substr($text, '0', ($end_of_second_sentence + 1));
+ } else {
+ $description = substr($text, '0', ($end_of_first_sentence + 1));
+ }
+ }
+ echo <<
+ $title
+ $url
+ $url
+ $description
+
+END_OF_ENTRY;
+ }
+ echo " ";
+ echo "";
+
+ }
+}
+
+
class notFound extends Exception {
public function __construct() {
header("HTTP/1.0 404 Not Found");
@@ -448,6 +493,9 @@ switch (cms::determine_type()) {
$archive = new archive;
$archive->display();
break;
+ case "rss":
+ $rss = new rss();
+ $rss->display();
}
?>