<p>
<label>title</label>
- <input type="text" name="title" value="<?=htmlentities($params['title'])?>">
+ <input type="text" name="title" tabindex="1" value="<?=htmlentities($params['title'])?>">
</p>
<p>
<label>url</label>
- <input type="text" name="url" value="<?=$params['url']?>">
- </p>
-
- <p>
- <label>tags <span style="font-weight:normal">(space " " or comma "," delimited)</span></label>
- <input type="text" name="tags" value="">
+ <input type="text" name="url" tabindex="2" value="<?=$params['url']?>">
</p>
+ <label>tags <a href="#" class="tag-help" onClick="$('#tag-help').toggle();return false;">how to tag »</a></label>
+ <ul id="tag-help" style="display:none">
+ <li><span class="bull">•</span>tag characters: [a-z 0-9 + # - .]</li>
+ <li><span class="bull">•</span>combine multiple words into single-words with dashes</li>
+ <li><span class="bull">•</span>delimit tags by space, semicolon, or comma</li>
+ </ul>
+ <input type="text" name="tags" tabindex="3" value="">
+
<p>
<label>description</label>
- <input type="text" name="description" value="">
- </p>
+ <input type="text" name="description" tabindex="4" value="">
+ </p>
<br />
<p>
- <input type="submit" value="save">
+ <input type="submit" tabindex="5" value="save">
<a href="javascript:window.close();">cancel</a>
</p>
<br />
<br />
+
+
+
</form>
<?php // include 'footer.html'; ?>
window.onload = function() {
document.forms[0].tags.focus();
}
- </script>
+ </script>
<?php
#insert tags
if (count($tags) > 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.<br/><br/>";
echo '<script>window.close();</script>';
$dbh = null;
- $q = null;
+ $q = null;
} else {
include 'signin.php';