X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fevents.php;h=0fdec5cbe4c0f01d1e59bff4fc6418230a8ce6ab;hb=dd0a1cf586fc37fe9a3d84af277c7504136a3bf9;hp=19078ab26a9179b899d9ac8f12e6241c282d78a5;hpb=5a6da8b447430174ae231a3b8203fd4bd8416cc1;p=friendica.git diff --git a/mod/events.php b/mod/events.php index 19078ab26a..0fdec5cbe4 100644 --- a/mod/events.php +++ b/mod/events.php @@ -3,6 +3,9 @@ * @file mod/events.php * @brief The events module */ + +use Friendica\App; + require_once 'include/bbcode.php'; require_once 'include/datetime.php'; require_once 'include/event.php'; @@ -112,7 +115,7 @@ function events_post(App $a) { $c = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval(local_user()) ); - if (dbm::is_result($c)) { + if (count($c)) { $self = $c[0]['id']; } else { $self = 0; @@ -126,7 +129,7 @@ function events_post(App $a) { $str_contact_deny = perms2str($_POST['contact_deny']); // Undo the pseudo-contact of self, since there are real contacts now - if (strpos($str_contact_allow, '<' . $self . '>') !== false) { + if (strpos($str_contact_allow, '<' . $self . '>') !== false ) { $str_contact_allow = str_replace('<' . $self . '>', '', $str_contact_allow); } // Make sure to set the `private` field as true. This is necessary to @@ -142,7 +145,7 @@ function events_post(App $a) { $str_group_allow = $str_contact_deny = $str_group_deny = ''; } - /// @TODO One-time array initialization, one large block + $datarray = array(); $datarray['guid'] = get_guid(32); $datarray['start'] = $start; @@ -407,9 +410,7 @@ function events_content(App $a) { // Passed parameters overrides anything found in the DB if ($mode === 'edit' || $mode === 'new') { - if (!x($orig_event)) { - $orig_event = array(); - } + if (!x($orig_event)) {$orig_event = array();} // In case of an error the browser is redirected back here, with these parameters filled in with the previous values if (x($_REQUEST, 'nofinish')) {$orig_event['nofinish'] = $_REQUEST['nofinish'];} if (x($_REQUEST, 'adjust')) {$orig_event['adjust'] = $_REQUEST['adjust'];} @@ -435,7 +436,7 @@ function events_content(App $a) { $sh_checked = (($orig_event['allow_cid'] === '<' . local_user() . '>' && (! $orig_event['allow_gid']) && (! $orig_event['deny_cid']) && (! $orig_event['deny_gid'])) ? '' : ' checked="checked" '); } - if ($cid OR ($mode !== 'new')) { + if ($cid || ($mode !== 'new')) { $sh_checked .= ' disabled="disabled" '; }