Et oui, petit oublie de ma part... faud aussi modifier une portion de code d'un fichier
Bon voici la marche à suivre :
-> ouvrir le fichier piCal.php se trouvant dans le dossier class de piCal
-> aux alentours de la ligne 496, tu doit avoir la fonction : function get_mini_calendar_html( $get_target = '' , $query_string = '' , $mode = '' )
----> supprime tout le contenu de celle ci, tu dervai allez vers la ligne 669
----> met tout le code qui suit à la place :
function get_mini_calendar_html( $get_target = '' , $query_string = '' , $mode = '' )
{
// ¼Â¹Ô»þ´Ö·×¬¥¹¥¿¡¼¥È
// list( $usec , $sec ) = explode( " " , microtime() ) ;
// $picalstarttime = $sec + $usec ;
// $PHP_SELF = $_SERVER['SCRIPT_NAME'] ;
// if( $get_target == '' ) $get_target = $PHP_SELF ;
$original_level = error_reporting( E_ALL ^ E_NOTICE ) ;
require_once( "$this->base_path/include/patTemplate.php" ) ;
$tmpl = new PatTemplate() ;
$tmpl->setBasedir( "$this->images_path" ) ;
// ɽ¼¨¥â¡¼¥É¤Ë±þ¤¸¤Æ¡¢¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ò¿¶¤êʬ¤±
switch( $mode ) {
case 'NO_YEAR' :
// ǯ´Öɽ¼¨ÍÑ
$tmpl->readTemplatesFromFile( "minical_for_yearly.tmpl.html" ) ;
$target_highlight_flag = false ;
break ;
case 'NO_NAVIGATE' :
// ·î´Ö¤Î²¼Éô»²¾ÈÍÑ
$tmpl->readTemplatesFromFile( "minical_for_monthly.tmpl.html" ) ;
$target_highlight_flag = false ;
break ;
default :
// Ä̾ï¤Î¥ß¥Ë¥«¥ì¥ó¥À¡¼¥Ö¥í¥Ã¥¯ÍÑ
$tmpl->readTemplatesFromFile( "minical.tmpl.html" ) ;
$target_highlight_flag = true ;
break ;
}
// Åö·î¤Î³ÆÆü¤¬¥¤¥Ù¥ó¥È¤ò»ý¤Ã¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¼èÆÀ
$event_dates = $this->get_flags_date_has_events( mktime(0,0,0,$this->month,1,$this->year) , mktime(0,0,0,$this->month+1,1,$this->year) ) ;
// Á°·î¤Ï·îËö¡¢Íâ·î¤Ï·î½é¤È¤¹¤ë
$prev_month = date("Y-n-j", mktime(0,0,0,$this->month,0,$this->year));
$next_month = date("Y-n-j", mktime(0,0,0,$this->month+1,1,$this->year));
// $tmpl->addVar( "WholeBoard" , "PHP_SELF" , '' ) ;
$tmpl->addVar( "WholeBoard" , "GET_TARGET" , $get_target ) ;
$tmpl->addVar( "WholeBoard" , "QUERY_STRING" , $query_string ) ;
$tmpl->addVar( "WholeBoard" , "MB_PREV_MONTH" , _PICAL_MB_PREV_MONTH ) ;
$tmpl->addVar( "WholeBoard" , "MB_NEXT_MONTH" , _PICAL_MB_NEXT_MONTH ) ;
$tmpl->addVar( "WholeBoard" , "MB_LINKTODAY" , _PICAL_MB_LINKTODAY ) ;
$tmpl->addVar( "WholeBoard" , "SKINPATH" , $this->images_url ) ;
$tmpl->addVar( "WholeBoard" , "FRAME_CSS" , $this->frame_css ) ;
// $tmpl->addVar( "WholeBoard" , "YEAR" , $this->year ) ;
// $tmpl->addVar( "WholeBoard" , "MONTH" , $this->month ) ;
$tmpl->addVar( "WholeBoard" , "MONTH_NAME" , $this->month_middle_names[ $this->month ] ) ;
$tmpl->addVar( "WholeBoard" , "YEAR_MONTH_TITLE" , sprintf( _PICAL_FMT_YEAR_MONTH , $this->year , $this->month_middle_names[ $this->month ] ) ) ;
$tmpl->addVar( "WholeBoard" , "PREV_MONTH" , $prev_month ) ;
$tmpl->addVar( "WholeBoard" , "NEXT_MONTH" , $next_month ) ;
$tmpl->addVar( "WholeBoard" , "CALHEAD_BGCOLOR" , $this->calhead_bgcolor ) ;
$tmpl->addVar( "WholeBoard" , "CALHEAD_COLOR" , $this->calhead_color ) ;
$first_date = getdate(mktime(0,0,0,$this->month,1,$this->year));
$date = ( - $first_date['wday'] + $this->week_start - 7 ) % 7 ;
$wday_end = 7 + $this->week_start ;
// ÍËÆü̾¥ë¡¼¥×
$rows = array() ;
for( $wday = $this->week_start ; $wday < $wday_end ; $wday ++ ) {
if( $wday % 7 == 0 ) {
// Sunday
$bgcolor = $this->sunday_bgcolor ;
$color = $this->sunday_color ;
$typeofday = "weekday-name-sunday";
} elseif( $wday == 6 ) {
// Saturday
$bgcolor = $this->saturday_bgcolor ;
$color = $this->saturday_color ;
$typeofday = "weekday-name-saturday";
} else {
// Weekday
$bgcolor = $this->weekday_bgcolor ;
$color = $this->weekday_color ;
$typeofday = "weekday-name";
}
// ¥Æ¥ó¥×¥ì¡¼¥ÈÍÑÇÛÎó¤Ø¤Î¥Ç¡¼¥¿¥»¥Ã¥È
array_push( $rows , array(
"BGCOLOR" => $bgcolor ,
"COLOR" => $color ,
"DAYNAME" => $this->week_short_names[ $wday % 7 ] ,
"TYPEOFDAY" => $typeofday
) ) ;
}
// ¥Æ¥ó¥×¥ì¡¼¥È¤Ë¥Ç¡¼¥¿¤òËä¤á¹þ¤à
$tmpl->addRows( "DayNameLoop" , $rows ) ;
$tmpl->parseTemplate( "DayNameLoop" , 'w' ) ;
// ½µ (row) ¥ë¡¼¥×
for( $week = 0 ; $week < 6 ; $week ++ ) {
$rows = array() ;
// Æü (col) ¥ë¡¼¥×
for( $wday = $this->week_start ; $wday < $wday_end ; $wday ++ ) {
$date ++ ;
if( ! checkdate($this->month,$date,$this->year) ) {
// ·î¤ÎÈϰϳ°
array_push( $rows , array(
"GET_TARGET" => $get_target ,
"QUERY_STRING" => $query_string ,
"SKINPATH" => $this->images_url ,
"DATE" => date( 'j' , mktime( 0 , 0 , 0 , $this->month , $date , $this->year ) ) ,
"DATE_TYPE" => 0
) ) ;
continue ;
}
$link = "$this->year-$this->month-$date" ;
// ÍËÆü¥¿¥¤¥×¤Ë¤è¤ëÉÁ²è¿§¿¶¤êʬ¤±
if( isset( $this->holidays[$link] ) ) {
// Holiday
$bgcolor = $this->holiday_bgcolor ;
$color = $this->holiday_color ;
$typeofday = "weekday-holiday";
} elseif( $wday % 7 == 0 ) {
// Sunday
$bgcolor = $this->sunday_bgcolor ;
$color = $this->sunday_color ;
$typeofday = "weekday-sunday";
} elseif( $wday == 6 ) {
// Saturday
$bgcolor = $this->saturday_bgcolor ;
$color = $this->saturday_color ;
$typeofday = "weekday-saturday";
} else {
// Weekday
$bgcolor = $this->weekday_bgcolor ;
$color = $this->weekday_color ;
$typeofday = "weekday";
}
// ÁªÂòÆü¤ÎÇØ·Ê¿§¥Ï¥¤¥é¥¤¥È½èÍý
if( $date == $this->date && $target_highlight_flag ) $bgcolor = $this->targetday_bgcolor ;
// ¥Æ¥ó¥×¥ì¡¼¥ÈÍÑÇÛÎó¤Ø¤Î¥Ç¡¼¥¿¥»¥Ã¥È
array_push( $rows , array(
"GET_TARGET" => $get_target ,
"QUERY_STRING" => $query_string ,
"BGCOLOR" => $bgcolor ,
"COLOR" => $color ,
"LINK" => $link ,
"DATE" => $date ,
"DATE_TYPE" => $event_dates[ $date ] + 1,
"TYPEOFDAY" => $typeofday
) ) ;
}
// ¥Æ¥ó¥×¥ì¡¼¥È¤Ë¥Ç¡¼¥¿¤òËä¤á¹þ¤à
$tmpl->addRows( "DailyLoop" , $rows ) ;
$tmpl->parseTemplate( "DailyLoop" , 'w' ) ;
$tmpl->parseTemplate( "WeekLoop" , 'a' ) ;
}
$ret = $tmpl->getParsedTemplate() ;
error_reporting( $original_level ) ;
// ¼Â¹Ô»þ´ÖµÏ¿
// list( $usec , $sec ) = explode( " " , microtime() ) ;
// error_log( "MiniCalendar " . ( $sec + $usec - $picalstarttime ) . "sec." , 0 ) ;
return $ret ;
}
Là ça devrait être bon, mais je te conseille de le tester en local d'abord et de vider ton cache.
PS : partie du code péché dans ma modif de piCal, aucune garantie pour le moment.