diff options
-rw-r--r-- | design/style.css | 149 | ||||
-rw-r--r-- | lib/blog/edit.php | 3 | ||||
-rw-r--r-- | lib/blog/index.php | 5 | ||||
-rw-r--r-- | tpl/blog/index.php | 37 |
4 files changed, 50 insertions, 144 deletions
diff --git a/design/style.css b/design/style.css index 0743fc2..94008f2 100644 --- a/design/style.css +++ b/design/style.css @@ -2,7 +2,7 @@ /* STUFF FOR MOBILE VERSION - MUST BE OVERWRITTEN IN SECTON FOR LARGE SCREENS */ body { - background: #FBFBFB; + background: #FFFFFF; padding: 0px; margin: 0px; width: 400px; @@ -13,8 +13,8 @@ body { .menu { padding: 4px; margin-bottom: 8px; - background: #F5F5F5; - border-bottom: 1px solid #F0F0F0; + border-bottom: 1px solid black; + background: white; } .contents-left, .contents-right { @@ -60,7 +60,7 @@ body { left: 0px; bottom: 0px; width: 270px; - border-right: 1px solid #ddd; + border-right: 1px solid black; overflow: auto; padding: 16px; } @@ -83,11 +83,8 @@ body { } form { - padding-left: 8px; - padding-bottom: 8px; - border: 1px solid #DDD; - border-top: 0px; - border-right: 0px; + padding: 16px; + border: 1px solid black; margin-top: 16px; } @@ -106,7 +103,7 @@ body { } iframe, textarea { - border: 1px solid #CCC; + border: 1px solid black; width: 98%; height: 300px; } @@ -114,6 +111,12 @@ body { textarea { margin: 8px; } + + input, button { + border:1px solid black; + background: white; + } + } /* GENERAL STUFF */ @@ -121,7 +124,7 @@ body { a { - color: #007; + color: #00F; text-decoration: none; } @@ -150,18 +153,16 @@ iframe, textarea { margin-top: 8px; margin-bottom: 8px; padding: 8px; - border: 1px solid #FBB; - color: #A22; - background-color: #FFE0FF; + border: 1px solid red; + color: red; } .message { margin-top: 8px; margin-bottom: 8px; padding: 8px; - border: 1px solid #CFC; - background-color: #E7FFE7; - color: #060; + border: 1px solid green; + color: green; } .tree_branch { @@ -208,17 +209,17 @@ table { } td, th { - border: 1px solid #E0E0E0; + border: 1px solid black; } td { - background-color: #F7F7F7; padding: 6px; vertical-align: top; } th { - background-color: #E7E7E7; + background-color: black; + color: white; padding: 2px; text-align: center; } @@ -240,7 +241,7 @@ abbr { hr { border: 0px; - border-bottom: 1px dashed #AAA; + border-bottom: 1px solid AAA; } li .info { @@ -254,115 +255,13 @@ li p { margin-bottom: 4px; } - -/* CARDS */ - -.study_card { - margin: 16px; - border-left: 1px solid #ccc; - border-bottom: 1px solid #ccc; - padding: 8px; - background: #F7F7F7; -} - -.study_card code { - margin-left: 16px; - margin-bottom: 8px; - display: block; -} - -.scb1 { - border-left: 1px solid #DD00DD; - border-bottom: 1px solid #DD00DD; -} - -.scb2 { - border-left: 1px solid #FF7777; - border-bottom: 1px solid #FF7777; -} - -.scb3 { - border-left: 1px solid #FFAA00; - border-bottom: 1px solid #FFAA00; -} - -.scb4, .scb5, .scb6 { - border-left: 1px solid #00CC00; - border-bottom: 1px solid #00CC00; -} - -.scb7 { - border-left: 1px solid #0000FF; - border-bottom: 1px solid #0000FF; -} - -/* Study lists */ - -.study_note_td { - font-size: 0.8em; - background: white; - text-align: right; - padding: 2px; - padding-right: 16px; - padding-left: 16px; - padding-bottom: 4px; -} - -.review_item{ - text-align: center; -} -.review_item .box, .review_item .box2, .review_item .boxn { - width: 400px; - margin: auto; - border: 1px solid #eeeeee; - background: #ffffff; - padding: 8px; -} - -.review_item .box { - height: 300px; -} - -.review_item .box2 { - height: 220px; -} - -.review_item .boxn { - border-top: 0px; - height: 64px; - font-size: 0.8em; -} - -.review_item .boxn em { - color: grey; -} - -.review_item_prop span { - display: inline-block; - padding-right: 8px; - font-size: 0.8em; -} - -.rtk_kr_q_1, .rtk_kr_a_1, .rtk_kr_q_2, .rtk_kr_a_2, .vocabqa, .vocabqb, .vocaba - { margin: 0px; padding: 0px; padding-top: 50px; } -.rtk_kr_q_1, .rtk_kr_a_2 span { font-size: 4em; font-family: "IPAMincho", serif; } -.rtk_kr_q_2, .rtk_kr_a_1 span { font-size: 1.3em; } - -.vocabqa { font-size: 1.5em; } -.vocabqb { font-size: 2em; } -.vocaba { font-size: 1.5em; } -.vocaba .vocabreading { font-size: 0.7em; } -.vocaba span { padding-top: 16px; } - /* blog */ .blog_post { margin: 4px; margin-top: 16px; - border-left: 1px solid #ccc; - border-bottom: 1px dashed #ccc; - padding: 8px; - padding-top: 16px; + padding: 16px; + border: 1px solid black; } .blog_post .inside { diff --git a/lib/blog/edit.php b/lib/blog/edit.php index d76781c..2c87bde 100644 --- a/lib/blog/edit.php +++ b/lib/blog/edit.php @@ -30,11 +30,12 @@ if (isset($_POST['title']) && isset($_POST['tags']) && isset($_POST['text'])) { " WHERE id = $postid"); sql("DELETE FROM blog_tags WHERE post = $postid"); $tags = explode(' ', $post_tags); - if (count($tags) == 1 && $tags[0] == "") { + if ($post_tags == "") { //do nothing lol } else if (count($tags) >= 1) { $v = array(); foreach ($tags as $tag) { + if ($tag == "") continue; $v[] = "($postid, '" . escs($tag) . "')"; } sql("INSERT INTO blog_tags(post, tag) VALUES " . implode(',', $v)); diff --git a/lib/blog/index.php b/lib/blog/index.php index dd353d3..08aa630 100644 --- a/lib/blog/index.php +++ b/lib/blog/index.php @@ -51,7 +51,7 @@ $q = (isset($fvalues['tag']) ? "LEFT JOIN blog_tags bb ON bb.post = blog_posts.id AND bb.tag = '" . escs($fvalues['tag'])."' " : ""). "WHERE blog_posts.draft = 0 ". (isset($fvalues['author']) ? 'AND blog_posts.owner = ' . intval($fvalues['author']) .' ' : ''). - (isset($fvalues['date']) ? "AND blog_posts.date >= '" . escs(str_replace('.', '-', $fvalues['date'])) ."-01 00:00:00' " . + (isset($fvalues['date']) ? "AND blog_posts.date >= '" . escs(str_replace('_', '-', $fvalues['date'])) ."-01 00:00:00' " . "AND blog_posts.date <= '" . escs(str_replace('.', '-', $fvalues['date'])) . "-31 23:59:59'" : ''). (isset($fvalues['tag']) ? " AND bb.post != 0 " : ""). "GROUP BY blog_posts.id ". @@ -64,9 +64,10 @@ while ($pp = mysql_fetch_assoc($n)) { count_in('author', $pp['owner_id'], $pp['owner']); $tags = explode(', ', $pp['tags']); foreach ($tags as $tag) { + if ($tag == "") continue; count_in('tag', $tag, $tag); } - count_in('date', str_replace('-', '.', $pp['month']), $pp['month']); + count_in('date', str_replace('-', '_', $pp['month']), $pp['month']); } $can_post = ($user['priv'] >= $apps['blog']['drafts'] && $user['id'] != 0); diff --git a/tpl/blog/index.php b/tpl/blog/index.php index 712b205..b70a80a 100644 --- a/tpl/blog/index.php +++ b/tpl/blog/index.php @@ -10,22 +10,27 @@ if ($can_post) { echo '<div class="ordering_links">' . filters_html_full() . '</div>'; -foreach ($posts as $post) { - echo '<div class="blog_post">'; - echo '<div class="small_right">écrit par ' . $post['owner']; - if ($can_edit && $post['owner_id'] == $user['id']) - echo ' | <a href="edit-blog-' . $post['id'] . '">modifier</a>'; - if ($can_delete && $post['owner_id'] == $user['id']) - echo ' | <a href="delete-blog-' . $post['id'] . '">supprimer</a>'; - echo ' | <a href="view-blog-' . $post['id'] . '">lire & commenter (' . $post['comments'] . ')</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>'; + +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">'; |