protected $db;
protected $recaptcha_publickey;
protected $recaptcha_privatekey;
- protected $scripts;
public $title;
public $home_link;
public function __construct() {
parent::__construct();
$this->page_offset();
- $this->scripts = "
- <script type='text/javascript' src='/includes/syntax/scripts/shCore.js'></script>
- <script type='text/javascript' src='/includes/syntax/scripts/shAutoloader.js'></script>
- <link type='text/css' rel='stylesheet' href='/includes/syntax/styles/shCore.css'>
- <link type='text/css' rel='stylesheet' href='/includes/syntax/styles/shThemeDefault.css'>
- <script type='text/javascript'>
- function highlight() {
- SyntaxHighlighter.autoloader(
- 'js /includes/syntax/scripts/shBrushJScript.js',
- 'bash /includes/syntax/scripts/shBrushBash.js',
- 'sql /includes/syntax/scripts/shBrushSql.js',
- 'cpp /includes/syntax/scripts/shBrushCpp.js');
- SyntaxHighlighter.defaults['gutter'] = false;
- SyntaxHighlighter.defaults['toolbar'] = false;
- SyntaxHighlighter.all();
- }
- </script>
- ";
}
private function page_offset() {
class rss extends cms {
+
public function display() {
+ require_once("view/rss.php");
+ }
+
+ public function display_items() {
$result = $this->db->query("SELECT date_posted, title, text, url
FROM notes ORDER BY date_posted DESC
LIMIT 5");
- echo <<<END_OF_ENTRY
- <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
- <channel>
- <title>dylansserver.com/notes/rss</title>
- <link>http://dylansserver.com/notes</link>
- <description>dylansserver.com/notes/rss</description>
- <atom:link href="http://dylansserver.com/notes/rss" rel="self" type="application/rss+xml" />
-END_OF_ENTRY;
while ($entry = $result->fetch_object()) {
$title = $entry->title;
$date_posted = $entry->date_posted;
$description = substr($text, '0', ($end_of_first_sentence + 1));
}
}
- echo <<<END_OF_ENTRY
- <item>
- <title>$title</title>
- <link>$url</link>
- <guid>$url</guid>
- <description>$description</description>
- </item>
-END_OF_ENTRY;
+ echo "<item>";
+ echo " <title>$title</title>";
+ echo " <link>$url</link>";
+ echo " <guid>$url</guid>";
+ echo " <description>$description</description>";
+ echo "</item>";
}
- echo "</channel>";
- echo "</rss>";
-
}
}