Changeset 26088


Ignore:
Timestamp:
Dec 22, 2013, 7:46:47 PM (7 years ago)
Author:
mistic100
Message:

minimize number of url constructions on comments.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/comments.php

    r25018 r26088  
    3838// +-----------------------------------------------------------------------+
    3939check_status(ACCESS_GUEST);
     40
     41$url_self = PHPWG_ROOT_PATH.'comments.php'
     42  .get_query_string_diff(array('delete','edit','validate','pwg_token'));
    4043
    4144$sort_order = array(
     
    285288    if ($perform_redirect)
    286289    {
    287       $redirect_url =
    288         PHPWG_ROOT_PATH
    289         .'comments.php'
    290         .get_query_string_diff(array('delete','edit','validate','pwg_token'));
    291 
    292       redirect($redirect_url);
     290      redirect($url_self);
    293291    }
    294292  }
     
    387385list($counter) = pwg_db_fetch_row(pwg_query($query));
    388386
    389 $url = PHPWG_ROOT_PATH
    390     .'comments.php'
    391   .get_query_string_diff(array('start','delete','validate','pwg_token'));
     387$url = PHPWG_ROOT_PATH.'comments.php'
     388  .get_query_string_diff(array('start','edit','delete','validate','pwg_token'));
    392389
    393390$navbar = create_navigation_bar($url,
     
    398395
    399396$template->assign('navbar', $navbar);
    400 
    401 $url_self = PHPWG_ROOT_PATH
    402     .'comments.php'
    403   .get_query_string_diff(array('edit','delete','validate','pwg_token'));
    404397
    405398// +-----------------------------------------------------------------------+
     
    537530    if (can_manage_comment('delete', $comment['author_id']))
    538531    {
    539       $url =
    540         get_root_url()
    541         .'comments.php'
    542         .get_query_string_diff(array('delete','validate','edit', 'pwg_token'));
    543 
    544532      $tpl_comment['U_DELETE'] = add_url_params(
    545         $url,
     533        $url_self,
    546534        array(
    547535          'delete' => $comment['comment_id'],
     
    553541    if (can_manage_comment('edit', $comment['author_id']))
    554542    {
    555       $url =
    556         get_root_url()
    557         .'comments.php'
    558         .get_query_string_diff(array('edit', 'delete','validate', 'pwg_token'));
    559 
    560543      $tpl_comment['U_EDIT'] = add_url_params(
    561         $url,
     544        $url_self,
    562545        array(
    563546          'edit' => $comment['comment_id']
     
    582565      {
    583566        $tpl_comment['U_VALIDATE'] = add_url_params(
    584           $url,
     567          $url_self,
    585568          array(
    586569            'validate'=> $comment['comment_id'],
Note: See TracChangeset for help on using the changeset viewer.