diff options
-rw-r--r-- | css/style.css | 15 | ||||
-rwxr-xr-x | img/down.png | bin | 0 -> 216 bytes | |||
-rwxr-xr-x | img/up.png | bin | 0 -> 212 bytes | |||
-rw-r--r-- | inc/config.php | 2 | ||||
-rwxr-xr-x | inc/functions.php | 4 | ||||
-rwxr-xr-x | index.php | 4 | ||||
-rw-r--r-- | js/poche.js | 4 | ||||
-rw-r--r-- | process.php | 16 | ||||
-rw-r--r-- | tpl/home.html | 10 |
9 files changed, 42 insertions, 13 deletions
diff --git a/css/style.css b/css/style.css index ee99dbcf..e0041a2d 100644 --- a/css/style.css +++ b/css/style.css | |||
@@ -32,6 +32,21 @@ header { | |||
32 | color: #F1F1F1; | 32 | color: #F1F1F1; |
33 | } | 33 | } |
34 | 34 | ||
35 | #main ul#sort { | ||
36 | padding: 0; | ||
37 | list-style-type: none; | ||
38 | text-align: center; | ||
39 | } | ||
40 | |||
41 | #main ul#sort li { | ||
42 | display: inline; | ||
43 | font-size: 0.9em; | ||
44 | } | ||
45 | |||
46 | #main ul#sort img:hover { | ||
47 | cursor: pointer; | ||
48 | } | ||
49 | |||
35 | #main, #article { | 50 | #main, #article { |
36 | margin: 0 auto; | 51 | margin: 0 auto; |
37 | } | 52 | } |
diff --git a/img/down.png b/img/down.png new file mode 100755 index 00000000..b9d536a7 --- /dev/null +++ b/img/down.png | |||
Binary files differ | |||
diff --git a/img/up.png b/img/up.png new file mode 100755 index 00000000..954a8c0a --- /dev/null +++ b/img/up.png | |||
Binary files differ | |||
diff --git a/inc/config.php b/inc/config.php index 4c1978b5..d468228d 100644 --- a/inc/config.php +++ b/inc/config.php | |||
@@ -35,8 +35,8 @@ if (!isset($_SESSION['token_poche'])) { | |||
35 | } | 35 | } |
36 | 36 | ||
37 | # Traitement des paramètres et déclenchement des actions | 37 | # Traitement des paramètres et déclenchement des actions |
38 | $view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index'; | ||
38 | $action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : ''; | 39 | $action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : ''; |
39 | $_SESSION['view'] = (isset ($_GET['view'])) ? htmlentities($_GET['view']) : 'index'; | ||
40 | $_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id'; | 40 | $_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id'; |
41 | $id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : ''; | 41 | $id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : ''; |
42 | $url = (isset ($_GET['url'])) ? $_GET['url'] : ''; | 42 | $url = (isset ($_GET['url'])) ? $_GET['url'] : ''; |
diff --git a/inc/functions.php b/inc/functions.php index a7430585..464410cb 100755 --- a/inc/functions.php +++ b/inc/functions.php | |||
@@ -182,7 +182,7 @@ function action_to_do($action, $id, $url, $token) | |||
182 | /** | 182 | /** |
183 | * Détermine quels liens afficher : home, fav ou archives | 183 | * Détermine quels liens afficher : home, fav ou archives |
184 | */ | 184 | */ |
185 | function display_view() | 185 | function display_view($view) |
186 | { | 186 | { |
187 | global $db; | 187 | global $db; |
188 | 188 | ||
@@ -205,7 +205,7 @@ function display_view() | |||
205 | break; | 205 | break; |
206 | } | 206 | } |
207 | 207 | ||
208 | switch ($_SESSION['view']) | 208 | switch ($view) |
209 | { | 209 | { |
210 | case 'archive': | 210 | case 'archive': |
211 | $sql = "SELECT * FROM entries WHERE is_read=? " . $order; | 211 | $sql = "SELECT * FROM entries WHERE is_read=? " . $order; |
@@ -10,10 +10,10 @@ | |||
10 | 10 | ||
11 | include dirname(__FILE__).'/inc/config.php'; | 11 | include dirname(__FILE__).'/inc/config.php'; |
12 | 12 | ||
13 | $entries = display_view(); | 13 | $entries = display_view($view); |
14 | 14 | ||
15 | $tpl->assign('title', 'poche, a read it later open source system'); | 15 | $tpl->assign('title', 'poche, a read it later open source system'); |
16 | $tpl->assign('view', $_SESSION['view']); | 16 | $tpl->assign('view', $view); |
17 | $tpl->assign('poche_url', get_poche_url()); | 17 | $tpl->assign('poche_url', get_poche_url()); |
18 | $tpl->assign('entries', $entries); | 18 | $tpl->assign('entries', $entries); |
19 | $tpl->assign('load_all_js', 1); | 19 | $tpl->assign('load_all_js', 1); |
diff --git a/js/poche.js b/js/poche.js index f0e39b38..98fc48ea 100644 --- a/js/poche.js +++ b/js/poche.js | |||
@@ -22,6 +22,6 @@ function toggle_archive(element, id, token, view_article) { | |||
22 | } | 22 | } |
23 | } | 23 | } |
24 | 24 | ||
25 | function sort_links(sort, token) { | 25 | function sort_links(view, sort, token) { |
26 | $('#content').load('process.php', { sort: sort, token: token } ); | 26 | $('#content').load('process.php', { view: view, sort: sort, token: token } ); |
27 | } \ No newline at end of file | 27 | } \ No newline at end of file |
diff --git a/process.php b/process.php new file mode 100644 index 00000000..14686885 --- /dev/null +++ b/process.php | |||
@@ -0,0 +1,16 @@ | |||
1 | <?php | ||
2 | /** | ||
3 | * poche, a read it later open source system | ||
4 | * | ||
5 | * @category poche | ||
6 | * @author Nicolas Lœuillet <support@inthepoche.com> | ||
7 | * @copyright 2013 | ||
8 | * @license http://www.wtfpl.net/ see COPYING file | ||
9 | */ | ||
10 | |||
11 | include dirname(__FILE__).'/inc/config.php'; | ||
12 | |||
13 | $entries = display_view($view); | ||
14 | $tpl->assign('token', $_SESSION['token_poche']); | ||
15 | $tpl->assign('entries', $entries); | ||
16 | $tpl->draw('entries'); \ No newline at end of file | ||
diff --git a/tpl/home.html b/tpl/home.html index d9612532..568b9274 100644 --- a/tpl/home.html +++ b/tpl/home.html | |||
@@ -9,10 +9,8 @@ | |||
9 | <li><a href="?view=archive" {if="$view == 'archive'"}class="current"{/if}>archive</a></li> | 9 | <li><a href="?view=archive" {if="$view == 'archive'"}class="current"{/if}>archive</a></li> |
10 | <li><a style="cursor: move" title="i am a bookmarklet, use me !" href="javascript:(function(){var%20url%20=%20location.href%20||%20url;window.open('{$poche_url}?action=add&url='%20+%20encodeURIComponent(url),'_self');})();">poche it !</a></li> | 10 | <li><a style="cursor: move" title="i am a bookmarklet, use me !" href="javascript:(function(){var%20url%20=%20location.href%20||%20url;window.open('{$poche_url}?action=add&url='%20+%20encodeURIComponent(url),'_self');})();">poche it !</a></li> |
11 | </ul> | 11 | </ul> |
12 | <!-- <ul> | 12 | <ul id="sort"> |
13 | <li onclick="sort_links('ia', '{$token}');">tri par id asc</li> | 13 | <li><img src="img/up.png" onclick="sort_links('{$view}', 'ia', '{$token}');" title="by date asc" /> by date <img src="img/down.png" onclick="sort_links('{$view}', 'id', '{$token}');" title="by date desc" /></li> |
14 | <li onclick="sort_links('id', '{$token}');">tri par id desc</li> | 14 | <li><img src="img/up.png" onclick="sort_links('{$view}', 'ta', '{$token}');" title="by title asc" /> by title <img src="img/down.png" onclick="sort_links('{$view}', 'td', '{$token}');" title="by title desc" /></li> |
15 | <li onclick="sort_links('ta', '{$token}');">tri par title asc</li> | 15 | </ul> |
16 | <li onclick="sort_links('td', '{$token}');">tri par title desc</li> | ||
17 | </ul> --> | ||
18 | <div id="content"> \ No newline at end of file | 16 | <div id="content"> \ No newline at end of file |