Plugin Directory

Changeset 3432146


Ignore:
Timestamp:
01/04/2026 03:34:10 PM (7 weeks ago)
Author:
designextreme
Message:

Updated count parameter to 400 days for special opening hours.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • opening-hours/trunk/index.php

    r3390038 r3432146  
    23392339                );
    23402340                sort($closure_timestrings);
    2341                 $day_start_offset = round(($closure_timestrings[0] - $this->offset - $this->today_timestamp)/DAY_IN_SECONDS);
    2342                 $day_end_display_offset = round(($closure_timestrings[1] - $this->offset - $this->today_timestamp)/DAY_IN_SECONDS);
     2341                $day_start_offset = round(($closure_timestrings[0] - $this->offset - $this->today_timestamp) / DAY_IN_SECONDS);
     2342                $day_end_display_offset = round(($closure_timestrings[1] - $this->offset - $this->today_timestamp) / DAY_IN_SECONDS);
    23432343                $day_end_offset = $day_end_display_offset + 1;
    23442344                $closure_date_start = $closure_date_start_display = $this->get_day_timestamp($day_start_offset);
     
    29052905                {
    29062906                    $end = ($end - WEEK_IN_SECONDS - $start > YEAR_IN_SECONDS) ? $start + YEAR_IN_SECONDS + WEEK_IN_SECONDS : $end;
    2907                     $count = ceil(($end - $start)/DAY_IN_SECONDS);
     2907                    $count = ceil(($end - $start) / DAY_IN_SECONDS);
    29082908                }
    29092909                else
    29102910                {
    29112911                    $end = ($end - WEEK_IN_SECONDS - $this->today_timestamp > YEAR_IN_SECONDS) ? $this->today_timestamp + YEAR_IN_SECONDS + WEEK_IN_SECONDS : $end;
    2912                     $count = ceil(($end - $this->today_timestamp)/DAY_IN_SECONDS);
     2912                    $count = ceil(($end - $this->today_timestamp) / DAY_IN_SECONDS);
    29132913                }
    29142914            }
     
    29182918                {
    29192919                    $end = ($end - $start > 31 * DAY_IN_SECONDS) ? $this->today_timestamp + 31 * DAY_IN_SECONDS : $end;
    2920                     $count = ceil(($end - $start)/DAY_IN_SECONDS);
     2920                    $count = ceil(($end - $start) / DAY_IN_SECONDS);
    29212921                }
    29222922                else
    29232923                {
    29242924                    $end = ($end - $this->today_timestamp > 31 * DAY_IN_SECONDS) ? $this->today_timestamp + 31 * DAY_IN_SECONDS : $end;
    2925                     $count = ceil(($end - $this->today_timestamp)/DAY_IN_SECONDS);
     2925                    $count = ceil(($end - $this->today_timestamp) / DAY_IN_SECONDS);
    29262926                }
    29272927            }
     
    29362936        $closed_show = (!isset($closed_show) || isset($closed_show) && $closed_show);
    29372937        $week_start = (isset($week_start) && is_numeric($week_start)) ? (($week_start < 0) ? (($week_start == -2) ? $this->yesterday : $this->today) : $week_start) : $this->week_start;
    2938         $start_modifier = (is_numeric($start) && abs(round(($start - $this->today_timestamp)/DAY_IN_SECONDS)) <= 731) ? round(($start - $this->today_timestamp)/DAY_IN_SECONDS) : 0;
     2938        $start_modifier = (is_numeric($start) && abs(round(($start - $this->today_timestamp) / DAY_IN_SECONDS)) <= 731) ? round(($start - $this->today_timestamp) / DAY_IN_SECONDS) : 0;
    29392939       
    29402940        for ($i = (($start_modifier != 0 || $this->today == $week_start) ? 0 : -7); $i <= ((!$regular && ($special || $closure)) ? 372 : 31); $i++)
     
    48104810        $start = (is_string($start) && preg_match('#^(\d{4})[ .-/](\d{1,2})[ .-/](\d{1,2})$#', $start, $m)) ? mktime(0, 0, ($this->offset * -1), $m[2], $m[3], $m[1]) : ((is_numeric($start) && $start >= -91 && $start <= 724) ? intval($start) : NULL);
    48114811        $end = (is_string($end) && preg_match('#^(\d{4})[ .-/](\d{1,2})[ .-/](\d{1,2})$#', $end, $m)) ? mktime(0, 0, ($this->offset * -1), $m[2], $m[3] + 1, $m[1]) : ((is_numeric($end) && $end >= -7 && $end <= 731) ? intval($end) : NULL);
    4812         $count = (is_numeric($count) && $count >= 1 && $count <= ((!$regular && $special) ? 366 : 31)) ? intval($count) : NULL;
     4812        $count = (is_numeric($count) && $count >= 1 && $count <= ((!$regular && $special) ? 400 : 31)) ? intval($count) : NULL;
    48134813        $update_immediate = (array_key_exists('update', $atts) && is_string($update) && preg_match('/^(?:immediate|instant)(?:ly)?$/i', $update));
    48144814        $update = ($update_immediate || array_key_exists('update', $atts) && (is_bool($update) && $update || is_string($update) && preg_match('/^(?:t(?:rue)?|y(?:es)?|1|on|show)$/i', $update)));
     
    56015601        $start = (is_string($start) && preg_match('#^(\d{4})[ .-/](\d{1,2})[ .-/](\d{1,2})$#', $start, $m)) ? mktime(0, 0, ($this->offset * -1), $m[2], $m[3], $m[1]) : ((is_numeric($start) && $start >= -91 && $start <= 724) ? intval($start) : NULL);
    56025602        $end = (is_string($end) && preg_match('#^(\d{4})[ .-/](\d{1,2})[ .-/](\d{1,2})$#', $end, $m)) ? mktime(0, 0, ($this->offset * -1), $m[2], $m[3] + 1, $m[1]) : ((is_numeric($end) && $end >= -7 && $end <= 731) ? intval($end) : NULL);
    5603         $count = (is_numeric($count) && $count >= 1 && $count <= 366) ? intval($count) : NULL;
     5603        $count = (is_numeric($count) && $count >= 1 && $count <= 400) ? intval($count) : NULL;
    56045604        $week_start = (is_numeric($week_start) && $week_start < 0 || is_string($week_start) && preg_match('/^(?:today|now|yesterday|-\d+)$/i', $week_start)) ? ((is_numeric($week_start) && $week_start == -2 || is_string($week_start) && preg_match('/^(?:yesterday|-2)$/i', $week_start)) ? $this->yesterday : $this->today) : ((is_numeric($week_start) && $week_start >= 0 && $week_start <= 6) ? intval($week_start) : $this->week_start);       
    56055605        $empty = (is_bool($empty) && $empty || is_string($empty) && preg_match('/^(?:t(?:rue)?|y(?:es)?|1|on|show)$/i', $empty));
Note: See TracChangeset for help on using the changeset viewer.