]> git.quilime.com - clmpr.git/commitdiff
added private urls
authorGabriel Dunne <gdunne@quilime.com>
Fri, 30 Dec 2011 04:56:55 +0000 (20:56 -0800)
committerGabriel Dunne <gdunne@quilime.com>
Fri, 30 Dec 2011 04:56:55 +0000 (20:56 -0800)
about.html
get.php
new.php
put.php
style.css

index 4d84ca1308827a857cc99043c1085e15bba4db7b..bb57f7b72afa92741b5297f6854e615c83530d44 100644 (file)
@@ -5,6 +5,11 @@
        <br /><br />
 </p>
 
+<p>
+use clmpr (<b>/klum-per/</b>) to save urls
+<br /><br />
+<p>
+
 <strong>to use: </strong> <br />
 <?php
     $js = file_get_contents('bookmarklet.js');
diff --git a/get.php b/get.php
index 59146f66a13cbea8b5ccb7d82cbe29639db6fea9..6657b07d0630b9b85ef51e66e53b85897b7c5685 100644 (file)
--- a/get.php
+++ b/get.php
@@ -16,11 +16,11 @@ $dbh->beginTransaction();
 $q = null;
 $tag = null;
 
+
 try {
     if ($params['user']) {
         $user = get_users($dbh, array('user' => $params['user'] ));
         if ($user) {
-
             $q = $dbh->prepare("SELECT *, clumps.id as clump_id
                                 FROM clumps
                                 JOIN users
@@ -117,6 +117,14 @@ function deleteClump( id, elem ) {
 <ul class="links">
 <?php if ($q) : for($i = 0; $row = $q->fetch(); $i++ ):
 
+    # skip private bookmarks of other users
+    if ($user['user'] != $row['user'] && $row['private']) {
+        continue;
+    }
+
+    # is private
+    $private = $user['user'] == $row['user'] && $row['private'];
+
     # process description
     $hasDescription = $row['description'] || false;
 
@@ -127,7 +135,7 @@ function deleteClump( id, elem ) {
 
     <li>
 
-        <span class="url">
+        <span class="url <?php echo $private ? 'private' : '';?>">
             <a href="<?php echo $row['url'] ?>">
                 <?php echo $row['title'] ? $row['title'] : "&lt;title&gt;" ?>
             </a>
diff --git a/new.php b/new.php
index 6bc42db00170f64f1a307686f3393181909444db..91262ff5218394dcb194786d026161a551dc25cc 100644 (file)
--- a/new.php
+++ b/new.php
@@ -48,6 +48,10 @@ try {
 
                <br />
 
+            <input type="checkbox" name="private" tabindex="5"> private
+
+            <br />
+
             <p>
                <input type="submit" tabindex="5" value="save">
                <a href="javascript:window.close();">cancel</a>
diff --git a/put.php b/put.php
index 3c6340ed7885e905fe6382ecdea36fb6807a8edb..2cad1eb780362e560469c737cd320e57cb295b66 100644 (file)
--- a/put.php
+++ b/put.php
@@ -7,6 +7,10 @@ $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['private'] = isset($_POST['private']) ? true : false;
+
+//print_r($_POST);
+//exit;
 
 include 'head.html';
 
@@ -32,11 +36,11 @@ try {
         # insert clump
         $q = $dbh->prepare("INSERT INTO `clumps`
                           ( `user_id`, `title`, `url`,
-                            `tags`, `description`, `date` )
-                            VALUES ( ?, ?, ?, ?, ?, NOW() ) ");
+                            `tags`, `description`, `date`, `private` )
+                            VALUES ( ?, ?, ?, ?, ?, NOW(), ? ) ");
         $insert = $q->execute( array(
                     $user['id'], $params['title'], $params['url'],
-                    $params['tags'], $params['description']));
+                    $params['tags'], $params['description'], $params['private']));
 
         echo "clumped.<br/><br/>";
         echo '<a href="javascript:window.close();">ok</a>';
index bde5b2808df673470e766cb6167c705497fcab02..64d666c53e75c9c08f1aa5545ba22b17a10c5750 100644 (file)
--- a/style.css
+++ b/style.css
@@ -6,9 +6,10 @@ body {
 }
 a {
 }
-a:hover {
+a:hover, .private a:hover {
     color: #00e !important;
     text-decoration:none;
+    border-color:#00e;
 }
 a.mute {
     color:#444;
@@ -60,7 +61,9 @@ ul.links li {
     margin-bottom:2em;
 }
 ul.links li span.url a {
+    font-weight:bold;
     display:inline-block;
+    margin-bottom:4px;
 }
 ul.links li span.url a {
     color:#000;
@@ -87,6 +90,10 @@ ul.links li .tags:hover a:hover {
     color:#00e !important;
     text-decoration:underline;
 }
+.private a {
+    background:#eee !important;
+    color:#aaa !important;
+}
 
 .meta {
     color:#bbb;