Changeset 5199


Ignore:
Timestamp:
Mar 20, 2010, 7:11:21 AM (11 years ago)
Author:
rvelices
Message:

fix bug (a comment could be displayed several times in the comments liat)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/comments.php

    r5196 r5199  
    185185  if (isset($_GET[$loop_action]))
    186186  {
    187     $action = $loop_action;   
     187    $action = $loop_action;
    188188    check_input_parameter($action, $_GET, false, PATTERN_ID);
    189189    $comment_id = $_GET[$action];
     
    197197
    198198  $comment_author_id = get_comment_author_id($comment_id);
    199    
     199
    200200  if (can_manage_comment($action, $comment_author_id))
    201201  {
    202202    $perform_redirect = false;
    203  
     203
    204204    if ('delete' == $action)
    205205    {
     
    213213      $perform_redirect = true;
    214214    }
    215    
     215
    216216    if ('edit' == $action)
    217217    {
     
    226226          $_POST['key']
    227227          );
    228        
     228
    229229        $edit_comment = null;
    230230      }
     
    234234      }
    235235    }
    236    
     236
    237237    if ($perform_redirect)
    238238    {
     
    241241        .'comments.php'
    242242        .get_query_string_diff(array('delete','validate','pwg_token'));
    243      
     243
    244244      redirect($redirect_url);
    245245    }
     
    330330SELECT COUNT(DISTINCT(com.id))
    331331  FROM '.IMAGE_CATEGORY_TABLE.' AS ic
    332     INNER JOIN '.COMMENTS_TABLE.' AS com   
     332    INNER JOIN '.COMMENTS_TABLE.' AS com
    333333    ON ic.image_id = com.image_id
    334334    LEFT JOIN '.USERS_TABLE.' As u
     
    375375  WHERE '.implode('
    376376    AND ', $page['where_clauses']).'
    377   GROUP BY comment_id, com.image_id, ic.category_id, com.author,
    378            com.author_id, com.date, com.content, com.validated
     377  GROUP BY comment_id
    379378  ORDER BY '.$page['sort_by'].' '.$page['sort_order'];
    380379if ('all' != $page['items_number'])
     
    438437        )
    439438      );
    440    
     439
    441440    $tpl_comment = array(
    442441      'U_PICTURE' => $url,
     
    454453        .'comments.php'
    455454        .get_query_string_diff(array('delete','validate','edit', 'pwg_token'));
    456      
     455
    457456      $tpl_comment['U_DELETE'] = add_url_params(
    458457        $url,
     
    463462        );
    464463    }
    465    
     464
    466465    if (can_manage_comment('edit', $comment['author_id']))
    467466    {
     
    470469        .'comments.php'
    471470        .get_query_string_diff(array('edit', 'delete','validate', 'pwg_token'));
    472      
     471
    473472      $tpl_comment['U_EDIT'] = add_url_params(
    474473        $url,
     
    478477          )
    479478        );
    480      
     479
    481480      if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment))
    482481      {
Note: See TracChangeset for help on using the changeset viewer.