d = w.open(
'http://clmpr/new.php?'
+ 'url=' + c(b.location)
- + '&title=' + c(b.title)
+ + '&title=' + c(b.title || b.location)
, 'clmpr_popup'
, 'left=' + (( w.screenX || w.screenLeft ) + 10)
+ ',top=' + (( w.screenY || w.screenTop) + 10 )
<ul class="links">
<?php for($i = 0; $row = $q->fetch(); $i++ ):
+ # process description
+ $hasDescription = $row['description'] || false;
# process tags
if ($row['tags'] == '')
else
$row['tags'] = explode(" ", $row['tags']);
-
?>
<li>
+
+ <?php if ($hasDescription) : ?>
+ <a href="#" onClick="$(this.parentNode).toggleClass('expand');" title="expand">+</a>
+ <?php else : ?>
+
+ <?php endif; ?>
+
<span class="meta">
<?php echo date("Y-m-d", strtotime($row['date'])) ?> by
<a class="uname" href="/?user=<?php echo $row['user'] ?>"><?php echo $row['user'] ?></a>
</span>
<span class="url">
- <a href="<?php echo $row['url'] ?>">
- <?php echo $row['title'] ? $row['title'] : "<title>" ?>
- </a>
+ <a href="<?php echo $row['url'] ?>">
+ <?php echo $row['title'] ? $row['title'] : "<title>" ?>
+ </a>
</span>
-
-
+
<ul class="tags">
-
- <?php foreach($row['tags'] as $tag) : ?>
- <li><a href="/tags.php?tag=<?=$tag?>"><?=$tag?></a></li>
- <? endforeach; ?>
+ <?php foreach($row['tags'] as $tag) : ?>
+ <li><a href="/tags.php?tag=<?=$tag?>"><?=$tag?></a></li>
+ <? endforeach; ?>
</ul>
- <?php if ($user = get_user()):
- if ($user['user'] == $row['user']): ?>
+ <?php
+ if ($user = get_user()):
+ if ($user['user'] == $row['user']): ?>
<!--
<a href="" class="edit">✏</a> -->
<a href="#" title="Delete" onClick="return deleteClump(<?php echo $row['clump_id']; ?>, this.parentNode);" class="delete">×</a>
- <?php endif;
- endif; ?>
+ <?php
+ endif;
+ endif;
+ ?>
+
+ <?php if ($hasDescription) : ?>
+ <p class="desc">
+ <?php echo $row['description']; ?>
+ </p>
+ <?php endif; ?>
</li>
?>
<p>
- clmpr is citation, logging and multi-purpose archive. it saves web links.
+ clmpr saves internet links
<ul class="tags">
tags:
<form method="POST" action="put.php" class="new">
+ <p>
<label>title</label>
<input type="text" name="title" value="<?=htmlentities($params['title'])?>">
+ </p>
- <br /><br />
-
+ <p>
<label>url</label>
<input type="text" name="url" value="<?=$params['url']?>">
-
- <br /><br />
-
+ </p>
+
+ <p>
<label>tags (space delimited)</label>
<input type="text" name="tags" value="">
+ </p>
- <br /><br /><br />
+ <p>
+ <label>description</label>
+ <input type="text" name="description" value="">
+ </p>
+
+ <br />
+ <p>
<input type="submit" value="save">
<a href="javascript:window.close();">cancel</a>
+ </p>
<br />
<br />
</form>
- <!-- <hr /> -->
-
<?php // include 'footer.html'; ?>
<script>
-
window.onload = function() {
document.forms[0].tags.focus();
}
-
- </script>
-
-
+ </script>
<?php
$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;
include 'head.html';
$dbh->beginTransaction();
# insert clump
- $sql = "INSERT INTO `clmpr`.`clumps` ( `user_id`, `title` , `url` , `tags`, `date` )
- VALUES ( ?, ?, ?, ?, NOW() ) ";
+ $sql = "INSERT INTO `clmpr`.`clumps` ( `user_id`, `title` , `url` , `tags`, `description`, `date` )
+ VALUES ( ?, ?, ?, ?, ?, NOW() ) ";
$q = $dbh->prepare($sql);
- $insert = $q->execute( array( $user['id'], $params['title'], $params['url'], $params['tags'] ));
+ $insert = $q->execute( array( $user['id'], $params['title'], $params['url'], $params['tags'], $params['description'] ));
# process tags
$tags = explode(" ", $params['tags']);
$dbh = null;
echo "clumped.<br/><br/>";
- //echo '<a href="javascript:window.close();">ok</a>';
+ echo '<a href="javascript:window.close();">ok</a>';
echo '<script>window.close();</script>';
- include 'foot.html';
} else {
font-size: 12px;
line-height: 1.3em;
}
-
a {
text-decoration:none;
}
-
a:hover {
color: #000099;
text-decoration: underline;
}
-
ul {
padding: 0pt;
}
-
li {
list-style-type: none;
}
-
+label {
+ font-weight:bold;
+}
hr {
border:0;
border-bottom:1px dotted #888;
}
+
.header, .header a {
color: #888888;
}
-
.header b {
color: #000000;
}
+
#signin {
position:absolute;
top:0;
ul.links li span.meta a {
color:#999;
}
+ul.links li p.desc {
+ margin:1em 0 1em 2em;
+ display:none;
+}
+ul.links li.expand p.desc {
+ display:block;
+}
+
.delete {
font-weight:bold;
padding:0 3px;
form.new input[type="text"] {
width:100%;
}
-label {
- font-weight:bold;
-}
+
+
ul.tags, ul.tags li {
display:inline;
}
ul.tags li {
- background:#f8f8f8;
+ background:#eee;
padding:0 4px;
margin:0 1px;
}