if ($_GET['id'])
{
ereg("^([0-9]{4})\/([0-9]{2})",$_GET['id'],$regs);
}
$mois = array(0,31,28,31,30,31,30,31,31,30,31,30,31);
$noms = array(0,
"Janvier",
"Février",
"Mars",
"Avril",
"Mai",
"Juin",
"Juillet",
"Aout",
"Septembre",
"Octobre",
"Novembre",
"Décembre");
$this_month = (empty($regs[2]) ? date(n) : $regs[2]);
$this_year = (empty($regs[2]) ? date(Y) : $regs[1]);
$time = mktime(0,0,0,$this_month,1,$this_year);
$this_month = preg_replace("/0([0-9])/","$1",$this_month);
echo "
$noms[$this_month] $this_year
Di |
Lu |
Ma |
Me |
Je |
Ve |
Sa |
";
for ($i=0; $i\n";
}
for ($num="1"; $num<=$mois[$this_month]; $num++)
{
if (($i % 7) == 0) { echo "
\n\n"; }
echo "\t";
if ($num<10 and $this_month <10) { $athis_month="0".$this_month; $anum = "0".$num; }
elseif ($num<10) { $anum = "0".$num; $athis_mont = $this_month; }
else{ $anum = $num; $athis_mont = $this_month; }
$query = "SELECT * FROM blog WHERE date like '".$this_year.$athis_month.$anum."%' LIMIT 1";
$result = mysql_query($query);
if (mysql_num_rows($result) != 0)
{
echo "$num";
}
else { echo "$num"; }
echo " | ";
$i++;
}
echo "
";
if ($this_year < 2005) {
echo "
$this_year »";
}
else
{ echo "« $this_year »"; }
echo "";
for ($i=1;$i<7;$i++)
{
echo "
0$i ";
}
echo "
";
for ($i=6;$i<13;$i++)
{
if ($i<10) { echo "
0$i "; }
else { echo "
$i "; }
}
$query = "SELECT distinct(section) FROM blog ORDER BY section";
$result = mysql_query($query) or die(mysql_error());
echo "
Catégories";
?>