"; echo "  ".date("j")." ".$nazwa[$miesiac]." ".date("Y"); echo ", ".$dzienroku." dzień roku"; echo "
"; ### $latitude=51.48; #if not set use test variable $longitude=-15.43; #if not set use test variable $timezone=-1; #if not set use test variable $yday=date("z"); $mon=date("n"); $mday=date("j"); $year=date("Y"); function _strtotime($czasik) { $p1=strpos($czasik,".",0); $p2=strpos($czasik,".",$p1+1); $dzien=substr($czasik,0,$p1); $miesiac=substr($czasik,$p1+1,$p2-($p1+1)); $rok=substr($czasik,$p2+1,strlen($czasik)-($p2+1)); settype($dzien,"integer"); settype($miesiac,"integer"); settype($rok,"integer"); return mktime (0,0,0,$miesiac,$dzien,$rok); } function jd_to_greg($julian) { $julian = $julian - 1721119; $calc1 = 4 * $julian - 1; $year = floor($calc1 / 146097); $julian = floor($calc1 - 146097 * $year); $day = floor($julian / 4); $calc2 = 4 * $day + 3; $julian = floor($calc2 / 1461); $day = $calc2 - 1461 * $julian; $day = floor(($day + 4) / 4); $calc3 = 5 * $day - 3; $month = floor($calc3 / 153); $day = $calc3 - 153 * $month; $day = floor(($day + 5) / 5); $year = 100 * $year + $julian; if ($month < 10) { $month = $month + 3; } else { $month = $month - 9; $year = $year + 1; } return "$day.$month.$year"; } //Returns an array with all the phases of the moon for a whole year function CalculateMoonPhases( $Y ) { //Converted from Basic by Roger W. Sinnot, Sky & Telescope, March 1985. //Converted from javascript by Are Pedersen 2002 //Javascript found at http://www.stellafane.com/moon_phase/moon_phase.htm global $pelnia,$pelnia2,$pelnia3,$pelnia4; $vb=0;$vc=0; $R1 = 3.14159265 / 180; $U = false; $s = ""; // Formatted Output String $K0 = intval(($Y-1900)*12.3685); $T = ($Y-1899.5) / 100; $T2 = $T*$T; $T3 = $T*$T*$T; $J0 = 2415020 + 29*$K0; $F0 = 0.0001178*$T2 - 0.000000155*$T3; $F0 += (0.75933 + 0.53058868*$K0); $F0 -= (0.000837*$T + 0.000335*$T2); //X In the Line Below, F is not yet initialized, and J is not used before it set in the FOR loop. //X J += intval(F); F -= INT(F); //X Ken Slater, 2002-Feb-19 on advice of Pete Moore of Houston, TX $M0 = $K0*0.08084821133; $M0 = 360*($M0 - intval($M0)) + 359.2242; $M0 -= 0.0000333*T2; $M0 -= 0.00000347*T3; $M1 = $K0*0.07171366128; $M1 = 360*($M1 - intval($M1)) + 306.0253; $M1 += 0.0107306*$T2; $M1 += 0.00001236*$T3; $B1 = $K0*0.08519585128; $B1 = 360*($B1 - intval($B1)) + 21.2964; $B1 -= 0.0016528*$T2; $B1 -= 0.00000239*$T3; for ( $K9=0; $K9 <= 28; $K9=$K9+0.5 ) { $J = $J0 + 14*$K9; $F = $F0 + 0.765294*$K9; $K = $K9/2; $M5 = ($M0 + $K*29.10535608)*$R1; $M6 = ($M1 + $K*385.81691806)*$R1; $B6 = ($B1 + $K*390.67050646)*$R1; $F -= 0.4068*sin($M6); $F += (0.1734 - 0.000393*$T)*sin($M5); $F += 0.0161*sin(2*$M6); $F += 0.0104*sin(2*$B6); $F -= 0.0074*sin($M5 - $M6); $F -= 0.0051*sin($M5 + $M6); $F += 0.0021*sin(2*$M5); $F += 0.0010*sin(2*$B6-$M6); $F += 0.5 / 1440; //Adds 1/2 minute for proper rounding to minutes per Sky & Tel article $J += intval($F); $F -= intval($F); //Convert from JD to Calendar Date $julian=$J+round($F); $s = jd_to_greg ($julian); //half K if (($K9-floor($K9))>0){ if (!$U){ //New half $phases[$s]="ny2"; }else{ //Full half $phases[$s]="ne2"; } }else{ //full K if ( !$U ){ $phases[$s]="ny"; $czasik=_strtotime($s); if ($vb==1) {$pelnia3=$czasik; $vb=2;} if ($czasik<=time()) {$pelnia=$czasik; $vb=1;} }else{ $phases[$s]="ne"; $czasik=_strtotime($s); if ($vc==1) {$pelnia4=$czasik; $vc=2;} if ($czasik<=time()) {$pelnia2=$czasik; $vc=1;} } $U = !$U; } } // Next return $phases; } //End MoonPhase function GetMoonPhase($timestamp){ static $moon_phases; if (count($moon_phases)==0) $moon_phases=CalculateMoonPhases(date("Y",$timestamp)); $day=date("n/j/Y",$timestamp); return $moon_phases[$day]; } function is_daylight_time($time) { list($dom, $dow, $month, $hour, $min) = explode(":", date("d:w:m:H:i", $time )); if ($month > 4 && $month < 10) { $retval = 1; # May thru September } elseif ($month == 4 && $dom > 7) { $retval = 1; # After first week in April } elseif ($month == 4 && $dom <= 7 && $dow == 0 && $hour >= 2) { $retval = 1; # After 2am on first Sunday ($dow=0) in April } elseif ($month == 4 && $dom <= 7 && $dow != 0 && ($dom-$dow > 0)) { $retval = 1; # After Sunday of first week in April } elseif ($month == 10 && $dom < 25) { $retval = 1; # Before last week of October } elseif ($month == 10 && $dom >= 25 && $dow == 0 && $hour < 2) { $retval = 1; # Before 2am on last Sunday in October } elseif ($month == 10 && $dom >= 25 && $dow != 0 && ($dom-24-$dow < 1 ) ) { $retval = 1; # Before Sunday of last week in October } else { $retval = 0; } return($retval); } $DST=is_daylight_time(date(U)); if ($DST) {$timezone = ($timezone + 1);} if ($timezone == "13") {$timezone = "-11";} $A = 1.5708; $B = 3.14159; $C = 4.71239; $D = 6.28319; $E = 0.0174533 * $latitude; $F = 0.0174533 * $longitude; $G = 0.261799 * $timezone; # For astronomical twilight, use R = -.309017 # For nautical twilight, use R = -.207912 # For civil twilight, use R = -.104528 # For sunrise or sunset, use R = -.0145439 $R = -.0145439; for ($i = 0; $i < 2; $i++) { if (!$i) {$J = $A; $type = "wschód";} # calculate sunrise else {$J = $C; $type = "zachód"; } # calculate sunset $K = $yday + (($J - $F) / $D); $L = ($K * .017202) - .0574039; # Solar Mean Anomoly $M = $L + .0334405 * sin($L); # Solar True Longitude $M += 4.93289 + (3.49066E-04) * sin(2 * $L); # Quadrant Determination if ($D == 0) {echo "Trying to normalize with zero offset..."; exit;} while ($M < 0) {$M = ($M + $D);} while ($M >= $D) {$M = ($M - $D);} if (($M / $A) - intval($M / $A) == 0) {$M += 4.84814E-06;} $P = sin($M) / cos($M); # Solar Right Ascension $P = atan2(.91746 * $P, 1); # Quadrant Adjustment if ($M > $C) {$P += $D;} else {if ($M > $A) {$P += $B;} } $Q = .39782 * sin($M); # Solar Declination $Q = $Q / sqrt(-$Q * $Q + 1); # This is how the original author wrote it! $Q = atan2($Q, 1); $S = $R - (sin($Q) * sin($E)); $S = $S / (cos($Q) * cos($E)); if (abs($S) > 1) {echo 'none';} # Null phenomenon $S = $S / sqrt(-$S * $S + 1); $S = $A - atan2($S, 1); if ($type == 'wschód') {$S = $D - $S ;} $T = $S + $P - 0.0172028 * $K - 1.73364; # Local apparent time $U = $T - $F; # Universal timer $V = $U + $G; # Wall clock time # Quadrant Determination if ($D == 0) {echo "Trying to normalize with zero offset..."; exit;} while ($V < 0) {$V = ($V + $D);} while ($V >= $D) {$V = ($V - $D);} $V = $V * 3.81972; $hour = intval($V); $min = intval((($V - $hour) * 60) + 0.5); echo "$type: "; echo date( "g:i A", mktime($hour,$min,0,$mon,$mday,$year) ); echo ", "; } ### echo "
"; echo "Imieniny: "; $skad = "/home/archaniol/public_html/kal/".$miesiac1.".txt"; @$pliczek=fopen($skad,"r"); if ($pliczek) { for ($i=1; $i<=$dzien; $i++) { $imie=fgets($pliczek,100); } echo $imie; fclose($pliczek); } echo "

"; #faza ksiezyca; $moon=GetMoonPhase(time()); $aktualny=time()-$pelnia; $dni=(int) ($aktualny/(3600*24)); echo ""; echo "
pełnia: ".date("d.m.Y",$pelnia4)."
"; echo "nów: ".date("d.m.Y",$pelnia3); ### echo "
"; echo "

"; echo ""; if ($button == 1) { echo "
Historia
Skrót historyczny
Idea wybudowania kościoła
Kościół od 1597-1945
Kalendarium z okresu 50-lecia
Inwestycje i remonty
Gazety o parafii
Powrót

"; } else { echo "\n"; echo ""; } if ($button == 2) { echo "
Zabytki
Rzeźby
Obrazy
Ołtarze
Dzwony
Witraże
Zasoby zakrystii
Droga Krzyżowa
Naczynia mszalne
Powrót

"; } else { echo "\n"; echo ""; } if ($button == 3) { echo "
Ludzie
Proboszczowie
Księża
Grupy religijne
Kościelni
Organiści
Galeria
Powrót

"; } else { echo "\n"; echo ""; } echo "\n"; echo "