From 4db3a80e869ec8b8c3e0c3f8401c8df12ff5c553 Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Fri, 23 Mar 2012 04:48:19 -0400 Subject: [PATCH 01/16] now using a model for note pages, but its not clean --- cms.php | 169 +++++++----------------------------------------- model/model.php | 57 ++++++++++++++++ model/note.php | 124 +++++++++++++++++++++++++++++++++++ view/note.php | 18 +++--- 4 files changed, 215 insertions(+), 153 deletions(-) create mode 100644 model/model.php create mode 100644 model/note.php diff --git a/cms.php b/cms.php index 961a1f5..a3d9c3b 100644 --- a/cms.php +++ b/cms.php @@ -1,15 +1,18 @@ model = new model(); $config = parse_ini_file($this->config_file, true); $this->db = new mysqli( $config['database']['domain'], @@ -25,25 +28,6 @@ abstract class cms { $this->recaptcha_privatekey = $config['recaptcha']['privatekey']; $this->title = $config['site']['default_title']; $this->home_link = $config['site']['home_link']; - ob_start(); - } - - public static function determine_type() { - if (isset($_GET['page']) && is_numeric($_GET['page'])) { - return 'page'; - } else if (isset($_GET['year'])) { - return 'archive'; - } else if (isset($_GET['note'])) { - return 'note'; - } else if ($_SERVER['REQUEST_URI'] == '/') { - return 'index'; - } else if (isset($_GET['project'])) { - return 'project'; - } else if (isset($_GET['rss'])) { - return 'rss'; - } else if (isset($_GET['challenge'])) { - return 'captcha'; - } } public function query() { @@ -71,6 +55,24 @@ abstract class cms { return $return; } + public static function determine_type() { + if (isset($_GET['page']) && is_numeric($_GET['page'])) { + return 'page'; + } else if (isset($_GET['year'])) { + return 'archive'; + } else if (isset($_GET['note'])) { + return 'note'; + } else if ($_SERVER['REQUEST_URI'] == '/') { + return 'index'; + } else if (isset($_GET['project'])) { + return 'project'; + } else if (isset($_GET['rss'])) { + return 'rss'; + } else if (isset($_GET['challenge'])) { + return 'captcha'; + } + } + public function init() { switch (cms::determine_type()) { case 'index': @@ -82,8 +84,9 @@ abstract class cms { $project->display(); break; case 'note': - $note = new note; - $note->display(); + require_once("model/note.php"); + $note = new note(); + require_once("view/note.php"); break; case 'page': $page = new page; @@ -219,128 +222,6 @@ END_NOTE; } -class note extends cms { - - private $id; - private $comments_enabled = false; - private $failed_captcha; - public $url; - public $title; - public $year_posted; - public $month_posted; - public $day_posted; - public $text; - public $number_of_comments; - - public function __construct() { - parent::__construct(); - if (isset($_GET['comments'])) { - $this->comments_enabled = true; - } - $url = htmlspecialchars($_SERVER['REQUEST_URI']); - if (isset($_GET['verify'])) { - $url = substr($url, 0, (strlen($url)-6)); - } - $this->url = $url; - $sql = "SELECT title, date_posted, text, id - FROM notes WHERE url = ?"; - $result = $this->query($sql, "s", - $_GET['note']); - if ($result) { - $entry = $result[0]; - $this->id = $entry["id"]; - $this->title = $entry["title"]; - $date_posted = explode("-", $entry["date_posted"]); - $this->year_posted = $date_posted[0]; - $this->month_posted = $date_posted[1]; - $datetime_posted = explode(' ', $date_posted[2]); - $this->day_posted = $datetime_posted[0]; - $this->text = $entry["text"]; - } else { - throw new notFound(); - } - $sql = "SELECT COUNT(*) FROM comments - WHERE note = $this->id"; - $result = $this->db->query($sql); - $result = $result->fetch_array(); - $this->number_of_comments = $result[0]; - if (isset($_GET['verify'])) { - $this->verify(); - } - } - - public function display() { - require_once("view/note.php"); - } - - private function verify() { - if (!isset($_POST['captcha'])) { - require_once('includes/recaptchalib.php'); - echo "
"; - $resp = recaptcha_check_answer ($this->recaptcha_privatekey, - $_SERVER["REMOTE_ADDR"], - $_POST["recaptcha_challenge_field"], - $_POST["recaptcha_response_field"]); - if (!$resp->is_valid) { - $this->failed_captcha = true; - } - } - if (isset($_POST['captcha']) || $resp->is_valid) { - $sql = ("INSERT INTO comments (date_posted, author, - text, note) - VALUES(NOW(), ?, ?, ?)"); - $stmt = $this->db->prepare($sql); - // Checks are needed here (no blank text, - // and a default author needs to be set - // for no-javascript users. - $stmt->bind_param('sss', - $_POST['name'], - $_POST['text'], - $this->id); - $stmt->execute(); - } - } - - private function display_comment_link() { - if ($this->number_of_comments > 0) { - $anchor_text = "comments($this->number_of_comments)/"; - } else { - $anchor_text = "comment?"; - } - if (substr($this->url, (strlen($this->url)-1), strlen($this->url)) == '/') { - $url = $this->url . 'comments/'; - } else { - $url = $this->url . '/comments/'; - } - echo "$anchor_text"; - } - - private function display_comments() { - echo "
"; - $sql= "SELECT date_posted, author, text - FROM comments WHERE note = ? - ORDER BY date_posted DESC"; - $result = $this->query($sql, 'd', $this->id); - foreach ($result as $row => $entry) { - $date_posted = $entry['date_posted']; - $author = $entry['author']; - $text = htmlspecialchars($entry['text']); - $head = "

" . htmlspecialchars($author) . "

"; - echo "
"; - echo $head; - echo $text; - echo "
"; - } - echo "
"; - } - - private function display_comment_form() { - $publickey = $this->recaptcha_publickey; - require_once("view/comment-form.php"); - } -} - - class archive extends cms { public function __construct() { diff --git a/model/model.php b/model/model.php new file mode 100644 index 0000000..f9bb164 --- /dev/null +++ b/model/model.php @@ -0,0 +1,57 @@ +config_file, true); + $this->db = new mysqli( + $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(); + exit(); + } + $this->recaptcha_publickey = $config['recaptcha']['publickey']; + $this->recaptcha_privatekey = $config['recaptcha']['privatekey']; + $this->title = $config['site']['default_title']; + $this->home_link = $config['site']['home_link']; + } + + public function query() { + $args = func_get_args(); + $statement = $this->db->prepare($args[0]); + $args = array_slice($args, 1); + call_user_func_array(array($statement, 'bind_param'), &$args); + $statement->execute(); + $return = array(); + $statement->store_result(); + $row = array(); + $data = $statement->result_metadata(); + $fields = array(); + $fields[0] = &$statement; + while($field = $data->fetch_field()) { + $fields[] = &$row[$field->name]; + } + call_user_func_array("mysqli_stmt_bind_result", $fields); + $i = 0; + while ($statement->fetch()) { + foreach ($row as $key=>$value) $return[$i][$key] = $value; + $i++; + } + $statement->free_result(); + return $return; + } + +} + +?> diff --git a/model/note.php b/model/note.php new file mode 100644 index 0000000..01338be --- /dev/null +++ b/model/note.php @@ -0,0 +1,124 @@ +comments_enabled = true; + } + $url = htmlspecialchars($_SERVER['REQUEST_URI']); + if (isset($_GET['verify'])) { + $url = substr($url, 0, (strlen($url)-6)); + } + $this->url = $url; + $sql = "SELECT title, date_posted, text, id + FROM notes WHERE url = ?"; + $result = $this->query($sql, "s", + $_GET['note']); + if ($result) { + $entry = $result[0]; + $this->id = $entry["id"]; + $this->title = $entry["title"]; + $date_posted = explode("-", $entry["date_posted"]); + $this->year_posted = $date_posted[0]; + $this->month_posted = $date_posted[1]; + $datetime_posted = explode(' ', $date_posted[2]); + $this->day_posted = $datetime_posted[0]; + $this->text = $entry["text"]; + } else { + throw new notFound(); + } + $sql = "SELECT COUNT(*) FROM comments + WHERE note = $this->id"; + $result = $this->db->query($sql); + $result = $result->fetch_array(); + $this->number_of_comments = $result[0]; + if (isset($_GET['verify'])) { + $this->verify(); + } + } + + public function display() { + require_once("view/note.php"); + } + + public function verify() { + if (!isset($_POST['captcha'])) { + require_once('includes/recaptchalib.php'); + echo "
"; + $resp = recaptcha_check_answer ($this->recaptcha_privatekey, + $_SERVER["REMOTE_ADDR"], + $_POST["recaptcha_challenge_field"], + $_POST["recaptcha_response_field"]); + if (!$resp->is_valid) { + $this->failed_captcha = true; + } + } + if (isset($_POST['captcha']) || $resp->is_valid) { + $sql = ("INSERT INTO comments (date_posted, author, + text, note) + VALUES(NOW(), ?, ?, ?)"); + $stmt = $this->db->prepare($sql); + // Checks are needed here (no blank text, + // and a default author needs to be set + // for no-javascript users. + $stmt->bind_param('sss', + $_POST['name'], + $_POST['text'], + $this->id); + $stmt->execute(); + } + } + + public function display_comment_link() { + if ($this->number_of_comments > 0) { + $anchor_text = "comments($this->number_of_comments)/"; + } else { + $anchor_text = "comment?"; + } + if (substr($this->url, (strlen($this->url)-1), strlen($this->url)) == '/') { + $url = $this->url . 'comments/'; + } else { + $url = $this->url . '/comments/'; + } + echo "$anchor_text"; + } + + public function display_comments() { + echo "
"; + $sql= "SELECT date_posted, author, text + FROM comments WHERE note = ? + ORDER BY date_posted DESC"; + $result = $this->query($sql, 'd', $this->id); + foreach ($result as $row => $entry) { + $date_posted = $entry['date_posted']; + $author = $entry['author']; + $text = htmlspecialchars($entry['text']); + $head = "

" . htmlspecialchars($author) . "

"; + echo "
"; + echo $head; + echo $text; + echo "
"; + } + echo "
"; + } + + public function display_comment_form() { + $publickey = $this->recaptcha_publickey; + require_once("view/comment-form.php"); + } +} + +?> diff --git a/view/note.php b/view/note.php index 367b334..3174f9d 100644 --- a/view/note.php +++ b/view/note.php @@ -3,7 +3,7 @@ - <?php echo $this->title; ?> + <?php echo $note->title; ?> @@ -29,7 +29,7 @@
@@ -38,18 +38,18 @@

- year_posted/$this->month_posted/$this->day_posted/" ?> - title ?>

- text ?> + year_posted/$note->month_posted/$note->day_posted/" ?> + title ?> + text ?>




-- 2.30.2 From 6436af7589776b09d5a39a2a12cb8bd130915487 Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Fri, 23 Mar 2012 04:52:37 -0400 Subject: [PATCH 02/16] page now using model --- cms.php | 71 +++------------------------------------------------ view/page.php | 14 +++++----- 2 files changed, 10 insertions(+), 75 deletions(-) diff --git a/cms.php b/cms.php index a3d9c3b..428cae1 100644 --- a/cms.php +++ b/cms.php @@ -89,8 +89,9 @@ abstract class cms { require_once("view/note.php"); break; case 'page': - $page = new page; - $page->display(); + require_once("model/page.php"); + $page = new page(); + require_once("view/page.php"); break; case "rss": $rss = new rss(); @@ -156,72 +157,6 @@ class project extends index { } -class page extends cms { - - private $page = 1; - private $offset = 0; - private $notes_per_page = 4; - private $number_of_pages = 1; - - public function __construct() { - parent::__construct(); - $this->page_offset(); - } - - private function page_offset() { - $sql = "SELECT COUNT(*) FROM notes"; - $result = $this->db->query($sql); - $result = $result->fetch_array(); - $this->number_of_pages = ceil($result[0] / $this->notes_per_page); - if (isset($_GET['page']) && is_numeric($_GET['page'])) { - $this->page = (int) $_GET['page']; - } else { - throw new notFound(); - } - if ($this->page > $this->number_of_pages) { - throw new notFound(); - } - if ($this->page < 1) { - throw new notFound(); - } - $this->offset = ($this->page - 1) * $this->notes_per_page; - } - - public function display() { - require_once("view/page.php"); - } - - public function display_notes() { - echo "
"; - $sql = "SELECT date_posted, title, url, text - FROM notes ORDER BY date_posted DESC - LIMIT ?, ?"; - $result = $this->query($sql, "ii", - $this->offset, - $this->notes_per_page); - foreach ($result as $row => $entry) { - $title = $entry['title']; - $url = '/note/' . $entry['url']; - $date_posted = explode("-", $entry['date_posted']); - $year_posted = $date_posted[0]; - $month_posted = $date_posted[1]; - $datetime_posted = explode(' ', $date_posted[2]); - $day_posted = $datetime_posted[0]; - $text = $entry['text']; - echo << -

- $year_posted/$month_posted/$day_posted/$title -

- $text -
-END_NOTE; - } - echo "
"; - } -} - - class archive extends cms { public function __construct() { diff --git a/view/page.php b/view/page.php index 2829668..8bba8ac 100644 --- a/view/page.php +++ b/view/page.php @@ -3,7 +3,7 @@ - <?php echo $this->title; ?> + <?php echo $page->title; ?> @@ -29,23 +29,23 @@
- display_notes() ?> + display_notes() ?> "; + } + + public function list_projects() { + $sql = "SELECT title FROM projects ORDER BY rank"; + $result = $this->db->query($sql); + while ($entry = $result->fetch_object()) { + echo "
  • $entry->title
  • "; + } + } + +} + +?> diff --git a/model/page.php b/model/page.php new file mode 100644 index 0000000..fe7d0a6 --- /dev/null +++ b/model/page.php @@ -0,0 +1,68 @@ +page_offset(); + } + + private function page_offset() { + $sql = "SELECT COUNT(*) FROM notes"; + $result = $this->db->query($sql); + $result = $result->fetch_array(); + $this->number_of_pages = ceil($result[0] / $this->notes_per_page); + if (isset($_GET['page']) && is_numeric($_GET['page'])) { + $this->page = (int) $_GET['page']; + } else { + throw new notFound(); + } + if ($this->page > $this->number_of_pages) { + throw new notFound(); + } + if ($this->page < 1) { + throw new notFound(); + } + $this->offset = ($this->page - 1) * $this->notes_per_page; + } + + public function display() { + require_once("view/page.php"); + } + + public function display_notes() { + echo "
    "; + $sql = "SELECT date_posted, title, url, text + FROM notes ORDER BY date_posted DESC + LIMIT ?, ?"; + $result = $this->query($sql, "ii", + $this->offset, + $this->notes_per_page); + foreach ($result as $row => $entry) { + $title = $entry['title']; + $url = '/note/' . $entry['url']; + $date_posted = explode("-", $entry['date_posted']); + $year_posted = $date_posted[0]; + $month_posted = $date_posted[1]; + $datetime_posted = explode(' ', $date_posted[2]); + $day_posted = $datetime_posted[0]; + $text = $entry['text']; + echo << +

    + $year_posted/$month_posted/$day_posted/$title +

    + $text +
    +END_NOTE; + } + echo "
    "; + } +} + +?> diff --git a/model/project.php b/model/project.php new file mode 100644 index 0000000..c7f780d --- /dev/null +++ b/model/project.php @@ -0,0 +1,23 @@ +"; + $sql = "SELECT text FROM projects + WHERE title = ?"; + $result = $this->query($sql, "s", $_GET['project']); + if ($result = $result[0]['text']) { + $text = str_replace("class='exhibit'", "class='exhibit' style='display:block;'", $result); + echo $text; + echo "
    "; + } else { + throw new notFound(); + } + } + +} + +?> diff --git a/model/rss.php b/model/rss.php new file mode 100644 index 0000000..b7c5164 --- /dev/null +++ b/model/rss.php @@ -0,0 +1,38 @@ +db->query("SELECT date_posted, title, text, url + FROM notes ORDER BY date_posted DESC + LIMIT 5"); + while ($entry = $result->fetch_object()) { + $title = $entry->title; + $date_posted = $entry->date_posted; + $url = "http://dylansserver.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 ""; + echo " $title"; + echo " $url"; + echo " $url"; + echo " $description"; + echo ""; + } + } +} + +?> diff --git a/view/index.php b/view/index.php index b90915e..fb2ed19 100644 --- a/view/index.php +++ b/view/index.php @@ -3,7 +3,7 @@ - <?php echo $this->title; ?> + <?php echo $this->title ?> diff --git a/view/note.php b/view/note.php index 3174f9d..367b334 100644 --- a/view/note.php +++ b/view/note.php @@ -3,7 +3,7 @@ - <?php echo $note->title; ?> + <?php echo $this->title; ?> @@ -29,7 +29,7 @@
    @@ -38,18 +38,18 @@

    - year_posted/$note->month_posted/$note->day_posted/" ?> - title ?>

    - text ?> + year_posted/$this->month_posted/$this->day_posted/" ?> + title ?> + text ?>




    diff --git a/view/page.php b/view/page.php index 8bba8ac..2829668 100644 --- a/view/page.php +++ b/view/page.php @@ -3,7 +3,7 @@ - <?php echo $page->title; ?> + <?php echo $this->title; ?> @@ -29,23 +29,23 @@
    - display_notes() ?> + display_notes() ?> "; } } diff --git a/view/page.php b/view/page.php index 2829668..72d5edd 100644 --- a/view/page.php +++ b/view/page.php @@ -35,8 +35,25 @@
    -
    - display_notes() ?> +
    +
    + notes as $note) { + echo "
    "; + echo "

    "; + echo ""; + echo $note['year_posted'] . "/"; + echo $note['month_posted'] . "/"; + echo $note['day_posted'] . "/"; + echo ""; + echo ""; + echo $note['title']; + echo ""; + echo "

    "; + echo $note['text']; + } + ?> +
    - display_exhibits() ?> +
    + exhibits as $exhibit) { + echo $exhibit; + } + ?> +
    • my projects:

    • - list_projects() ?> + projects as $project => $title) { + echo "
    • $title
    • "; + } + ?>
    • things i've done for others:

    • -- 2.30.2 From 5bcb138ac97476619e78aaa52e9f5507003d5caf Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Sat, 24 Mar 2012 15:17:42 -0400 Subject: [PATCH 09/16] rss layout now fully separated m/v/c --- model/rss.php | 29 +++++++++++++---------------- view/rss.php | 11 ++++++++++- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/model/rss.php b/model/rss.php index b7c5164..a169ead 100644 --- a/model/rss.php +++ b/model/rss.php @@ -2,35 +2,32 @@ class rss extends model { + public $items = array(); + public function display() { + $this->fetch_items(); require_once("view/rss.php"); } - public function display_items() { + public function fetch_items() { $result = $this->db->query("SELECT date_posted, title, text, url FROM notes ORDER BY date_posted DESC LIMIT 5"); while ($entry = $result->fetch_object()) { - $title = $entry->title; - $date_posted = $entry->date_posted; - $url = "http://dylansserver.com/note/" . $entry->url; - $text = $entry->text; - $text = strip_tags($text); - $end_of_first_sentence = strpos($text, '.'); + $entry->url = "http://dylansserver.com/note/" . $entry->url; + $entry->text = strip_tags($entry->text); + $end_of_first_sentence = strpos($entry->text, '.'); if ($end_of_first_sentence) { - $end_of_second_sentence = strpos($text, '.', ($end_of_first_sentence + 1)); + $end_of_second_sentence = strpos($entry->text, '.', ($end_of_first_sentence + 1)); if ($end_of_second_sentence) { - $description = substr($text, '0', ($end_of_second_sentence + 1)); + $entry->description = substr($entry->text, '0', ($end_of_second_sentence + 1)); } else { - $description = substr($text, '0', ($end_of_first_sentence + 1)); + $entry->description = substr($entry->text, '0', ($end_of_first_sentence + 1)); } + foreach ($entry as $key => $val) { + $this->items[][$key] = $entry->$key; + } } - echo ""; - echo " $title"; - echo " $url"; - echo " $url"; - echo " $description"; - echo ""; } } } diff --git a/view/rss.php b/view/rss.php index 2f55ca3..7d0c60c 100644 --- a/view/rss.php +++ b/view/rss.php @@ -4,6 +4,15 @@ http://dylansserver.com/notes dylansserver.com/notes/rss - display_items() ?> + items as $item) { + echo ""; + echo " " . $item['title'] . ""; + echo " " . $item['url'] . ""; + echo " " . $item['url'] . ""; + echo " " . $item['description'] . ""; + echo ""; + } + ?> -- 2.30.2 From 3ac8e530ad5b9c2f32792ac897852c7989cef2fa Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Sat, 24 Mar 2012 15:40:06 -0400 Subject: [PATCH 10/16] archive now separated m/v/c --- model/archive.php | 35 ++++++++++++----------------------- view/archive.php | 34 ++++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/model/archive.php b/model/archive.php index 0f805d4..d0947c4 100644 --- a/model/archive.php +++ b/model/archive.php @@ -2,6 +2,8 @@ class archive extends model { + public $notes = array(); + public function __construct() { parent::__construct(); } @@ -16,10 +18,11 @@ class archive extends model { } public function display() { + $this->fetch_notes(); require_once("view/archive.php"); } - public function display_notes() { + public function fetch_notes() { switch (true) { case (isset($_GET['year']) && !isset($_GET['month']) && !isset($_GET['day'])): @@ -50,28 +53,14 @@ class archive extends model { $_GET['day']); break; } - if (count($result) >= 1) { - echo "
      "; - foreach ($result as $row => $entry) { - $title = $entry['title']; - $url = '/note/' . $entry['url']; - $date_posted = explode("-", $entry['date_posted']); - $year_posted = $date_posted[0]; - $month_posted = $date_posted[1]; - $datetime_posted = explode(' ', $date_posted[2]); - $day_posted = $datetime_posted[0]; - echo "
      "; - echo "

      "; - echo "$year_posted/$month_posted/$day_posted/"; - echo "$title

      "; - echo $entry['text']; - echo "
      "; - } - echo "
      "; - } else { - echo "
      "; - echo "

      sorry, nothing here

      "; - echo "
      Empty set (0.00 sec)
      "; + foreach ($result as $row => $entry) { + $entry['url'] = '/note/' . $entry['url']; + $date_posted = explode("-", $entry['date_posted']); + $entry['year_posted'] = $date_posted[0]; + $entry['month_posted'] = $date_posted[1]; + $entry['datetime_posted'] = explode(' ', $date_posted[2]); + $entry['day_posted'] = $entry['date_posted'][0]; + $this->notes[$row] = $entry; } } diff --git a/view/archive.php b/view/archive.php index 2829668..073c65f 100644 --- a/view/archive.php +++ b/view/archive.php @@ -36,20 +36,26 @@
      - display_notes() ?> - + notes) >= 1) { + foreach ($this->notes as $note) { + echo "
      "; + echo "

      "; + echo $note['year_posted'] . "/"; + echo $note['month_posted'] . "/"; + echo $note['day_posted'] . "/"; + echo ""; + echo $note['title'] . "

      "; + echo $note['text']; + echo "
      "; + } + } else { + echo "
      "; + echo "

      sorry, nothing here

      "; + echo "
      Empty set (0.00 sec)
      "; + } + ?> +

      dylan

      @psu.edu -- 2.30.2 From 86ca40f0b2234a734a277ffb6cd6388b9355d1a6 Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Sat, 24 Mar 2012 15:49:37 -0400 Subject: [PATCH 11/16] separated model/note.php into functions --- model/note.php | 68 ++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/model/note.php b/model/note.php index d5ab563..8e863f1 100644 --- a/model/note.php +++ b/model/note.php @@ -24,6 +24,11 @@ class note extends model { $url = substr($url, 0, (strlen($url)-6)); } $this->url = $url; + $this->fetch_note(); + $this->fetch_comments(); + } + + public function fetch_note() { $sql = "SELECT title, date_posted, text, id FROM notes WHERE url = ?"; $result = $this->query($sql, "s", @@ -41,6 +46,9 @@ class note extends model { } else { throw new notFound(); } + } + + public function fetch_comments() { $sql = "SELECT COUNT(*) FROM comments WHERE note = $this->id"; $result = $this->db->query($sql); @@ -55,34 +63,6 @@ class note extends model { require_once("view/note.php"); } - public function verify() { - if (!isset($_POST['captcha'])) { - require_once('includes/recaptchalib.php'); - echo "
      "; - $resp = recaptcha_check_answer ($this->recaptcha_privatekey, - $_SERVER["REMOTE_ADDR"], - $_POST["recaptcha_challenge_field"], - $_POST["recaptcha_response_field"]); - if (!$resp->is_valid) { - $this->failed_captcha = true; - } - } - if (isset($_POST['captcha']) || $resp->is_valid) { - $sql = ("INSERT INTO comments (date_posted, author, - text, note) - VALUES(NOW(), ?, ?, ?)"); - $stmt = $this->db->prepare($sql); - // Checks are needed here (no blank text, - // and a default author needs to be set - // for no-javascript users. - $stmt->bind_param('sss', - $_POST['name'], - $_POST['text'], - $this->id); - $stmt->execute(); - } - } - public function display_comment_link() { if ($this->number_of_comments > 0) { $anchor_text = "comments($this->number_of_comments)/"; @@ -98,7 +78,6 @@ class note extends model { } public function display_comments() { - // should be called like $note->comment[0]['author'] $sql= "SELECT date_posted, author, text FROM comments WHERE note = ? ORDER BY date_posted DESC"; @@ -110,13 +89,42 @@ class note extends model { $this->comment[$i]['text'] = htmlspecialchars($entry['text']); $this->comment[$i]['head'] = "

      " . htmlspecialchars($author) . "

      "; $i++; - } + } } public function display_comment_form() { $publickey = $this->recaptcha_publickey; require_once("view/comment-form.php"); } + + public function verify() { + if (!isset($_POST['captcha'])) { + require_once('includes/recaptchalib.php'); + echo "
      "; + $resp = recaptcha_check_answer ($this->recaptcha_privatekey, + $_SERVER["REMOTE_ADDR"], + $_POST["recaptcha_challenge_field"], + $_POST["recaptcha_response_field"]); + if (!$resp->is_valid) { + $this->failed_captcha = true; + } + } + if (isset($_POST['captcha']) || $resp->is_valid) { + $sql = ("INSERT INTO comments (date_posted, author, + text, note) + VALUES(NOW(), ?, ?, ?)"); + $stmt = $this->db->prepare($sql); + // Checks are needed here (no blank text, + // and a default author needs to be set + // for no-javascript users. + $stmt->bind_param('sss', + $_POST['name'], + $_POST['text'], + $this->id); + $stmt->execute(); + } + } + } ?> -- 2.30.2 From c8d6aa1779e2fc2c21fb2b9d856dbee810ac2fe1 Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Wed, 27 Jun 2012 02:35:29 -0400 Subject: [PATCH 12/16] pass-by-reference defined in func. def. not call --- model/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/model.php b/model/model.php index f9bb164..9088831 100644 --- a/model/model.php +++ b/model/model.php @@ -31,7 +31,7 @@ class model { $args = func_get_args(); $statement = $this->db->prepare($args[0]); $args = array_slice($args, 1); - call_user_func_array(array($statement, 'bind_param'), &$args); + call_user_func_array(array($statement, 'bind_param'), $args); $statement->execute(); $return = array(); $statement->store_result(); -- 2.30.2 From 66c99d6519da8b6c2dc1eb04641ea6010789aee7 Mon Sep 17 00:00:00 2001 From: dylan Date: Sun, 16 Dec 2012 03:17:46 +0000 Subject: [PATCH 13/16] added background image & adjusted styles for it --- images/gray_jean.png | Bin 0 -> 13475 bytes includes/style.css | 4 ++++ includes/syntax/styles/shCoreDefault.css | 9 ++++++--- includes/syntax/styles/shThemeDefault.css | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 images/gray_jean.png diff --git a/images/gray_jean.png b/images/gray_jean.png new file mode 100644 index 0000000000000000000000000000000000000000..355fba2e4014ee4e4023137382b01428247e1243 GIT binary patch literal 13475 zcmbVzWmFx{wkHxGct~)U0Kx5GCvXTH+}$O(yL*DW1lN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u7~r3@SNcjJlBb&x>Ejk2#kp)(W}amA};RX1hsAL3p@_w#{+%)Vh!0(n@Z>Bb;Z0 z9pK8Bcs(NVM4@YBTXS)r4=UDjZ$hu5Nn$YGt^{~{Sqb$&^Ow03GHn=^Gk{$v)c33U zw?bkBws}s57JA8ei@;Ce+q#zhQGrGy;w5ADv;7;zyRmC>8Ua}@kw+hOat5D@!U@+Q z50f4DAMQk6Od#V0Xv4iR1xopr_iFdq6c~C!WsbsA>0K@;|~*AW}Vc(e!?XFpQa8 zl#QQxKR0pd_a*ab4!|+(TgD>tXyn*;0Jc20&JtV6Ch9;q_zVQ8dj>aMIC<0yY1I}V&?gsDK@lMIDa4Q?&H8-zp!3Ou_IzS9DT{kWrao4C|~89BCLi?d8(!UxCSpWYVY?KTtl6zDREg zr*<=ys4=zw%6GkuXFD2mGt{Wr#+9HofJPFah_8f&92P%)t=RJw zO|3#JhUgIth>R#nhg{@w1=EF8GjKgRRMxCj1<_wQ%Zu`S{tX>%z8>-9Lx=4@zYU2ANeh+<{Pg)> DeE@Bk literal 0 HcmV?d00001 diff --git a/includes/style.css b/includes/style.css index 5329f68..8128933 100644 --- a/includes/style.css +++ b/includes/style.css @@ -25,6 +25,10 @@ margin:0; padding:0; } +body { + background-image: url('../images/gray_jean.png'); +} + h3 { margin-top:15px; font-family:MuseoSlab500; diff --git a/includes/syntax/styles/shCoreDefault.css b/includes/syntax/styles/shCoreDefault.css index 08f9e10..81f2a3b 100644 --- a/includes/syntax/styles/shCoreDefault.css +++ b/includes/syntax/styles/shCoreDefault.css @@ -92,7 +92,7 @@ width: 100% !important; height: 100% !important; border: none !important; - background: white !important; + /*background: white !important;*/ padding-left: 1em !important; overflow: hidden !important; white-space: pre !important; @@ -225,6 +225,7 @@ color: black !important; } +/* .syntaxhighlighter { background-color: white !important; } @@ -237,6 +238,8 @@ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #e0e0e0 !important; } +*/ + .syntaxhighlighter .line.highlighted.number { color: black !important; } @@ -251,7 +254,7 @@ } .syntaxhighlighter .gutter .line.highlighted { background-color: #6ce26c !important; - color: white !important; + /*color: white !important;*/ } .syntaxhighlighter.printing .line .content { border: none !important; @@ -261,7 +264,7 @@ } .syntaxhighlighter.collapsed .toolbar { color: blue !important; - background: white !important; + /*background: white !important;*/ border: 1px solid #6ce26c !important; } .syntaxhighlighter.collapsed .toolbar a { diff --git a/includes/syntax/styles/shThemeDefault.css b/includes/syntax/styles/shThemeDefault.css index 1365411..bbf1d05 100644 --- a/includes/syntax/styles/shThemeDefault.css +++ b/includes/syntax/styles/shThemeDefault.css @@ -14,6 +14,8 @@ * @license * Dual licensed under the MIT and GPL licenses. */ + +/* .syntaxhighlighter { background-color: white !important; } @@ -26,6 +28,8 @@ .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { background-color: #e0e0e0 !important; } +*/ + .syntaxhighlighter .line.highlighted.number { color: black !important; } -- 2.30.2 From c000288ec5cdf406a0f3337d42d284b2cbc5d148 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 22 Dec 2012 19:20:03 +0000 Subject: [PATCH 14/16] rm'd background from submit buttons --- includes/style.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/style.css b/includes/style.css index 8128933..abf4883 100644 --- a/includes/style.css +++ b/includes/style.css @@ -160,8 +160,7 @@ text-align:left; } #comment .submit { -background:#FFF; -border:1px solid #FFF; +border:none; color:blue; cursor:pointer; font-size:120%; -- 2.30.2 From 05ee354833cf176bb87fd388062e3f4437906873 Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Wed, 13 Feb 2013 03:41:42 -0500 Subject: [PATCH 15/16] don't load comment js on index --- view/index.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/view/index.php b/view/index.php index 2f9b0c9..dd57224 100644 --- a/view/index.php +++ b/view/index.php @@ -7,23 +7,7 @@ - - - - - - + -- 2.30.2 From cc745a8bb5f5cde272e87edf1aee498b2400b631 Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Wed, 13 Feb 2013 03:42:25 -0500 Subject: [PATCH 16/16] formatting changes, projects list update --- view/index.php | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/view/index.php b/view/index.php index dd57224..d13cbc3 100644 --- a/view/index.php +++ b/view/index.php @@ -35,21 +35,24 @@ } ?>
    • -

      things i've done for others:

      +

      things i've worked on:

    • activehamptons.com
    • + "https://duckduckgo.com">duckduckgo.com
    • transfishing.com
    • + "http://tempositions.com">tempositions.com
    • -

      something i've worked on:

      +

      things i've made for others:

    • tempositions.com
    • + "http://activehamptons.com">activehamptons.com + +
    • transfishing.com
    • my repositories:

      @@ -58,6 +61,9 @@
    • git://dylansserver.com
    • +
    • git://github.com/nospampleasemam
    • +
    • some notes:

    • @@ -76,16 +82,21 @@
    • -


    +
    +
    +
    +  
    - -- 2.30.2