--- month.module 2007-04-25 09:04:32.000000000 +0200 +++ month2.module 2007-06-13 15:51:54.000000000 +0200 @@ -56,19 +56,23 @@ // plus one is the easiest way to find out if you need a "more" link $block['subject'] = t('Monthly Archives'); if($_month_config['month_include_node_type']) { - $month_max_block_links = $_month_config['month_block_link_max']; - if (empty($month_max_block_links)) $month_max_block_links=99; + $month_max_block_links = $_month_config['month_block_link_max'] + 1; $query = month_links_query($_month_config['month_include_node_type'], $_month_config['month_rev_chronsort'], $month_max_block_links); $monthlist = db_query(db_rewrite_sql($query, 'n', 'nid')); if (db_num_rows($monthlist) >= $month_max_block_links) { - $morelink = ''; + $morelink = ''; } $block_content = array(); $listed_links = 0; - while (($listed_links < $month_max_block_links) && $month = db_fetch_object($monthlist)) { + while (($listed_links < $_month_config['month_block_link_max']) && $month = db_fetch_object($monthlist)) { $listed_links += 1; $month_start = mktime(0,0,0,substr($month->monthno, 5, 2),1,substr($month->monthno, 0, 4)); - $block_content[] = l(date('F Y',$month_start).' ('.$month->nodenum.')', + if (!$_month_config['month_hide_counter']) { + $block_content[] = l(t(date('F',$month_start)).date(' y',$month_start).' ('.$month->nodenum.')', 'month/'.date('Y/m',$month_start)); + } else { + $block_content[] = l(t(date('F',$month_start)).date(' y',$month_start), + 'month/'.date('Y/m',$month_start)); + } } $block['content'] = theme('item_list', $block_content) . $morelink; return $block; @@ -113,6 +117,13 @@ '#return_value' => 1, '#default_value' => $_month_config['month_paginate'], '#description' => t('If checked the output will be split into pages. The number of posts will respect the global nodes per page setting.')); + + $output['month_hide_counter'] = array( + '#type' => 'checkbox', + '#title' => t('Hide node counter'), + '#return_value' => 1, + '#default_value' => $_month_config['month_hide_counter'], + '#description' => t('If checked counter per month will be hidden.')); return $output; } @@ -122,6 +133,7 @@ $_month_config['month_rev_chronsort'] = $edit['month_rev_chronsort']; $_month_config['month_rev_pagesort'] = $edit['month_rev_pagesort']; $_month_config['month_paginate'] = $edit['month_paginate']; + $_month_config['month_hide_counter'] = $edit['month_hide_counter']; variable_set('month_config', $_month_config); } } @@ -182,7 +194,7 @@ if ($month_paginate){ $output .= theme('pager', NULL, $_month_config['default_nodes_main'], 0); } - drupal_set_title('Month of '.date('F , Y', $query[1])); + drupal_set_title(t(date('F', $query[1])).date(' Y', $query[1])); // if there's no output, don't let them stare at a blank page $output = $output? $output:t('Sorry, there are no entries for this month.'); // return the output string @@ -205,7 +217,7 @@ } function month_menu() { - $items[] = array('path' => 'month', 'title' => t('Monthly archives'), + $items[] = array('path' => 'month', 'title' => t('monthly archives'), 'callback' => '_month_page', 'type' => MENU_CALLBACK, 'access' => user_access('access content')); return $items;