1
1
Fork 0

Replace dba::select(limit => 1) by dba::selectOne

- Convert array declarations to new style
This commit is contained in:
Hypolite Petovan 2018-01-09 22:20:33 -05:00
commit da60893590
51 changed files with 206 additions and 219 deletions

View file

@ -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::selectOne('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