this is a script that shows you an archive of news by years, months.. but, on October the script won't show the true results, it shows only Year and nothing else.. if someone see what is wrong in there, please tell me,...
Thankyou very much
#code_start#
function display_archive () {
global $PHP_SELF;
$months = array( 'Januar', 'Februar', 'Marec', 'April', 'Maj', 'Junij', 'Julij', 'Avgust', 'September', 'Oktober', 'November', 'December' );
echo '<ul>'."\n";
for ($year = 2001; $year <= date('Y'); $year++) {
echo '<li>'.$year.'</li>'."\n";
echo '<ul>'."\n";
for ($month = 0; $month <= 11; $month++) {
$_m = $month+1;
$query = "select NEWSID from NEWS WHERE YEAR(DATUM) = $year AND MONTH(DATUM) = $_m";
$count = mysql_num_rows(mysql_query($query));
if ($count > 0) {
echo '<li><A href="'.$PHP_SELF.'?l='.$year.'&m='.($month + 1).'" title="Number od news in this month: '.$count.'">'.$months[$month].'</a></li>'."\n";
}
if ($year.'.'.($month+1) == date('Y.n')) $month = 12;
}
echo '</ul>'."\n";
}
echo '</ul>'."\n";
}
#code_end#