Ignore:
Timestamp:
Mar 15, 2006, 11:44:35 PM (18 years ago)
Author:
plg
Message:

new: cleaner URL. Instead of category.php?cat=search&search=123&start=42,
you now have category.php?/search/123/start-42. Functions make_index_url and
make_picture_url build these new URLs. Functions duplicate_picture_url and
duplicate_index_url provide shortcuts to URL creation. The current main page
page is still category.php but this can be modified easily in make_index_url
function. In this first version, no backward compatibility. Calendar
definition in URL must be discussed with rvelices.

improvement: picture.php redesigned. First actions like "set as
representative" or "delete a comment" which all lead to a redirection. Then
the page (the big mess) and includes of new sub pages to manage specific
parts of the page (metadata, user comments, rates).

new: with the cleaner URL comes a new terminology. $pagecat doesn't
exist anymore. $pagesection is among 'categories', 'tags' (TODO),
'list', 'most_seen'... And sub parameters are set : $pagecategory if
$pagesection is "categories". See URL analyse in
include/section_init.inc.php for details.

File:
1 edited

Legend:

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

    r1004 r1082  
    2727
    2828/**
    29  * This file is included by category.php to show thumbnails for a category
     29 * This file is included by the main page to show thumbnails for a category
    3030 * that have only subcategories
    3131 *
     
    3535SELECT id, name, date_last, representative_picture_id
    3636  FROM '.CATEGORIES_TABLE.'
    37   WHERE id_uppercat ';
    38 if (!isset($page['cat']) or !is_numeric($page['cat']))
    39 {
    40   $query.= 'is NULL';
    41 }
    42 else
    43 {
    44   $query.= '= '.$page['cat'];
    45 }
    46   $query.= '
     37  WHERE id_uppercat '.
     38  (!isset($page['category']) ? 'is NULL' : '= '.$page['category']).'
    4739    AND id NOT IN ('.$user['forbidden_categories'].')
    4840  ORDER BY rank
     
    143135  foreach ($cat_thumbnails as $item)
    144136  {
    145     $url_link = PHPWG_ROOT_PATH.'category.php?cat='.$row['id'];
    146 
    147137    $template->assign_block_vars(
    148138      'thumbnails.line.thumbnail',
    149139      array(
    150         'IMAGE' => $images[$item['picture']],
    151         'IMAGE_ALT' => $item['name'],
     140        'IMAGE'       => $images[$item['picture']],
     141        'IMAGE_ALT'   => $item['name'],
    152142        'IMAGE_TITLE' => $lang['hint_category'],
    153         'IMAGE_TS' => get_icon(@$item['date_last']),
    154         'U_IMG_LINK' =>
    155           PHPWG_ROOT_PATH.'category.php?cat='.$item['category']
     143        'IMAGE_TS'    => get_icon(@$item['date_last']),
     144       
     145        'U_IMG_LINK'  => make_index_url(
     146          array(
     147            'category' => $item['category'],
     148            )
     149          ),
    156150        )
    157151      );
Note: See TracChangeset for help on using the changeset viewer.