padding-bottom:3em;
height:350px;
}
+.entries.projects.featured li {
+ height:200px;
+}
.entries.projects ul.tags li {
height:1.5em;
margin:0;
if ($m->is_multiple()) {
$v->assign('pagination', $m->pagination);
$v->assign('entries', $m->entries);
- // $v->assign('entry', $m->entry);
+ $v->assign('entry', $m->entry);
}
if ($m->is_single() || $m->is_page()) {
file_ignores[] = .DS_Store
; dev
-dev = 0
+dev = 1
edit = 0
}
$entries = array();
-
-
if (isset($dir_iterator)) {
foreach ($dir_iterator as $file => $info) {
// skip dot files
if (substr($info->getFilename(), 0, 1) == '.')
continue;
- // parse only specific files
+ // parse only config files
if ($info->isFile() && $info->getFilename() == CONTENT_CONFIG_FILE) {
- $entry = parse_entry($info);
- if ($show_featured && empty($tag)) {
- if (isset($entry->featured)) {
- $entries[] = $entry;
- }
- }
- else if (empty($tag)) {
- $entries[] = $entry;
- }
- else if ($tag && in_array($tag, isset($entry->tags) && is_array($entry->tags) ? $entry->tags : array())) {
- $entries[] = $entry;
- }
+ $entries[] = parse_entry($info);
}
}
}
-
$entries = sort_entries($entries, $order_by, $order);
if ($create_datafile) {
}
}
- $json = json_decode(file_get_contents( $data_file ));
- return $json->entries;
+ $data = json_decode(file_get_contents( $data_file ));
+
+ // parse JSON with tags and such
+ if ($show_featured) {
+ foreach ($data->entries as $i => $entry) {
+ if (!$entry->featured) {
+ unset($data->entries[$i]);
+ }
+ }
+ }
+ if (isset($tag)) {
+ foreach ($data->entries as $i => $entry) {
+ if (
+ !is_array($entry->tags) ||
+ !in_array($tag, $entry->tags)
+ ) {
+ unset($data->entries[$i]);
+ }
+ }
+ }
+
+ return $data->entries;
}
$this->entry = $this->config;
$this->page_title = preg_replace('{^/|/$}', '', $this->request['path']);
- $entries_args = array('tag' => $this->tag);
- if (isset($this->config->config->show_featured)) {
+ $entries_args = array();
+ if ($this->tag) {
+ $entries_args = array('tag' => $this->tag);
+ }
+ if (isset($this->config->config->show_featured) && !$this->tag) {
$entries_args['show_featured'] = true;
}
$this->entries = get_entries( $request['path'], $entries_args);
<? for($i = 0; $i < sizeof($entry->tags); $i++) : $tag = $entry->tags[$i]; ?>
<li class="tag"><a href="<?=WEB_ROOT.'tag/'.$tag?>"><?=$tag?></a></li>
<? endfor; ?>
- </ul>
+ </ul>
</li>
<? endforeach; ?>
</ul>
<? $this->include_template('nav.html.tpl', array('index' => true)) ?>
<div id="content">
- <ul class="entries projects <?=isset($tag)?'tagged':''; ?>">
+ <ul class="entries projects <?=isset($tag)&&$tag!==""?'tagged':''; ?> <? if ($entry->config->show_featured && !isset($tag)): ?>featured<? endif;?>">
<? foreach($entries as $entry): ?>
<li class="<?=$entry->cat->name?>">
<a href="<?=$entry->url;?>">
<br />
<strong><?=$entry->title;?></strong>
</a>
- <? if (isset($tag)) : ?>
- <br />—<br />
- <ul class="tags">
- <? for($i = 0; $i < sizeof($entry->tags); $i++) : $tag = $entry->tags[$i]; ?>
- <li class="tag"><a href="<?=WEB_ROOT.'tag/'.$tag?>"><?=$tag?></a></li>
- <? endfor; ?>
- </ul>
- <? endif; ?>
+ <? if (!isset($entry->config->show_featured) && isset($tag)): ?>
+ <br />
+ —
+ <br />
+ <ul class="tags">
+ <? for($i = 0; $i < sizeof($entry->tags); $i++) : $tag = $entry->tags[$i]; ?>
+ <li class="tag"><a href="<?=WEB_ROOT.'tag/'.$tag?>"><?=$tag?></a></li>
+ <? endfor; ?>
+ </ul>
+ <? endif ;?>
</li>
<? endforeach; ?>
</ul>