Fork me on GitHub

Rapport de message :*
 

Re: css piCal !

Titre du sujet : Re: css piCal !
par PinMaster sur 12/06/2006 14:52:16

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_reportingE_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_eventsmktime(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 ) % ;
    
$wday_end $this->week_start ;

    
// ÍËÆü̾¥ë¡¼¥×
    
$rows = array() ;
    for( 
$wday $this->week_start $wday $wday_end $wday ++ ) {
        if( 
$wday == ) { 
            
//    Sunday
            
$bgcolor $this->sunday_bgcolor ;
            
$color $this->sunday_color ;
            
$typeofday "weekday-name-sunday";
        } elseif( 
$wday == ) { 
            
//    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 ] ,
            
"TYPEOFDAY" => $typeofday
        
) ) ;
    }

    
// ¥Æ¥ó¥×¥ì¡¼¥È¤Ë¥Ç¡¼¥¿¤òËä¤á¹þ¤à
    
$tmpl->addRows"DayNameLoop" $rows ) ;
    
$tmpl->parseTemplate"DayNameLoop" 'w' ) ;

    
// ½µ (row) ¥ë¡¼¥×
    
for( $week $week $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$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 == ) { 
                
//    Sunday
                
$bgcolor $this->sunday_bgcolor ;
                
$color $this->sunday_color ;
                
$typeofday "weekday-sunday";
            } elseif( 
$wday == ) { 
                
//    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.
Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

13 Personne(s) en ligne (11 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 13 | Plus ...