Code Duplication    Length = 16-17 lines in 2 locations

class/APCal.php 2 locations

@@ 1850-1866 (lines=17) @@
1847
                        );
1848
                    }
1849
1850
                    if ($event->allday) {
1851
                        if ($event->start + $tzoffset >= $now_unixtime + 86400
1852
                            || $event->end + $tzoffset <= $now_unixtime
1853
                        ) {
1854
                            continue;
1855
                        }
1856
                    } else {
1857
                        if ($event->start + $tzoffset >= $bottomtime_of_day
1858
                            || $event->start + $tzoffset != $toptime_of_day
1859
                               && $event->end + $tzoffset <= $toptime_of_day
1860
                        ) {
1861
                            continue;
1862
                        }
1863
1864
                        $event->is_start_date = $event->start + $tzoffset >= $toptime_of_day;
1865
                        $event->is_end_date   = $event->end + $tzoffset <= $bottomtime_of_day;
1866
                    }
1867
1868
                    $summary = $this->text_sanitizer_for_show($event->summary);
1869
@@ 1913-1928 (lines=16) @@
1910
                        mysqli_data_seek($wrs, 0);
1911
                    }
1912
                    while ($event = $GLOBALS['xoopsDB']->fetchObject($wrs)) {
1913
                        if ($event->allday) {
1914
                            if ($event->start + $tzoffset >= $now_unixtime + 86400
1915
                                || $event->end + $tzoffset <= $now_unixtime
1916
                            ) {
1917
                                continue;
1918
                            }
1919
                        } else {
1920
                            if ($event->start + $tzoffset >= $bottomtime_of_day
1921
                                || $event->start + $tzoffset != $toptime_of_day
1922
                                   && $event->end + $tzoffset <= $toptime_of_day
1923
                            ) {
1924
                                continue;
1925
                            }
1926
                            $event->is_start_date = $event->start + $tzoffset >= $toptime_of_day;
1927
                            $event->is_end_date   = $event->end + $tzoffset <= $bottomtime_of_day;
1928
                        }
1929
1930
                        $summary = $this->text_sanitizer_for_show($event->summary);
1931