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/account/list.php | 21 ++++++++++++++++++++ tpl/blog/drafts.php | 41 ++++++++++++++++++++++++++++++++++++++ tpl/blog/index.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ tpl/general/top.php | 9 +++++---- tpl/image/index.php | 23 ++++++++++++--------- tpl/image/upload-ok.php | 11 +++++++++- tpl/image/upload.php | 3 ++- tpl/notes/index.php | 13 ------------ tpl/study/index.php | 4 +++- 9 files changed, 149 insertions(+), 29 deletions(-) create mode 100644 tpl/account/list.php create mode 100644 tpl/blog/drafts.php create mode 100644 tpl/blog/index.php delete mode 100644 tpl/notes/index.php (limited to 'tpl') diff --git a/tpl/account/list.php b/tpl/account/list.php new file mode 100644 index 0000000..398ac99 --- /dev/null +++ b/tpl/account/list.php @@ -0,0 +1,21 @@ +' . filters_html_full() . ''; + +echo ""; +echo ""; +foreach($users as $u) { + echo ''; + echo ''; + if ($u['nbPosts'] > 0) { + echo ''; + } else { + echo ''; + } + echo ''; +} +echo "
UsernameNotebookBlog
' . $u['name'] . '' . $u['nbNotes'] . ' notes' . $u['nbPosts'] . ' postsno posts
"; + +require("tpl/general/bottom.php"); 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"); diff --git a/tpl/general/top.php b/tpl/general/top.php index 2ddc84e..08481fd 100644 --- a/tpl/general/top.php +++ b/tpl/general/top.php @@ -29,16 +29,17 @@ if ($user['id'] == 0) { ?>
- Notebooks + Home + People Uploaded imagesMy studies'; + echo 'My studies'; + echo 'Uploaded images'; } else { + echo 'Studies'; if ($user['priv'] >= $apps['image']['upload']) { echo 'Upload image'; } - echo 'Study decks'; - echo 'Study lists'; } ?>
diff --git a/tpl/image/index.php b/tpl/image/index.php index 0f76abe..4f9db8e 100644 --- a/tpl/image/index.php +++ b/tpl/image/index.php @@ -1,20 +1,24 @@ Images you have uploaded'; - if (count($images) == 0) { echo '
You have uploaded no images yet.
'; } else { -echo ''; + echo '

You have uploaded ' . count($images) .' images.

'; + echo ''; + echo '
PreviewFiles
'; foreach ($images as $img) { $min = $baseurl . $img['id'] . "-min." . $img['extension']; $imgf = $baseurl . $img['id'] . "." . $img['extension']; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; } echo '
PreviewInfoDate
Miniature: ' . $min . '
'; - echo 'Image: ' . $imgf . ''; - if ($can_delete) echo '
Delete this image'; - echo '
' . $img['name'] . '

'; + echo 'Miniature: ' . $min . '
'; + echo 'Image: ' . $imgf . '
'; + echo 'Markdown: !['.$img['name'].']('.$imgf.')
' . $img['upl_date'] . '
'; + if ($can_delete) echo '
delete'; + if ($can_rename) echo '
rename'; + echo '
'; } @@ -25,7 +29,8 @@ if ($can_upload) {

Upload an image

-A px preview will be created.

+A px preview will be created.

+Title :

- Preview :
+

Preview :
Image :
+ Markdown code : ![]()

+

+

+ Back to upload form + = $apps['image']['index']) + echo ' - back to list of uploaded images'; + ?> +

"Image file : ", "type" => "file", "name" => "image") + array("label" => "Image file : ", "type" => "file", "name" => "image"), + array("label" => "Image title (optionnal) : ", "type" => "text", "name" => "name") ); $validate = "Upload"; diff --git a/tpl/notes/index.php b/tpl/notes/index.php deleted file mode 100644 index 6c0eb99..0000000 --- a/tpl/notes/index.php +++ /dev/null @@ -1,13 +0,0 @@ -' . filters_html_full() . '
'; - -echo ""; - -require("tpl/general/bottom.php"); diff --git a/tpl/study/index.php b/tpl/study/index.php index 82178df..287be11 100644 --- a/tpl/study/index.php +++ b/tpl/study/index.php @@ -11,7 +11,7 @@ require("tpl/general/top.php");

The first method is based on decks of cards, keeping track of your progress and everything.

-

Please take a look in the List of decks and start learning whatever you want to learn.

+

Please take a look at the list of decks and start learning whatever you want to learn.

The cards you are studying are classified in the following boxes :