From 050dc3862dcd272e88bfb7844307c5f18b9c186e Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Wed, 21 Dec 2011 07:33:59 -0800 Subject: [PATCH] working on tagging --- TODO | 2 ++ new.php | 28 +++++++++++++++++----------- put.php | 32 ++++++++++++++++---------------- signup.php | 2 +- style.css | 13 +++++++++++++ 5 files changed, 49 insertions(+), 28 deletions(-) diff --git a/TODO b/TODO index fa0a6fa..823a3a6 100644 --- a/TODO +++ b/TODO @@ -17,3 +17,5 @@ ref http://code.google.com/p/mysqlicious/ +tag complete + http://jqueryui.com/demos/autocomplete/#multiple diff --git a/new.php b/new.php index 165980c..e3e5990 100644 --- a/new.php +++ b/new.php @@ -19,34 +19,40 @@ try {

- +

- -

- -

- - +

+ + + +

- -

+ +


- + cancel



+ + + @@ -55,7 +61,7 @@ try { window.onload = function() { document.forms[0].tags.focus(); } - + 0) { foreach($tags as $key => $tag) { - $q = $dbh->prepare("INSERT INTO `clmpr`.`tags` (`tag`, `count`) - VALUES ( ?, 1 ) - ON DUPLICATE KEY + $q = $dbh->prepare("INSERT INTO `clmpr`.`tags` (`tag`, `count`) + VALUES ( ?, 1 ) + ON DUPLICATE KEY UPDATE `count` = `count` + 1"); - $q->execute( array( $tag )); + $q->execute(array($tag)); } } # insert clump - $q = $dbh->prepare("INSERT INTO `clmpr`.`clumps` - ( `user_id`, - `title`, - `url`, - `tags`, - `description`, + $q = $dbh->prepare("INSERT INTO `clmpr`.`clumps` + ( `user_id`, + `title`, + `url`, + `tags`, + `description`, `date` ) VALUES ( ?, ?, ?, ?, ?, NOW() ) "); - $insert = $q->execute( array( - $user['id'], - $params['title'], - $params['url'], - implode(" ", $tags), + $insert = $q->execute( array( + $user['id'], + $params['title'], + $params['url'], + implode(" ", $tags), htmlentities($params['description']))); echo "clumped.

"; @@ -55,7 +55,7 @@ try { echo ''; $dbh = null; - $q = null; + $q = null; } else { include 'signin.php'; diff --git a/signup.php b/signup.php index 4702517..26370bd 100644 --- a/signup.php +++ b/signup.php @@ -50,4 +50,4 @@ echo json_encode(array('success' => true, 'mssg' => $e->getMessage() )); } - exit; \ No newline at end of file + exit; diff --git a/style.css b/style.css index 10f26c8..7f47499 100644 --- a/style.css +++ b/style.css @@ -24,6 +24,11 @@ hr { border-bottom:1px dotted #888; } +.bull { + display:inline-block; + margin-right:0.6em; +} + .header, .header a { color: #888888; @@ -126,6 +131,14 @@ ul.tags li:last-child:after { content:""; } +.tag-help { + font-weight:normal; + font-size:12px; +} +#tag-help { + margin:0.1em 0 0.3em 0.5em; + font-size:12px; +} #tags li { font-size:14px; -- 2.34.1