SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--- Database: `clmpr`
+-- Database Name: `clmpr`
-
--- Table structure for table `clumps`
-
-CREATE TABLE IF NOT EXISTS `clumps` (
+CREATE TABLE `clumps` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`user_id` int(9) NOT NULL,
`title` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL DEFAULT '',
+ `description` text NOT NULL,
`tags` text NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
+CREATE TABLE `tags` (
+ `id` int(9) NOT NULL AUTO_INCREMENT,
+ `tag` varchar(255) NOT NULL,
+ `count` int(9) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `tag` (`tag`)
+) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
--- Table structure for table `users`
-
-CREATE TABLE IF NOT EXISTS `users` (
+CREATE TABLE `users` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`user` varchar(255) NOT NULL,
`pass` varchar(255) NOT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user` (`user`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
+) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
<li>
<?php if ($hasDescription) : ?>
- <a href="#" onClick="$(this.parentNode).toggleClass('expand');" title="expand">+</a>
+ <a href="#" class="more" onClick="$(this.parentNode).addClass('expand');">+</a>
+ <a href="#" class="less" onClick="$(this.parentNode).removeClass('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>
</span>
-
- <ul class="tags">
- <?php foreach($row['tags'] as $tag) : ?>
- <li><a href="/tags.php?tag=<?=$tag?>"><?=$tag?></a></li>
- <? endforeach; ?>
- </ul>
+
+ <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>
<?php
if ($user = get_user()):
<?php
endif;
endif;
- ?>
+ ?>
- <?php if ($hasDescription) : ?>
- <p class="desc">
- <?php echo $row['description']; ?>
- </p>
- <?php endif; ?>
+ <div class="expand">
+
+ <?php if ($hasDescription) : ?>
+ <p class="desc">
+ <?php echo $row['description']; ?>
+ </p>
+ <?php endif; ?>
+
+ <ul class="tags">
+ <?php foreach($row['tags'] as $tag) : ?>
+ <li><a href="/tags.php?tag=<?=$tag?>"><?=$tag?></a></li>
+ <? endforeach; ?>
+ </ul>
+
+ </div>
</li>
color:#999;
}
ul.links li p.desc {
- margin:1em 0 1em 2em;
+ margin:0;
+ /*display:none;*/
+}
+ul.links li .expand {
display:none;
+ margin:0 0 1em 1em;
}
-ul.links li.expand p.desc {
+ul.links li.expand .expand {
display:block;
}
+ul.links li.expand p.desc {
+ /*display:block;*/
+}
+ul.links li .less {
+ display:none;
+}
+ul.links li .more {
+ display:inline;
+}
+ul.links li.expand .more {
+ display:none;
+}
+ul.links li.expand .less {
+ display:inline;
+}
.delete {
font-weight:bold;