From e44f0b01549d3a52c5b261767c6531044d09a1a1 Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 8 Nov 2006 03:01:28 +0000 Subject: - merge category_recent_cats and category_subcats into category_cats (a lot of common code,and now representative selection works for recent cats...) - some replacements of get_thumbnail_src with get_thumbnail_url git-svn-id: http://piwigo.org/svn/trunk@1597 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/category_recent_cats.inc.php | 162 ----------------------------------- 1 file changed, 162 deletions(-) delete mode 100644 include/category_recent_cats.inc.php (limited to 'include/category_recent_cats.inc.php') diff --git a/include/category_recent_cats.inc.php b/include/category_recent_cats.inc.php deleted file mode 100644 index 6d4cf86f3..000000000 --- a/include/category_recent_cats.inc.php +++ /dev/null @@ -1,162 +0,0 @@ - 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 ); - -if ($conf['subcatify']) -{ - $template->set_filenames( - array( - 'mainpage_categories' => 'mainpage_categories.tpl', - ) - ); - - // template thumbnail initialization - if (mysql_num_rows($result) > 0) - { - $template->assign_block_vars('categories', array()); - } - - $comment = null; - if (isset($row['comment'])) - { - $comment = strip_tags($row['comment'], '

'); - } - - // for each category, we have to search a recent picture to display and - // the name to display - while ( $row = mysql_fetch_array( $result ) ) - { - $template->assign_block_vars( - 'categories.category', - array( - 'SRC' => get_thumbnail_src($row['path'], @$row['tn_ext']), - 'ALT' => $row['file'], - 'TITLE' => $lang['hint_category'], - - 'URL' => make_index_url( - array( - 'category' => $row['category_id'], - 'cat_name' => $row['cat_name'], - ) - ), - 'NAME' => get_cat_display_name_cache($row['uppercats'], null, false), - 'CAPTION_NB_IMAGES' => (($row['nb_images'] == 0) ? '' : sprintf("%d ".l10n('pictures'), $row['nb_images'])), - 'DESCRIPTION' => $comment, - ) - ); - } - - $template->assign_var_from_handle('CATEGORIES', 'mainpage_categories'); -} -else -{ - $template->set_filenames( array( 'thumbnails' => 'thumbnails.tpl',)); - // 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 ) ) - { - $template->assign_block_vars( - 'thumbnails.line.thumbnail', - array( - 'IMAGE' => get_thumbnail_src($row['path'], @$row['tn_ext']), - 'IMAGE_ALT' => $row['file'], - 'IMAGE_TITLE' => $lang['hint_category'], - - 'U_IMG_LINK' => make_index_url( - array( - 'category' => $row['category_id'], - 'cat_name' => $row['cat_name'], - ) - ), - ) - ); - - $template->assign_block_vars( - 'thumbnails.line.thumbnail.category_name', - array( - 'NAME' => get_cat_display_name_cache($row['uppercats'], null, false), - ) - ); - - // 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; - $template->assign_var_from_handle('THUMBNAILS', 'thumbnails'); -} -?> \ No newline at end of file -- cgit v1.2.3