From: Gabriel Dunne Date: Sun, 19 Feb 2012 01:30:06 +0000 (-0800) Subject: made private[] editable X-Git-Url: https://git.quilime.com/?a=commitdiff_plain;h=54205092edee7a9472d4e62967d451fe82f2744d;p=clmpr.git made private[] editable --- diff --git a/edit.php b/edit.php index ff07ae4..c63a40e 100644 --- a/edit.php +++ b/edit.php @@ -81,6 +81,11 @@ function deleteClump( id ) {
+ + tabindex="5"> private + +

+

diff --git a/style.css b/style.css index 639d784..d7af6af 100644 --- a/style.css +++ b/style.css @@ -83,7 +83,7 @@ ul.links li .expand { } ul.links li .desc { display:inline-block; - margin:5px 0; + margin:2px 0 5px 0; } ul.links li .tags { } diff --git a/update.php b/update.php index 47c6feb..a3e6423 100644 --- a/update.php +++ b/update.php @@ -3,14 +3,14 @@ include 'init.php'; $params = array(); -$params['id'] = isset($_POST['id']) ? $_POST['id'] : null; + +$params['id'] = isset($_POST['id']) ? $_POST['id'] : null; $params['title'] = isset($_POST['title']) ? $_POST['title'] : null; -$params['url'] = isset($_POST['url']) ? $_POST['url'] : null; -$params['tags'] = isset($_POST['tags']) ? $_POST['tags'] : null; -$params['description'] = isset($_POST['description']) ? $_POST['description'] : null; +$params['url'] = isset($_POST['url']) ? $_POST['url'] : null; +$params['private'] = isset($_POST['private']) && $_POST['private'] == 'on' ? 1 : 0; +$params['tags'] = isset($_POST['tags']) ? $_POST['tags'] : null; +$params['description'] = isset($_POST['description']) ? $_POST['description'] : null; -//print_r($_POST); -//exit; try { @@ -63,10 +63,10 @@ try { # update clump $sql = "UPDATE `clumps` - SET `url` = ?, `tags` = ?, `title` = ?, `description` = ? + SET `url` = ?, `tags` = ?, `title` = ?, `description` = ?, `private` = ? WHERE `id` = ?"; $q = $dbh->prepare($sql); - $insert = $q->execute( array( $params['url'], $params['tags'], $params['title'], $params['description'], $params['id'])); + $insert = $q->execute( array( $params['url'], $params['tags'], $params['title'], $params['description'], $params['private'], $params['id'])); header('Location: /get.php?id=' . $params['id']); //echo "clumped.

";