X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcal.php;h=51a66613ee107221552cfd0ebae6964f1ac386f7;hb=c54a2c1e83822f6e043b449468570d2c9ed3ab3a;hp=01fcaf4f7efa9f5f46b9638b08a395e24834ccaf;hpb=819592c3bd295986fc52d1c3e3abd4e32cf48645;p=friendica.git diff --git a/mod/cal.php b/mod/cal.php index 01fcaf4f7e..51a66613ee 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -6,10 +6,10 @@ * This calendar is for profile visitors and contains only the events * of the profile owner */ + use Friendica\App; use Friendica\Content\Feature; use Friendica\Core\Config; -use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Database\DBM; use Friendica\Model\Contact; @@ -32,16 +32,13 @@ function cal_init(App $a) if ($a->argc > 1) { $nick = $a->argv[1]; - $user = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1", - dbesc($nick) - ); - - if (!count($user)) { + $user = dba::selectFirst('user', [], ['nickname' => $nick, 'blocked' => false]); + if (!DBM::is_result($user)) { return; } - $a->data['user'] = $user[0]; - $a->profile_uid = $user[0]['uid']; + $a->data['user'] = $user; + $a->profile_uid = $user['uid']; // if it's a json request abort here becaus we don't // need the widget data @@ -96,8 +93,6 @@ function cal_content(App $a) '$baseurl' => System::baseUrl(), )); - $o = ""; - $mode = 'view'; $y = 0; $m = 0;