]> git.mxchange.org Git - friendica.git/blobdiff - mod/events.php
Merge pull request #6694 from Quix0r/rewrites/added-missing-var-init
[friendica.git] / mod / events.php
index cb91fae35147ad36480722ae8756b3940e0fe6ee..008cf643ceac1a670814ff90f15bfb85cea3b742 100644 (file)
@@ -22,8 +22,6 @@ use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Strings;
 use Friendica\Util\Temporal;
 
-require_once 'include/items.php';
-
 function events_init(App $a)
 {
        if (!local_user()) {
@@ -119,7 +117,7 @@ function events_post(App $a)
                notice(L10n::t('Event can not end before it has started.') . EOL);
                if (intval($_REQUEST['preview'])) {
                        echo L10n::t('Event can not end before it has started.');
-                       killme();
+                       exit();
                }
                $a->internalRedirect($onerror_path);
        }
@@ -128,7 +126,7 @@ function events_post(App $a)
                notice(L10n::t('Event title and start time are required.') . EOL);
                if (intval($_REQUEST['preview'])) {
                        echo L10n::t('Event title and start time are required.');
-                       killme();
+                       exit();
                }
                $a->internalRedirect($onerror_path);
        }
@@ -215,14 +213,14 @@ function events_content(App $a)
        }
 
        if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
-               $r = q("UPDATE `event` SET `ignore` = 1 WHERE `id` = %d AND `uid` = %d",
+               q("UPDATE `event` SET `ignore` = 1 WHERE `id` = %d AND `uid` = %d",
                        intval($a->argv[2]),
                        intval(local_user())
                );
        }
 
        if (($a->argc > 2) && ($a->argv[1] === 'unignore') && intval($a->argv[2])) {
-               $r = q("UPDATE `event` SET `ignore` = 0 WHERE `id` = %d AND `uid` = %d",
+               q("UPDATE `event` SET `ignore` = 0 WHERE `id` = %d AND `uid` = %d",
                        intval($a->argv[2]),
                        intval(local_user())
                );
@@ -302,21 +300,6 @@ function events_content(App $a)
                        $y = 2100;
                }
 
-               $nextyear = $y;
-               $nextmonth = $m + 1;
-               if ($nextmonth > 12) {
-                       $nextmonth = 1;
-                       $nextyear ++;
-               }
-
-               $prevyear = $y;
-               if ($m > 1) {
-                       $prevmonth = $m - 1;
-               } else {
-                       $prevmonth = 12;
-                       $prevyear --;
-               }
-
                $dim    = Temporal::getDaysInMonth($y, $m);
                $start  = sprintf('%d-%d-%d %d:%d:%d', $y, $m, 1, 0, 0, 0);
                $finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59);
@@ -416,7 +399,7 @@ function events_content(App $a)
 
                if (!empty($_GET['id'])) {
                        echo $o;
-                       killme();
+                       exit();
                }
 
                return $o;
@@ -528,7 +511,7 @@ function events_content(App $a)
                        '$s_text' => L10n::t('Event Starts:') . ' <span class="required" title="' . L10n::t('Required') . '">*</span>',
                        '$s_dsel' => Temporal::getDateTimeField(
                                new DateTime(),
-                               DateTime::createFromFormat('Y', $syear+5),
+                               DateTime::createFromFormat('Y', intval($syear) + 5),
                                DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"),
                                L10n::t('Event Starts:'),
                                'start_text',
@@ -543,7 +526,7 @@ function events_content(App $a)
                        '$f_text' => L10n::t('Event Finishes:'),
                        '$f_dsel' => Temporal::getDateTimeField(
                                new DateTime(),
-                               DateTime::createFromFormat('Y', $fyear+5),
+                               DateTime::createFromFormat('Y', intval($fyear) + 5),
                                DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"),
                                L10n::t('Event Finishes:'),
                                'finish_text',