SUBDATE(CURRENT_DATE ,INTERVAL '.$user['recent_period'].' DAY)'; if ( $user['forbidden_categories'] != '' ) { $query.= ' AND c.id NOT IN ('.$user['forbidden_categories'].')'; } $query.= ' ;'; $result = pwg_query( $query ); // template thumbnail initialization if (mysql_num_rows($result) > 0) { $template->assign_block_vars('thumbnails', array()); // first line $template->assign_block_vars('thumbnails.line', array()); // current row displayed $row_number = 0; } $old_level_separator = $conf['level_separator']; $conf['level_separator'] = '
'; // for each category, we have to search a recent picture to display and // the name to display while ( $row = mysql_fetch_array( $result ) ) { $name = get_cat_display_name_cache($row['uppercats'], '', false); $thumbnail_src = get_thumbnail_src($row['path'], @$row['tn_ext']); $url_link = PHPWG_ROOT_PATH.'category.php?cat='.$row['category_id']; $template->assign_block_vars( 'thumbnails.line.thumbnail', array( 'IMAGE' => $thumbnail_src, 'IMAGE_ALT' => $row['file'], 'IMAGE_TITLE' => $lang['hint_category'], 'U_IMG_LINK' => add_session_id($url_link) ) ); $template->assign_block_vars( 'thumbnails.line.thumbnail.category_name', array( 'NAME' => $name ) ); // create a new line ? if (++$row_number == $user['nb_image_line']) { $template->assign_block_vars('thumbnails.line', array()); $row_number = 0; } } $conf['level_separator'] = $old_level_separator; ?>