Ignore:
Timestamp:
Feb 2, 2012, 9:59:41 PM (9 years ago)
Author:
rvelices
Message:

feature 2548 multisize - custom sizes restricted to those requested by theme/plugin
code refacto

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/picture_comment.inc.php

    r12922 r13021  
    127127  {
    128128    // comments order (get, session, conf)
    129     if (!empty($_GET['comments_order']))
     129    if (!empty($_GET['comments_order']) && in_array(strtoupper($_GET['comments_order']), array('ASC', 'DESC')))
    130130    {
    131       if (in_array(strtoupper($_GET['comments_order']), array('ASC', 'DESC')))
    132       {
    133         $comments_order = $_GET['comments_order'];
    134         pwg_set_session_var('comments_order', $comments_order);
    135       }
    136       else
    137       {
    138         $comments_order = $conf['comments_order'];
    139       }
     131      pwg_set_session_var('comments_order', $_GET['comments_order']);
    140132    }
    141     else if (pwg_get_session_var('comments_order') !== null)
    142     {
    143       $comments_order = pwg_get_session_var('comments_order');
    144     }
    145     else
    146     {
    147       $comments_order = $conf['comments_order'];
    148     }
     133    $comments_order = pwg_get_session_var('comments_order', $conf['comments_order']);
     134
    149135    $template->assign(array(
    150136      'COMMENTS_ORDER_URL' => duplicate_picture_url().'&comments_order='.($comments_order == 'ASC' ? 'DESC' : 'ASC'),
Note: See TracChangeset for help on using the changeset viewer.