Ignore:
Timestamp:
Jul 27, 2012, 4:47:29 PM (12 years ago)
Author:
mistic100
Message:

rewrite all urls to be compatible with "question_mark_in_urls"

Location:
extensions/UserCollections
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserCollections/include/UserCollection.class.php

    r16688 r17178  
    292292      'PUBLIC' => (bool)$this->data['public'],
    293293      'DATE_CREATION' => format_date($this->data['date_creation'], true),
    294       'U_PUBLIC' => get_absolute_root_url().USER_COLLEC_PUBLIC . 'view/'.$this->data['public_id'],
     294      'U_PUBLIC' => get_absolute_root_url().'collection/view/'.$this->data['public_id'],
    295295      'IS_TEMP' =>  $this->data['name'] == 'temp',
    296296      );
  • extensions/UserCollections/include/collections.inc.php

    r16688 r17178  
    120120      $col['date_creation'] = format_date($col['date_creation'], true);
    121121      $col['U_EDIT'] = USER_COLLEC_PUBLIC.'edit/'.$col['id'];
    122       $col['U_ACTIVE'] = USER_COLLEC_PUBLIC.'&action=set_active&col_id='.$col['id'];
    123       $col['U_DELETE'] = USER_COLLEC_PUBLIC.'&action=delete&col_id='.$col['id'];
     122      $col['U_ACTIVE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'set_active','col_id'=>$col['id']));
     123      $col['U_DELETE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$col['id']));
    124124     
    125125      if (isset($pwg_loaded_plugins['BatchDownloader']))
    126126      {
    127         $col['U_DOWNLOAD'] = USER_COLLEC_PUBLIC.'view/'.$col['public_id'].'&action=advdown_set';
     127        $col['U_DOWNLOAD'] = add_url_params(USER_COLLEC_PUBLIC.'view/'.$col['public_id'], array('action'=>'advdown_set'));
    128128      }
    129129     
     
    132132      {
    133133        $col['name'] = 'temp #'.$col['id'];
    134         $col['U_SAVE'] = USER_COLLEC_PUBLIC.'&action=save&col_id='.$col['id'];
     134        $col['U_SAVE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'save','col_id'=>$col['id']));
    135135        $template->append('temp_col', $col);
    136136      }
     
    141141    }
    142142   
    143     $template->assign('U_CREATE', USER_COLLEC_PUBLIC.'&action=new&col_id=0');
     143    $template->assign('U_CREATE', add_url_params(USER_COLLEC_PUBLIC, array('action'=>'new','col_id'=>'0')));
    144144    break;
    145145  }
     
    202202      $col = $UserCollection->getCollectionInfo();
    203203      $col['U_CLEAR'] = $self_url.'&action=clear';
    204       $col['U_DELETE'] = USER_COLLEC_PUBLIC.'&action=delete&col_id='.$page['col_id'];
     204      $col['U_DELETE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$page['col_id']));
    205205      $template->assign('collection', $col);
    206206     
  • extensions/UserCollections/include/events.inc.php

    r16698 r17178  
    1616  global $tokens, $page, $conf;
    1717 
     18  define('USER_COLLEC_PUBLIC',     make_index_url(array('section' => 'collections')) . '/');
     19
    1820  if ($tokens[0] == 'collections')
    1921  {
     
    3537    }
    3638  }
    37  
    38   // if ( script_basename() == 'picture' and @$tokens[1] == 'collections' and preg_match('#^[0-9]+$#', @$tokens[2]) )
    39   // {
    40     // try
    41     // {
    42       // $UserCollection = new UserCollection($tokens[2]);
    43       // $page['title'].= $conf['level_separator'].l10n('Collection').': <a href="'.USER_COLLEC_PUBLIC . 'view/'.$tokens[2].'">'.$UserCollection->getParam('name').'</a>';
    44       // $page['items'] = $UserCollection->getImages();
    45       // $page['col_id'] = $tokens[2];
    46     // } catch (Exception $e) {}
    47   // }
    4839}
    4940
     
    125116  $template->assign(array(
    126117    'USER_COLLEC_PATH' => USER_COLLEC_PATH,
    127     'collection_toggle_url' =>  $self_url,
     118    'collection_toggle_url' =>  add_url_params($self_url, array('collection_toggle'=>'')),
    128119    ));
    129120  $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_prefilter');
     
    137128  $search = '<span class="wrap1">';
    138129  $replace = $search.'
    139 {strip}<a class="addCollection" href="{$collection_toggle_url}&amp;collection_toggle={$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow">
     130{strip}<a class="addCollection" href="{$collection_toggle_url}{$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow">
    140131{if $COL_ID or $thumbnail.COLLECTION_SELECTED}
    141 {\'Remove from collection\'|@translate}&nbsp;<img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}">
     132{\'Remove from collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}">
    142133{else}
    143 {\'Add to collection\'|@translate}&nbsp;<img src="{$USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}">
     134{\'Add to collection\'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}">
    144135{/if}
    145136</a>{/strip}';
     
    186177  } 
    187178 
    188   $url = duplicate_picture_url().'&amp;action=collection_toggle';   
     179  $url = add_url_params(duplicate_picture_url(), array('action'=>'collection_toggle'));   
    189180 
    190181  $button = '
    191182<a href="'.$url.'" title="'.($collection?l10n('Remove from collection'):l10n('Add to collection')).'" class="pwg-state-default pwg-button" rel="nofollow">
    192   <span class="pwg-icon" style="background:url(\''.USER_COLLEC_PATH.'template/image_'.($collection?'delete':'add').'.png\') center center no-repeat;"> </span>
     183  <span class="pwg-icon" style="background:url(\''.get_root_url().USER_COLLEC_PATH.'template/image_'.($collection?'delete':'add').'.png\') center center no-repeat;"> </span>
    193184  <span class="pwg-button-text">'.($collection?l10n('Remove from collection'):l10n('Add to collection')).'</span>
    194185</a>';
    195    
     186  // $template->add_picture_button($button, 50);
    196187  $template->concat('PLUGIN_PICTURE_ACTIONS', $button);
    197188}
     
    242233   
    243234    $data['U_LIST'] = USER_COLLEC_PUBLIC;
    244     $data['U_CREATE'] = USER_COLLEC_PUBLIC.'&amp;action=new&amp;col_id=0&amp;redirect=true';
     235    $data['U_CREATE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'new','col_id'=>'0','redirect'=>'true'));
    245236   
    246237    $template->set_template_dir(USER_COLLEC_PATH . 'template/');
  • extensions/UserCollections/main.inc.php

    r16688 r17178  
    1717define('COLLECTION_IMAGES_TABLE',$prefixeTable.'collection_images');
    1818define('USER_COLLEC_ADMIN',      get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
    19 define('USER_COLLEC_PUBLIC',     make_index_url(array('section' => 'collections')) . '/');
    20 
    2119
    2220add_event_handler('init', 'user_collections_init');
  • extensions/UserCollections/template/thumbnails_css_js.tpl

    r16698 r17178  
    1313  jQuery.ajax({ldelim}
    1414    type: "POST",
    15     url: "{$USER_COLLEC_PATH}toggle_image.php",
     15    url: "{$ROOT_URL}{$USER_COLLEC_PATH}toggle_image.php",
    1616    data: {ldelim} {if $COL_ID}"col_id": "{$COL_ID}", {/if}"toggle_id": toggle_id }
    1717  }).done(function(msg) {ldelim}
    1818    if (msg == "true") {ldelim}
    19       $trigger.html('{'Remove from collection'|@translate}&nbsp;<img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{'Remove from collection'|@translate}">');
     19      $trigger.html('{'Remove from collection'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_delete.png" title="{'Remove from collection'|@translate}">');
    2020      jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) +1);
    2121    } else if (msg == "false") {ldelim}
     
    2424      if (typeof batchdown_count != 'undefined') batchdown_count-=1;
    2525    {else}
    26       $trigger.html('{'Add to collection'|@translate}&nbsp;<img src="{$USER_COLLEC_PATH}template/image_add.png" title="{'Add to collection'|@translate}">');
     26      $trigger.html('{'Add to collection'|@translate}&nbsp;<img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_add.png" title="{'Add to collection'|@translate}">');
    2727    {/if}
    2828      jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) -1);
Note: See TracChangeset for help on using the changeset viewer.