From 24547ccec6526fcef3cccb34bc35fb81f31236b3 Mon Sep 17 00:00:00 2001 From: Nicolas BERNSTEIN Date: Sun, 12 Feb 2012 19:50:55 +0100 Subject: A lot of changes : blogging system essentially. --- tpl/blog/drafts.php | 41 +++++++++++++++++++++++++++++++++++++++++ tpl/blog/index.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 tpl/blog/drafts.php create mode 100644 tpl/blog/index.php (limited to 'tpl/blog') diff --git a/tpl/blog/drafts.php b/tpl/blog/drafts.php new file mode 100644 index 0000000..5440cbc --- /dev/null +++ b/tpl/blog/drafts.php @@ -0,0 +1,41 @@ +'; +echo 'post a message'; + +echo '

My drafts

'; + +if (count($drafts) > 0) { + foreach ($drafts as $post) { + echo '
'; + echo '
'; + echo 'edit'; + echo ' | delete'; + echo ' | publish'; + echo '
'; + echo '

' . $post['title'] . '

'; + echo $post['text_html']; + echo '
'; + } +} else { + echo '

No drafts

'; +} + +echo '

My published posts

'; + +if (count($pub) > 0) { + echo ''; + foreach ($pub as $post) { + echo ''; + echo ''; + } + echo '
TitleActions
' . $post['title'] . 'edit'; + echo ' | delete
'; +} else { + echo '

No published posts

'; +} + + +require("tpl/general/bottom.php"); diff --git a/tpl/blog/index.php b/tpl/blog/index.php new file mode 100644 index 0000000..07e3388 --- /dev/null +++ b/tpl/blog/index.php @@ -0,0 +1,53 @@ +'; + echo 'post a message'; + echo ' | my drafts'; + echo ''; +} + +echo ''; + +foreach ($posts as $post) { + echo '
'; + echo '
Written by ' . $post['owner']; + if ($can_edit && $post['owner_id'] == $user['id']) + echo ' | edit'; + if ($can_delete && $post['owner_id'] == $user['id']) + echo ' | delete'; + echo '
'; + echo '
published ' . $post['date'] . '
'; + if ($post['tags'] != '') { + echo '
tags: ' . $post['tags'] . '
'; + } + echo '

' . $post['title'] . '

'; + echo '
' . $post['text_html'] . '
'; + echo '
'; +} + +echo '
'; + +foreach ($fa as $kname => $kdata) { + echo '

Filter by ' . $kname . '

'; + if (isset($fvalues[$kname])) { + echo '

Filtering ' . $kname . ' : ' . $kdata[$fvalues[$kname]]['name'] . '.
'; + $n = array(); + foreach ($fvalues as $k => $v) { + if ($k != $kname) $n[] = "$k-$v"; + } + echo 'remove filtering

'; + } else { + echo ''; + } +} + +require("tpl/general/bottom.php"); -- cgit v1.2.3