Ignore:
Timestamp:
Mar 21, 2006, 2:27:21 AM (18 years ago)
Author:
rvelices
Message:

URL rewriting: fix some old links, calendar simplification and prepare code
for urls without ? (added functions get_root_url and add_url_param)

File:
1 edited

Legend:

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

    r1082 r1090  
    2929 * This file is included by the main page to show thumbnails for the default
    3030 * case
    31  * 
     31 *
    3232 */
    3333
     
    5353  {
    5454    $row['rank'] = $page['rank_of'][ $row['id'] ];
    55    
     55
    5656    array_push($pictures, $row);
    5757  }
     
    7373{
    7474  $thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']);
    75  
     75
    7676  // message in title for the thumbnail
    7777  $thumbnail_title = $row['file'];
     
    8080    $thumbnail_title .= ' : '.$row['filesize'].' KB';
    8181  }
    82  
    83   // url link on picture.php page
    84   $url_link = PHPWG_ROOT_PATH.'picture.php?/'.$row['id'];
    8582
    86   switch ($page['section'])
    87   {
    88     case 'categories' :
    89     {
    90       $url_link.= '/category/'.$page['category'];
    91       break;
    92     }
    93     case 'tags' :
    94     {
    95       // TODO
    96       break;
    97     }
    98     case 'search' :
    99     {
    100       $url_link.= '/search/'.$page['search'];
    101       break;
    102     }
    103     case 'list' :
    104     {
    105       $url_link.= '/list/'.implode(',', $page['list']);
    106       break;
    107     }
    108     default :
    109     {
    110       $url_link.= '/'.$page['section'];
    111     }
    112   }
    113  
    114   if (isset($page['chronology']))
    115   {
    116     $url_link.= '/chronology='.$page['chronology'];
    117   }
    118    
     83  // link on picture.php page
     84  $url = duplicate_picture_url(
     85        array(
     86          'image_id' => $row['id'],
     87          'image_file' => $row['file']
     88        )
     89      );
     90
    11991  $template->assign_block_vars(
    12092    'thumbnails.line.thumbnail',
     
    12496      'IMAGE_TITLE'        => $thumbnail_title,
    12597      'IMAGE_TS'           => get_icon($row['date_available']),
    126      
    127       'U_IMG_LINK'         => $url_link
     98
     99      'U_IMG_LINK'         => $url
    128100      )
    129101    );
     
    159131      }
    160132    }
    161  
     133
    162134    $template->assign_block_vars(
    163135      'thumbnails.line.thumbnail.element_name',
     
    167139      );
    168140  }
    169    
     141
    170142  if ($user['show_nb_comments']
    171143      and isset($page['category'])
Note: See TracChangeset for help on using the changeset viewer.