diff --git a/export.php b/export.php index a6a7f733a..12186f290 100644 --- a/export.php +++ b/export.php @@ -19,7 +19,7 @@ $datem = date ( 'm' ); $dateY = date ( 'Y' ); -$yearAgo = time () - 365 * 24 * 3600; +$yearAgo = time () - 31536000; // 365 * 24 * 3600; $dateYearAgo = date('Ymd', $yearAgo); $selected = ' selected '; diff --git a/import_outlookcsv.php b/import_outlookcsv.php index b166c0dda..d4315fd70 100644 --- a/import_outlookcsv.php +++ b/import_outlookcsv.php @@ -78,7 +78,7 @@ function parse_outlookcsv ( $cal_file ) { } function dateDifference ( $start_timestamp, $end_timestamp, $unit = 0 ) { - $days_seconds_star = ( 23 * 56 * 60 ) + 4.091; // Star Day + $days_seconds_star = 77284.091; // Star Day ( 23 * 56 * 60 ) + 4.091 $days_seconds_sun = 86400; // Sun Day $difference_seconds = $end_timestamp - $start_timestamp; switch ( $unit ) { diff --git a/includes/classes/Doc.php b/includes/classes/Doc.php index a37806e04..0394168cf 100644 --- a/includes/classes/Doc.php +++ b/includes/classes/Doc.php @@ -19,42 +19,42 @@ */ class Doc { /** - * The unique id + * The unique id * @var int * @access private */ var $_blob_id; /** - * Associated event's id (if any) + * Associated event's id (if any) * @var int * @access private */ var $_event_id; /** - * The user login of user who created this Doc + * The user login of user who created this Doc * @var string * @access private */ var $_login; /** - * Filename of the doc (not used for comments) + * Filename of the doc (not used for comments) * @var string * @access private */ var $_name; /** - * The description of the doc + * The description of the doc * @var string * @access private */ var $_description; /** - * The size of the doc (in bytes) + * The size of the doc (in bytes) * (not used for comments) * @var int * @access private @@ -62,28 +62,28 @@ class Doc { var $_size; /** - * The MIME type of the doc + * The MIME type of the doc * @var string * @access private */ var $_mime_type; /** - * Type of object (C=Comment, A=Attachment) + * Type of object (C=Comment, A=Attachment) * @var string * @access private */ var $_type; /** - * Date last modified (in YYYYMMDD format) + * Date last modified (in YYYYMMDD format) * @var int * @access private */ var $_mod_date; /** - * Time last modified (in HHMMSS format) + * Time last modified (in HHMMSS format) * @var int * @access private */ @@ -314,7 +314,7 @@ function getSummary ($target='') { if ( $this->_size < 1024 ) $ret .= $this->_size . ' ' . translate ( 'bytes' ); else - if ( $this->_size < 1024 * 1024 ) + if ( $this->_size < 1048576 ) // 1024 * 1024 $ret .= sprintf ( " %.1f", ( $this->_size / 1024 ) ) . translate ( 'kb' ); else $ret .= sprintf ( " %.1f", ( $this->_size / 1048576 ) ) . translate ( 'Mb' ); diff --git a/includes/functions.php b/includes/functions.php index d3d6f8e39..22d9a0393 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -2581,9 +2581,9 @@ function get_groups($user, $includeUserlist=false) $res = dbi_execute($sql, [$groups[$i]['cal_group_id']]); while ($row = dbi_fetch_row($res)) { if (isset($users_by_name[$row[0]])){ - // It is possible some users assigned to this group may not exist, - // so we skip those that don't. For example, if users are fetched - // from an external source via user-app-*.php, and one of those + // It is possible some users assigned to this group may not exist, + // so we skip those that don't. For example, if users are fetched + // from an external source via user-app-*.php, and one of those // users is deleted externally. $users[] = $users_by_name[$row[0]]; } @@ -3426,8 +3426,8 @@ function getReminders ( $id, $display = false ) { $d = $h = $minutes = 0; if ( $reminder['offset'] > 0 ) { $minutes = $reminder['offset']; - $d = intval ( $minutes / (24*60) ); - $minutes -= ( $d * (24*60) ); + $d = intval ( $minutes / 1440 ); // (24*&60) + $minutes -= ( $d * 1440 ); // (24*60) $h = intval ( $minutes / 60 ); $minutes -= ( $h * 60 ); } diff --git a/includes/moon_phases.php b/includes/moon_phases.php index d822f2b97..3c08b065b 100644 --- a/includes/moon_phases.php +++ b/includes/moon_phases.php @@ -23,15 +23,15 @@ function calculateMoonPhases ( $year, $month = 1 ) { $U = false; $K0 = intval ( ( $year - 1900 ) * 12.3685 ) + ( $month - 1 ); - $R1 = 3.14159265 / 180; - $T = ( $year - 1899.5 ) / 100; + $R1 = 0.0174532925; // [pi] 3.14159265 / 180 + $T = ( $year - 1899.5 ) / 100; $T2 = $T * $T; $T3 = $T2 * $T; - $J0 = 2415020 + 29 * $K0; + $J0 = 29 * $K0 + 2415020; $F0 = ( ( 0.0001178 * $T2 - 0.000000155 * $T3 ) + - ( 0.75933 + 0.53058868 * $K0 ) - + ( 0.53058868 * $K0 + 0.75933 ) - ( 0.000837 * $T + 0.000335 * $T2 ) ); $M0 = $K0 * 0.08084821133; @@ -53,14 +53,14 @@ function calculateMoonPhases ( $year, $month = 1 ) { ( 0.00000239 * $T3 ) ); for ( $K9 = 0; $K9 < 7; $K9 += 0.5 ) { - $J = $J0 + 14 * $K9; + $J = 14 * $K9 + $J0; $K = $K9 / 2; - $B6 = ( $B1 + $K * 390.67050646 ) * $R1; - $M5 = ( $M0 + $K * 29.10535608 ) * $R1; - $M6 = ( $M1 + $K * 385.81691806 ) * $R1; + $B6 = ( $K * 390.67050646 + $B1 ) * $R1; + $M5 = ( $K * 29.10535608 + $M0 ) * $R1; + $M6 = ( $K * 385.81691806 + $M1 ) * $R1; - $F = ( ( $F0 + 0.765294 * $K9 ) - + $F = ( ( 0.765294 * $K9 + $F0 ) - ( 0.4068 * sin ( $M6 ) ) + ( ( 0.1734 - 0.000393 * $T ) * sin ( $M5 ) ) + ( 0.0161 * sin ( 2 * $M6 ) ) + @@ -73,7 +73,7 @@ function calculateMoonPhases ( $year, $month = 1 ) { $J += intval ( $F ); $F -= intval ( $F ); - //. + // Convert from JD to Calendar Date. $julian = $J + round ( $F ); $s = ( function_exists ( 'jdtogregorian' ) diff --git a/search.php b/search.php index 89cc5076a..7a9af3518 100644 --- a/search.php +++ b/search.php @@ -92,8 +92,8 @@ '; } if ($show_advanced) { - $startDateYmd = date('Ymd', time() - (90 * 24 * 3600)); // 90 days ago - $endDateYmd = date('Y-m-d', time() + (90 * 24 * 3600)); // 90 days from now + $startDateYmd = date ( 'Ymd', time() - 7776000 ); // 90 days ago + $endDateYmd = date ( 'Y-m-d', time() + 7776000 ); // 90 days from now echo '