diff --git a/css/style.css b/css/style.css index ee99dbcfc..e0041a2d8 100644 --- a/css/style.css +++ b/css/style.css @@ -32,6 +32,21 @@ header { color: #F1F1F1; } +#main ul#sort { + padding: 0; + list-style-type: none; + text-align: center; +} + +#main ul#sort li { + display: inline; + font-size: 0.9em; +} + +#main ul#sort img:hover { + cursor: pointer; +} + #main, #article { margin: 0 auto; } diff --git a/img/down.png b/img/down.png new file mode 100755 index 000000000..b9d536a7c Binary files /dev/null and b/img/down.png differ diff --git a/img/up.png b/img/up.png new file mode 100755 index 000000000..954a8c0ac Binary files /dev/null and b/img/up.png differ diff --git a/inc/config.php b/inc/config.php index 4c1978b54..d468228d2 100644 --- a/inc/config.php +++ b/inc/config.php @@ -35,8 +35,8 @@ if (!isset($_SESSION['token_poche'])) { } # Traitement des paramètres et déclenchement des actions +$view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index'; $action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : ''; -$_SESSION['view'] = (isset ($_GET['view'])) ? htmlentities($_GET['view']) : 'index'; $_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id'; $id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : ''; $url = (isset ($_GET['url'])) ? $_GET['url'] : ''; diff --git a/inc/functions.php b/inc/functions.php index a7430585b..464410cb5 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -182,7 +182,7 @@ function action_to_do($action, $id, $url, $token) /** * Détermine quels liens afficher : home, fav ou archives */ -function display_view() +function display_view($view) { global $db; @@ -205,7 +205,7 @@ function display_view() break; } - switch ($_SESSION['view']) + switch ($view) { case 'archive': $sql = "SELECT * FROM entries WHERE is_read=? " . $order; diff --git a/index.php b/index.php index f62cf139a..c303f8e36 100755 --- a/index.php +++ b/index.php @@ -10,10 +10,10 @@ include dirname(__FILE__).'/inc/config.php'; -$entries = display_view(); +$entries = display_view($view); $tpl->assign('title', 'poche, a read it later open source system'); -$tpl->assign('view', $_SESSION['view']); +$tpl->assign('view', $view); $tpl->assign('poche_url', get_poche_url()); $tpl->assign('entries', $entries); $tpl->assign('load_all_js', 1); diff --git a/js/poche.js b/js/poche.js index f0e39b381..98fc48ea3 100644 --- a/js/poche.js +++ b/js/poche.js @@ -22,6 +22,6 @@ function toggle_archive(element, id, token, view_article) { } } -function sort_links(sort, token) { - $('#content').load('process.php', { sort: sort, token: token } ); +function sort_links(view, sort, token) { + $('#content').load('process.php', { view: view, sort: sort, token: token } ); } \ No newline at end of file diff --git a/process.php b/process.php new file mode 100644 index 000000000..146868858 --- /dev/null +++ b/process.php @@ -0,0 +1,16 @@ + + * @copyright 2013 + * @license http://www.wtfpl.net/ see COPYING file + */ + +include dirname(__FILE__).'/inc/config.php'; + +$entries = display_view($view); +$tpl->assign('token', $_SESSION['token_poche']); +$tpl->assign('entries', $entries); +$tpl->draw('entries'); \ No newline at end of file diff --git a/tpl/home.html b/tpl/home.html index d96125320..568b9274d 100644 --- a/tpl/home.html +++ b/tpl/home.html @@ -9,10 +9,8 @@
  • archive
  • poche it !
  • - +
    \ No newline at end of file