summaryrefslogtreecommitdiff
path: root/tpl/blog/index.php
blob: b70a80ad4c0f69922ca7839422702c9db48231fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
require("tpl/general/top.php");

if ($can_post) {
	echo '<div class="small_right">';
	echo '<a href="post-blog">écrire un article</a>';
	echo ' | <a href="drafts-blog">brouillons</a>';
	echo '</div>';
}

echo '<div class="ordering_links">' . filters_html_full() . '</div>';


if(count($posts) == 0) {
    echo "<div class=\"message\">Aucun article trouvé.</div>";
} else {
    echo '<table><tr><th style="width: 70%"></th><th>Tags</th><th>Date</th><th>Auteur</th></tr>';
    foreach ($posts as $post) {
        echo '<tr><td><a href="view-blog-'.$post['id'].'">' . $post['title'] . '</a> <div class="small_right">';
        $k = array();
        if ($can_edit && $post['owner_id'] == $user['id'])
            $k[] = '<a href="edit-blog-' . $post['id'] . '">modifier</a>';
        if ($can_delete && $post['owner_id'] == $user['id'])
            $k[] = '<a href="delete-blog-' . $post['id'] . '">supprimer</a>';
        echo implode(' | ', $k);
        echo '</div>';
        echo '<td style="text-align: center"><span class="tool_link">' . $post['tags'] . '</span></td>';
        echo '<td style="text-align: center">' . $post['date'] . '</td>';
        echo '<td style="text-align: center">' . $post['owner'] . '</td>';
        echo '</tr>';
    }

    echo '</table>';
}

echo '</div><div class="contents-left">';

foreach ($fa as $kname => $kdata) {
    if ($kname == "author") continue;
	echo '<h1>Filtrer par ' . $kname . '</h1>';
	if (isset($fvalues[$kname])) {
		echo '<p>Filtering ' . $kname . ' : ' . $kdata[$fvalues[$kname]]['name'] . '.<br />';
		$n = array();
		foreach ($fvalues as $k => $v) {
			if ($k != $kname) $n[] = "$k-$v";
		}
		echo '<a href="index-blog-' . implode('-', $n) . '">remove filtering</a></p>';
	} else {
		echo '<ul>';
		foreach ($kdata as $vid => $vdata) {
			$n = array();
			foreach ($fvalues as $k => $v) $n[] = "$k-$v";
			$n[] = "$kname-$vid";
			echo '<li><a href="index-blog-' . implode('-', $n) . '">' . $vdata['name'] . ' (' . $vdata['count'] . ')</a></li>';
		}
		echo '</ul>';
	}
}

echo "<h1>...</h1>";
$ze = array();
foreach ($fvalues as $k => $v) { $ze[] = "$k-$v"; }
$ze[] = "feed-atom";
$zd = implode("-", $ze);
echo '<ul>';
if (count($fvalues) > 0) {
	echo '<li><a href="index.php?p=index-blog-' . $zd . '">Atom feed for this selection</a></li>';
	echo '<li><a href="index.php?p=index-blog-feed-atom">Homepage Atom feed</a></li>';
} else {
	echo '<li><a href="index.php?p=index-blog-feed-atom">Flux Atom</a></li>';
}
echo '</ul>';

require("tpl/general/bottom.php");