bonjour,

bonjour,

Voilà le calendrier en question vous pouvez le voir à l'adresse suivante colonne de gauche : http://www.fireworkszone.com/index?a...h&d=2006/01/01

Vous remarquerez que lorsque vous arriverez sur la page vous avez 'January 2006' avec une flèche de navigation à droite (pour aller vers Février) et une flèche de navigation à gauche (pour aller vers Décembre 2005)

Si vous cliquez sur la flèche gauche pour allez vers décembre 2005 et vous vous apercevrez que vous n'avez plus qu'une seule flèche de présente celle de gauche (pour remonter le temps) la droite ayant disparue.

Je souhaiterai pouvoir naviguer entre les années en gardant les 2 flèches de navigation en consultant le code ci-dessous.


Merci de votre aide
<?php
// ----------------------------------------------------------------------------
// MyPHPNews - Le gestionnaire de news
// ----------------------------------------------------------------------------
// Copyright (C) 2001-2002 - Régis GAIDOT - MyPHPSoft (http://www.myphpsoft.net)
// Contact: rgaidot@myphpsoft.net
// ----------------------------------------------------------------------------
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ----------------------------------------------------------------------------
if (!defined("GRAB_GLOBALS_VARS")){
define( "GRAB_GLOBALS_VARS", 1 );
include( "conf/grabglobals_vars.inc.php" );
@require_once($_SERVER['DOCUMENT_ROOT'].'/conf/grabglobals_vars.inc.php');

}
if (!defined("_CONFIG_PHP")){
define( "_CONFIG_PHP", 1 );
@require_once($_SERVER['DOCUMENT_ROOT'].'/conf/cfg.inc.php');

}
if (!defined("_CLASS_DATE")){
define( "_CLASS_DATE", 1 );
@require_once($_SERVER['DOCUMENT_ROOT'].'/conf/class_date.php');

}
if (!defined("_CONFIG_CLASSBD")){
define( "_CONFIG_CLASSBD", 1 );
@require_once($_SERVER['DOCUMENT_ROOT'].'/conf/class_mysql.php');
}
if (!defined("_CACHE_PHP")){
define( "_CACHE_PHP", 1 );
@require_once($_SERVER['DOCUMENT_ROOT'].'/conf/class_cache_scr.php');
}

$var = "act=date&";
$curmonth = date("m");
$curday = date("d");
if(!isset($d)) $d=date("Y/m/d");

