From 3d8054c128f9a3b1ecd25adc623f73248c0cfeb5 Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Sun, 18 Dec 2011 02:39:46 -0800 Subject: [PATCH] Updated tagging system --- TODO | 11 +++++++- bookmarklet.js | 4 +-- clmpr.sql | 10 ++++--- footer.html | 7 +++++ get.php | 28 +++++++++++++------- head.html | 2 +- header.html | 3 +++ index.php | 19 +++++++------ new.php | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ put.php | 36 ++++++++++++++++++------- script.js | 8 ++++++ style.css | 32 +++++++++++++++++++--- tags.php | 65 +++++++++++++++++++++++++++++++++++++++++++++ 13 files changed, 256 insertions(+), 41 deletions(-) create mode 100644 footer.html create mode 100644 header.html create mode 100644 new.php create mode 100644 script.js create mode 100644 tags.php diff --git a/TODO b/TODO index 1026d9a..135f332 100644 --- a/TODO +++ b/TODO @@ -1 +1,10 @@ -- create server variable for bookmarklet +create server variable for bookmarklet +evaluate MVC architecture w/ template system +add description field + +tags: + delimit tags with commas in db (?) + need UNIQUE field in tags + increment tag count on insert + decrement tag count on delete + if zero delete row \ No newline at end of file diff --git a/bookmarklet.js b/bookmarklet.js index 290d99a..ff9b7de 100644 --- a/bookmarklet.js +++ b/bookmarklet.js @@ -4,7 +4,7 @@ b = document, c = encodeURIComponent, d = w.open( - 'http://clmpr/put.php?' + 'http://clmpr/new.php?' + 'url=' + c(b.location) + '&title=' + c(b.title) , 'clmpr_popup' @@ -15,4 +15,4 @@ d.focus() } , 300) } -)(); \ No newline at end of file +)(); diff --git a/clmpr.sql b/clmpr.sql index afecfa6..4fd7446 100644 --- a/clmpr.sql +++ b/clmpr.sql @@ -9,11 +9,11 @@ CREATE TABLE IF NOT EXISTS `clumps` ( `id` int(9) NOT NULL AUTO_INCREMENT, `user_id` int(9) NOT NULL, `title` varchar(255) NOT NULL, - `url` varchar(255) NOT NULL, - `tags` varchar(255) NOT NULL, + `url` varchar(255) NOT NULL DEFAULT '', + `tags` text NOT NULL, `date` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=239 ; +) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- Table structure for table `users` @@ -25,4 +25,6 @@ CREATE TABLE IF NOT EXISTS `users` ( `created` datetime NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `user` (`user`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + + diff --git a/footer.html b/footer.html new file mode 100644 index 0000000..6782d80 --- /dev/null +++ b/footer.html @@ -0,0 +1,7 @@ + + + diff --git a/get.php b/get.php index 1836133..d14dea1 100644 --- a/get.php +++ b/get.php @@ -49,7 +49,7 @@ case 'xml' :