Ignore:
Timestamp:
Apr 6, 2006, 1:08:37 AM (18 years ago)
Author:
plg
Message:

new: MOD subcatify integrated. On main page, thumbnails representing a
category are not displayed the same way as thumbnails representing a
picture. Feedback welcomed on this feature.

File:
1 edited

Legend:

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

    r1098 r1130  
    3333
    3434$query = '
    35 SELECT id, name, date_last, representative_picture_id
     35SELECT id, name, date_last, representative_picture_id, comment, nb_images
    3636  FROM '.CATEGORIES_TABLE.'
    3737  WHERE id_uppercat '.
     
    9999        'picture' => $image_id,
    100100        'name' => $row['name'],
    101         'date_last' => @$row['date_last']
     101        'date_last' => @$row['date_last'],
     102        'comment' => @$row['comment'],
     103        'nb_images' => $row['nb_images'],
    102104        )
    103105      );
     
    127129  }
    128130
    129   $template->assign_block_vars('thumbnails', array());
    130   // first line
    131   $template->assign_block_vars('thumbnails.line', array());
    132   // current row displayed
    133   $row_number = 0;
     131  $template->assign_block_vars('categories', array());
    134132 
    135133  foreach ($cat_thumbnails as $item)
    136134  {
    137135    $template->assign_block_vars(
    138       'thumbnails.line.thumbnail',
     136      'categories.category',
    139137      array(
    140         'IMAGE'       => $images[$item['picture']],
    141         'IMAGE_ALT'   => $item['name'],
    142         'IMAGE_TITLE' => $lang['hint_category'],
    143         'IMAGE_TS'    => get_icon(@$item['date_last']),
     138        'SRC'   => $images[$item['picture']],
     139        'ALT'   => $item['name'],
     140        'TITLE' => $lang['hint_category'],
     141        'ICON'  => get_icon(@$item['date_last']),
    144142       
    145         'U_IMG_LINK' => make_index_url(
     143        'URL' => make_index_url(
    146144          array(
    147145            'category' => $item['category'],
    148146            )
    149147          ),
    150         'CLASS'       => 'thumbCat',
     148        'NAME' => $item['name'],
     149        'NB_IMAGES' => $item['nb_images'],
     150        'DESCRIPTION' => @$item['comment'],
    151151        )
    152152      );
    153    
    154     $template->assign_block_vars(
    155       'thumbnails.line.thumbnail.category_name',
    156       array(
    157         'NAME' => $item['name']
    158         )
    159       );
    160    
    161     // create a new line ?
    162     if (++$row_number == $user['nb_image_line'])
    163     {
    164       $template->assign_block_vars('thumbnails.line', array());
    165       $row_number = 0;
    166     }
    167153  }
    168154}
Note: See TracChangeset for help on using the changeset viewer.