$tbdate = explode("/",$d);
$month = (integer) $tbdate[1];
$year = (integer) $tbdate[0];
$day = (integer) $tbdate[2];
$cache = new cache("Calendar".$month."_".$day,$TimeCache,"cache/");
if($cache->isExpered()){
$date = new mydate($day,$month,$year);
$NbDayOfMonth = $date->GetNumDayOfMonth();
$FirstDayOfMonth = date("w",mktime(0,0,1,$month,01,$year));

$genNewsCalendar.= "<div id='calendar'><table border='1' width='100%' cellpadding='0' cellspacing='0'><tr><td>\n";
$genNewsCalendar.= "<table border='0' cellspacing='0' cellpadding='0' >";
$genNewsCalendar.= "<thead><tr>";

if(intval($month)==1){
$genNewsCalendar.= "<td><a href=\"index?act=archmonth&d=".sprintf("%04d/%02d/%02d",$year-1,12,01)."\"><img src='pictures/arrows/left_arrow.gif' width='14' height='14' border='0' alt='".sprintf("%04d/%02d/%02d",$year-1,12,01)."' title='".sprintf("%04d/%02d/%02d",$year-1,12,01)."'/></a></td>";
}else{
$genNewsCalendar.= "<td ><a href=\"index?act=archmonth&d=".sprintf("%04d/%02d/%02d",$year,$month-1,01)."\"><img src='pictures/arrows/left_arrow.gif' width='14' height='14' border='0' alt='".sprintf("%04d/%02d/%02d",$year,$month-1,01)."' title='".sprintf("%04d/%02d/%02d",$year,$month-1,01)."'/></a></td>";
}

$genNewsCalendar.= "<td colspan='5' align=center><b><center><a href=\"index?act=archmonth&d=".sprintf("%04d/%02d/%02d",$year,$month,01)."\" alt=\"$ResStrArchivOfMonth\" title=\"$ResStrArchivOfMonth\"><b>".$date->GetMonthName()." ".$year."</b></a></center></b></td>";

if($curmonth>$month){
if((intval($month)==12)){

$genNewsCalendar.= "<td><a href=\"index?act=archmonth&d=".sprintf("%04d/%02d/%02d",$year,$month,01)."\"><img src='pictures/arrows/right_arrow.gif' width='14' height='14' border='0' alt='".sprintf("%04d/%02d/%02d",$year,$month,01)."' title='".sprintf("%04d/%02d/%02d",$year,$month,01)."'/></a></td>";

}else{

$genNewsCalendar.= "<td ><a href=\"index?act=archmonth&d=".sprintf("%04d/%02d/%02d",$year,$month+1,01)."\"><img src='pictures/arrows/right_arrow.gif' width='14' height='14' border='0' alt='".sprintf("%04d/%02d/%02d",$year,$month+1,01)."' title='".sprintf("%04d/%02d/%02d",$year,$month+1,01)."'/></a></td>";
}
}else $genNewsCalendar.= "<td>&nbsp;</td>";
$genNewsCalendar.= "</tr></thead>\n";
$genNewsCalendar.= "<tr>
<th title='Monday'><acronym title='Monday'>M</acronym></th>
<th ><acronym title='Tuesday'>T</acronym></th>
<th ><acronym title='Wednesday'>W</acronym></th>
<th ><acronym title='Thursday'>T</acronym></th>
<th ><acronym title='Friday'>F</acronym></th>
<th ><acronym title='Saturday'>S</acronym></th>
<th ><acronym title='Sunday'>S</acronym></th>
</tr>\n";

if($FirstDayOfMonth==0) $FirstDayOfMonth=7;
$genNewsCalendar.= "<tr>";

$dbs = new data(0,$MyPHPNewsHote, $MyPHPNewsBase, $MyPHPNewsUser, $MyPHPNewsPass);
if(!$dbs->connect())
die($dbs->error);
if(!$dbs->query("SELECT COUNT(id) AS nb, DATE_FORMAT(date,'%d') as d1, titre FROM ".$MyPHPNewsTBNews." WHERE activ='1' AND date LIKE '".$year."/".sprintf("%02d",$month)."%' GROUP BY d1 ORDER BY date"))
die($dbs->error);
while($dbs->nextrecord()){
$key = $dbs->value("d1");
$arrayofdate[$key] = $dbs->value("nb");
}
for($i=1;$i<$FirstDayOfMonth;$i++)
$genNewsCalendar.= "<td width='20' class='monthdays'>&nbsp;</td>";

$j = $FirstDayOfMonth;
for($i=1;$i<=$NbDayOfMonth;$i++){
$datej = new mydate($i,$month,$year);
$bankday = $datej->isBankHolidays();
$nameofbankday = $datej->GetNameBankHolidays();
if($arrayofdate[sprintf("%02d",$i)]!=0){

$genNewsCalendar.=

"<td class='today' ".(($day==$i) ? "" : "" ).">
<a href=\"?".$var."d=".sprintf("%04d/%02d/%02d",$year,$month,$i)."\" title=\"".$i."/".$curmonth."/".$year."\">".(($day==$i) ? "".$i."" : $i)."</a></td>";

}else{

$genNewsCalendar.= "<td width='20' ".(($day==$i) ?" class='today' " : "" ).">".(($day==$i) ? "".$i."" : $i)."</td>";

}
if($j==7){
if($i<$NbDayOfMonth){
$genNewsCalendar.= "</tr>\n";

$genNewsCalendar.= "<tr class='monthdays'>";
$j = 1;
}
}else{
$j ++;
}
}
$genNewsCalendar.= "</tr>\n";
$genNewsCalendar.= "</table>\n";
$genNewsCalendar.= "</td></tr></table></div>\n";
$cache->SetCache($genNewsCalendar);
}echo $cache->GetCache("Calendar".$month."_".$day);
?>