public function __construct() {
$config = parse_ini_file($this->config_file, true);
$this->db = new mysqli(
- $config[database]['domain'],
- $config[database]['user'],
- $config[database]['password'],
- $config[database]['database']);
+ $config['database']['domain'],
+ $config['database']['user'],
+ $config['database']['password'],
+ $config['database']['database']);
if (mysqli_connect_errno()) {
echo "Problem connecting to database: ";
echo mysqli_connect_error();
$scripts
</head>
-<body>
+<body onload="return typeof highlight == 'function' ? highlight() : true;">
<div id="structure">
<div id="banner">
<a href="$this->home_link">
$this->scripts = "<script type='text/javascript' src='/includes/index.js'></script>";
$this->display_head();
$this->display_exhibits();
- echo "<ul id='portfolio' style='text-align:right'>";
+ echo "<ul id='portfolio'>";
$this->list_projects();
echo <<<OTHER_PROJECTS
<li>
</li>
<li><a href=
- "git">git://dylansserver.com</a></li>
+ "/git/">git://dylansserver.com</a></li>
<li>
<h3>some notes:</h3>
</li>
<li><a href=
- "/notes/">here</a></li>
+ "/notes/">here</a> [<a href="/notes/rss">rss</a>]</li>
+
+ <li>
+ <h3>my resume:</h3>
+ </li>
+
+ <li>[<a href=
+ "/resume">pdf</a>]</li>
<li>
</li>
protected function display_exhibits() {
echo "<div id='exhibit'>";
- $sql = "SELECT text FROM projects";
+ $sql = "SELECT text FROM projects ORDER BY rank";
$result = $this->db->query($sql);
while ($entry = $result->fetch_object()) {
echo $entry->text;
<h3>my projects:</h3>
</li>
HEREDOC;
- $sql = "SELECT title FROM projects";
+ $sql = "SELECT title FROM projects ORDER BY rank";
$result = $this->db->query($sql);
while ($entry = $result->fetch_object()) {
echo "<li><a class='tab' href='$entry->title'>$entry->title</a></li>";
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() {
public $number_of_comments;
public function __construct() {
- if (isset($_GET['comments'])) {
$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>
+ ";
+
+ if (isset($_GET['comments'])) {
+ $this->scripts .= "
<script type='text/javascript' src='http://www.google.com/recaptcha/api/js/recaptcha_ajax.js'></script>
<script type='text/javascript' src='/includes/comment.js'></script>";
}
// and a default author needs to be set
// for no-javascript users.
$stmt->bind_param('sss',
- htmlspecialchars($_POST['name']),
- htmlspecialchars($_POST['text']),
+ $_POST['name'],
+ $_POST['text'],
$this->id);
$stmt->execute();
}
private function write_navigation() {
echo <<<END_OF_NAVIGATION
- <br>
+ <br><br><br><br>
<div id='navigation'>
<h1>
END_OF_NAVIGATION;
$this->display_comment_link();
}
echo <<<END_OF_NAVIGATION
- <a href="/notes/">back to notes</a>/
+ <a href="/notes/">back to notes/</a>
</h1>
</div>
END_OF_NAVIGATION;
$date_posted = $entry['date_posted'];
$author = $entry['author'];
$text = htmlspecialchars($entry['text']);
- $head = "<h3>$author</h3>";
+ $head = "<h3>" . htmlspecialchars($author) . "</h3>";
echo <<<END_OF_COMMENT
<div class='comment'>
$head
<nowiki>
<div id="recaptcha_widget">
- <h3 class="recaptcha_only_if_image"><b>what's this say</b>?</h3>
- <h3 class="recaptcha_only_if_audio"><b>enter the numbers you hear</b>:</h3>
- <span style="font-size:80%;">
- ( <a href="javascript:Recaptcha.reload()">another</a> /
- <span class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">audio</a></span> /
- <span class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">image</a></span><a href="javascript:Recaptcha.showhelp()">help</a> )
- </span>
- <br><br>
+ <br>
+ <h3><b>what's this say</b>?</h3>
+ <br>
+ <div id="recaptcha_image"></div>
+ <br><br><br>
+ <span class="recaptcha_only_if_image"><br><br><br></span>
<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
<br><br>
- <div style="float:right;position:relative;width:100px;">
- <div id="recaptcha_image"></div>
- </div>
- <br><br><br><br>
+ <h3 class="recaptcha_only_if_audio"><b>enter the numbers you hear</b>:</h3>
+ <span class="recaptcha_help">
+ <a href="javascript:Recaptcha.reload()">another?</a> /
+ <span class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">audio?</a> /</span>
+ <span class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">image?</a></span><a href="javascript:Recaptcha.showhelp()">help?</a>
+ </span>
</div>
END_OF_FORM;
echo recaptcha_get_html($this->recaptcha_publickey);
echo <<<END_OF_ENTRY
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
- <title>dylanstestserver.com/notes/rss</title>
- <link>http://dylanstestserver.com/notes</link>
- <description>dylanstestserver.com/notes/rss</description>
- <atom:link href="http://dylanstestserver.com/notes/rss" rel="self" type="application/rss+xml" />
+ <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;
- $url = "http://dylanstestserver.com/note/" . $entry->url;
+ $url = "http://dylansserver.com/note/" . $entry->url;
$text = $entry->text;
$text = strip_tags($text);
$end_of_first_sentence = strpos($text, '.');
case "rss":
$rss = new rss();
$rss->display();
+ break;
case 'archive':
$archive = new archive;
$archive->display();