diff options
author | rvelices <rv-github@modusoptimus.com> | 2012-02-02 20:59:41 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2012-02-02 20:59:41 +0000 |
commit | 18036a70fcee8e372b6b8d98fbe8a61a3685798f (patch) | |
tree | 5f81c65b42dd992c878ef49ea94da23673fbd808 /include/picture_comment.inc.php | |
parent | a68826cbb3ad9b09edc6c13a63923b4e827f918f (diff) |
feature 2548 multisize - custom sizes restricted to those requested by theme/plugin
code refacto
git-svn-id: http://piwigo.org/svn/trunk@13021 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/picture_comment.inc.php')
-rw-r--r-- | include/picture_comment.inc.php | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php index da674482f..7432aa8d5 100644 --- a/include/picture_comment.inc.php +++ b/include/picture_comment.inc.php @@ -126,26 +126,12 @@ SELECT if ($row['nb_comments'] > 0) { // comments order (get, session, conf) - if (!empty($_GET['comments_order'])) + if (!empty($_GET['comments_order']) && in_array(strtoupper($_GET['comments_order']), array('ASC', 'DESC'))) { - if (in_array(strtoupper($_GET['comments_order']), array('ASC', 'DESC'))) - { - $comments_order = $_GET['comments_order']; - pwg_set_session_var('comments_order', $comments_order); - } - else - { - $comments_order = $conf['comments_order']; - } - } - else if (pwg_get_session_var('comments_order') !== null) - { - $comments_order = pwg_get_session_var('comments_order'); - } - else - { - $comments_order = $conf['comments_order']; + pwg_set_session_var('comments_order', $_GET['comments_order']); } + $comments_order = pwg_get_session_var('comments_order', $conf['comments_order']); + $template->assign(array( 'COMMENTS_ORDER_URL' => duplicate_picture_url().'&comments_order='.($comments_order == 'ASC' ? 'DESC' : 'ASC'), 'COMMENTS_ORDER_TITLE' => $comments_order == 'ASC' ? l10n('ascending') : l10n('descending'), |