diff options
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/account/list.php | 21 | ||||
-rw-r--r-- | tpl/blog/drafts.php | 41 | ||||
-rw-r--r-- | tpl/blog/index.php | 53 | ||||
-rw-r--r-- | tpl/general/top.php | 9 | ||||
-rw-r--r-- | tpl/image/index.php | 23 | ||||
-rw-r--r-- | tpl/image/upload-ok.php | 11 | ||||
-rw-r--r-- | tpl/image/upload.php | 3 | ||||
-rw-r--r-- | tpl/notes/index.php | 13 | ||||
-rw-r--r-- | tpl/study/index.php | 4 |
9 files changed, 149 insertions, 29 deletions
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 @@ +<?php +$title = "People"; +require("tpl/general/top.php"); + +echo '<div class="ordering_links">' . filters_html_full() . '</div>'; + +echo "<table>"; +echo "<tr><th>Username</th><th>Notebook</th><th>Blog</th></tr>"; +foreach($users as $u) { + echo '<tr><td>' . $u['name'] . '</td>'; + echo '<td><a href="user-notes-' . $u['id'] . '">' . $u['nbNotes'] . ' notes</a></td>'; + if ($u['nbPosts'] > 0) { + echo '<td><a href="index-blog-author-'.$u['id'].'">' . $u['nbPosts'] . ' posts</a></td>'; + } else { + echo '<td>no posts</td>'; + } + echo '</tr>'; +} +echo "</table>"; + +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 @@ +<?php + +require("tpl/general/top.php"); + +echo '<div class="small_right">'; +echo '<a href="post-blog">post a message</a></div>'; + +echo '<h2>My drafts</h2>'; + +if (count($drafts) > 0) { + foreach ($drafts as $post) { + echo '<div class="blog_post">'; + echo '<div class="small_right">'; + echo '<a href="edit-blog-' . $post['id'] . '">edit</a>'; + echo ' | <a href="delete-blog-' . $post['id'] . '">delete</a>'; + echo ' | <a href="publish-blog-' . $post['id'] . '">publish</a>'; + echo '</div>'; + echo '<h2>' . $post['title'] . '</h2>'; + echo $post['text_html']; + echo '</div>'; + } +} else { + echo '<p>No drafts</p>'; +} + +echo '<h2>My published posts</h2>'; + +if (count($pub) > 0) { + echo '<table><tr><th>Title</th><th>Actions</th></tr>'; + foreach ($pub as $post) { + echo '<tr><td>' . $post['title'] . '</td>'; + echo '<td><a href="edit-blog-' . $post['id'] . '">edit</a>'; + echo ' | <a href="delete-blog-' . $post['id'] . '">delete</a></td></tr>'; + } + echo '</table>'; +} else { + echo '<p>No published posts</p>'; +} + + +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 @@ +<?php +require("tpl/general/top.php"); + +if ($can_post) { + echo '<div class="small_right">'; + echo '<a href="post-blog">post a message</a>'; + echo ' | <a href="drafts-blog">my drafts</a>'; + echo '</div>'; +} + +echo '<div class="ordering_links">' . filters_html_full() . '</div>'; + +foreach ($posts as $post) { + echo '<div class="blog_post">'; + echo '<div class="small_right">Written by ' . $post['owner']; + if ($can_edit && $post['owner_id'] == $user['id']) + echo ' | <a href="edit-blog-' . $post['id'] . '">edit</a>'; + if ($can_delete && $post['owner_id'] == $user['id']) + echo ' | <a href="delete-blog-' . $post['id'] . '">delete</a>'; + echo '</div>'; + echo '<div class="small_right">published ' . $post['date'] . '</div>'; + if ($post['tags'] != '') { + echo '<div class="small_right">tags: ' . $post['tags'] . '</div>'; + } + echo '<h2>' . $post['title'] . '</h2>'; + echo '<div class="inside">' . $post['text_html'] . '</div>'; + echo '</div>'; +} + +echo '</div><div class="contents-left">'; + +foreach ($fa as $kname => $kdata) { + echo '<h1>Filter by ' . $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>'; + } +} + +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) { ?> </div> <div class="left"> - <a href="notes">Notebooks</a> + <a href="blog">Home</a> + <a href="list-account">People</a> <?php if ($user['id'] != 0) { - echo '<a href="image">Uploaded images</a><a href="study">My studies</a>'; + echo '<a href="study">My studies</a>'; + echo '<a href="image">Uploaded images</a>'; } else { + echo '<a href="study">Studies</a>'; if ($user['priv'] >= $apps['image']['upload']) { echo '<a href="upload-image">Upload image</a>'; } - echo '<a href="deck">Study decks</a>'; - echo '<a href="list">Study lists</a>'; } ?> </div> 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 @@ <?php require("tpl/general/top.php"); -echo '<h2>Images you have uploaded</h2>'; - if (count($images) == 0) { echo '<div class="message">You have uploaded no images yet.</div>'; } else { -echo '<table><tr><th width="' . ($miniature_width) . 'px">Preview</th><th>Files</th></tr>'; + echo '<p>You have uploaded ' . count($images) .' images.</p>'; + echo '<div class="ordering_links">' . filters_html_full() . '</div>'; + echo '<table><tr><th width="' . ($miniature_width) . 'px">Preview</th><th>Info</th><th>Date</th></tr>'; foreach ($images as $img) { $min = $baseurl . $img['id'] . "-min." . $img['extension']; $imgf = $baseurl . $img['id'] . "." . $img['extension']; - echo '<tr><td><img src="' . $min . '" /></td>'; - echo '<td><strong>Miniature:</strong> <a href="' . $min . '">' . $min . '</a><br />'; - echo '<strong>Image:</strong> <a href="' . $imgf . '">' . $imgf . '</a>'; - if ($can_delete) echo '<br /><a href="delete-image-' . $img['id'] . '">Delete this image</a>'; - echo '</td>'; + echo '<tr><td><a href="' . $imgf . '"><img src="' . $min . '" /></a></td>'; + echo '<td><strong>' . $img['name'] . '</strong><br /><br />'; + echo '<strong>Miniature:</strong> <a href="' . $min . '">' . $min . '</a><br />'; + echo '<strong>Image:</strong> <a href="' . $imgf . '">' . $imgf . '</a><br />'; + echo '<strong>Markdown:</strong> <code>!['.$img['name'].']('.$imgf.')</code></td>'; + echo '<td>' . $img['upl_date'] . '<br />'; + if ($can_delete) echo '<br /><a href="delete-image-' . $img['id'] . '">delete</a>'; + if ($can_rename) echo '<br /><a href="rename-image-' . $img['id'] . '">rename</a>'; + echo '</td></tr>'; } echo '</table>'; } @@ -25,7 +29,8 @@ if ($can_upload) { <div class="contents-left"> <h1>Upload an image</h1> <form method="POST" action="index.php?p=upload-image" enctype="multipart/form-data"> -<strong>A <?php echo $miniature_width; ?>px preview will be created.</strong><br /><br /> +A <?php echo $miniature_width; ?>px preview will be created.<br /><br /> +Title : <input type="text" name="name" style="width: 200px;" ><br /> <input type="file" name="image" /><br /> <input type="submit" value="Upload" /></form> <?php diff --git a/tpl/image/upload-ok.php b/tpl/image/upload-ok.php index 1cd588c..6242d93 100644 --- a/tpl/image/upload-ok.php +++ b/tpl/image/upload-ok.php @@ -5,8 +5,17 @@ $minurl = $baseurl . $id . "-min." . $type; $imgurl = $baseurl . $id . "." . $type; ?> - Preview : <a href="<?php echo $minurl; ?>"><?php echo $minurl; ?></a><br /> + <p>Preview : <a href="<?php echo $minurl; ?>"><?php echo $minurl; ?></a><br /> Image : <a href="<?php echo $imgurl; ?>"><?php echo $imgurl; ?></a><br /> + Markdown code : <code>![<?php echo $name; ?>](<?php echo $imgurl; ?>)</code></p> + <p> + <p> + <a href="upload-image">Back to upload form</a> + <?php + if ($user['priv'] >= $apps['image']['index']) + echo ' - <a href="index-image">back to list of uploaded images</a>'; + ?> + </p> <?php require("tpl/general/bottom.php"); diff --git a/tpl/image/upload.php b/tpl/image/upload.php index 6e9ee55..71283cf 100644 --- a/tpl/image/upload.php +++ b/tpl/image/upload.php @@ -6,7 +6,8 @@ if ($user['id'] == 0) $message = "You should create an account so that you can t $form_message = "A $miniature_width"."px preview will be created."; $need_file = true; $fields = array( - array("label" => "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 @@ -<?php -$title = "User's notebooks"; -require("tpl/general/top.php"); - -echo '<div class="ordering_links">' . filters_html_full() . '</div>'; - -echo "<ul>"; -foreach($users as $u) { - echo '<li><a href="user-notes-' . $u['id'] . '">' . $u['name'] . '</a> (' . $u['nbNotes'] . ' notes)</li>'; -} -echo "</ul>"; - -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"); <p>The first method is based on decks of cards, keeping track of your progress and everything.</p> -<p>Please take a look in the <a href="deck">List of decks</a> and start learning whatever you want to learn.</p> +<p>Please take a look at the <a href="deck">list of decks</a> and start learning whatever you want to learn.</p> <p>The cards you are studying are classified in the following <em>boxes</em> :</p> <ul> @@ -34,6 +34,8 @@ Cards you are supposed to study or review today appear with a bold title : that for a given list). You will study one batch at a time, and take a test for one batch at a time. All your test results are kept in storage and are used to display your progress.</p> +<p>Please take a look at the <a href="list">list of lists</a> and start learning whatever you want to learn.</p> + <?php require ("lib_sidebar.php"); |