From acbabf5b180822177132f36aa8277e2a0235d35f Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Fri, 7 Apr 2023 23:58:34 +0200 Subject: [PATCH] remove some magic --- src/Utils.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Utils.php b/src/Utils.php index 1603064..19a845c 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -43,17 +43,17 @@ class Utils $i = 0; while ($rs->fetch()) { $user = dcCore::app()->con->select( - 'SELECT * FROM ' . dcCore::app()->prefix . dcAuth::USER_TABLE_NAME . " WHERE user_id='" . $rs->user_id . "' " + 'SELECT * FROM ' . dcCore::app()->prefix . dcAuth::USER_TABLE_NAME . " WHERE user_id='" . $rs->f('user_id') . "' " ); if ($user->isEmpty()) { continue; } $author = dcUtils::getUserCN( - $user->user_id, - $user->user_name, - $user->user_firstname, - $user->user_displayname + $user->f('user_id'), + $user->f('user_name'), + $user->f('user_firstname'), + $user->f('user_displayname') ); if (empty($author)) { continue; @@ -62,18 +62,18 @@ class Utils $i++; if (dcCore::app()->blog->settings->get('authormode')->get('authormode_active')) { $res[$i]['author_link'] = 'blog->url . dcCore::app()->url->getBase('author') . '/' . $user->f('user_id') . '" ' . 'title="' . __('Author posts') . '">' . $author . ''; - } elseif ($user->user_url) { - $res[$i]['author_link'] = 'f('user_url') . '" title="' . __('Author link') . '">' . $author . ''; } $res[$i]['author'] = $author; - if ($rs->count == 0) { + if ((int) $rs->f('count') == 0) { $res[$i]['count'] = __('no entries'); } else { - $res[$i]['count'] = sprintf(__('one entry', '%s entries', (int) $rs->count), $rs->count); + $res[$i]['count'] = sprintf(__('one entry', '%s entries', (int) $rs->f('count')), $rs->f('count')); } } @@ -112,26 +112,26 @@ class Utils while ($rs->fetch()) { $user = dcCore::app()->con->select( 'SELECT * FROM ' . dcCore::app()->prefix . dcBlog::COMMENT_TABLE_NAME . ' ' . - "WHERE comment_email='" . $rs->comment_email . "' " . + "WHERE comment_email='" . $rs->f('comment_email') . "' " . 'ORDER BY comment_dt DESC' ); - if (!$user->comment_author) { + if (!$user->f('comment_author')) { continue; } $i++; - if ($user->comment_site) { - $res[$i]['author_link'] = '' . $user->comment_author . ''; + if ($user->f('comment_site')) { + $res[$i]['author_link'] = '' . $user->f('comment_author') . ''; } - $res[$i]['author'] = $user->comment_author; + $res[$i]['author'] = $user->f('comment_author'); - if ($rs->count == 0) { + if ((int) $rs->f('count') == 0) { $res[$i]['count'] = __('no comments'); } else { - $res[$i]['count'] = sprintf(__('one comment', '%s comments', (int) $rs->count), $rs->count); + $res[$i]['count'] = sprintf(__('one comment', '%s comments', (int) $rs->f('count')), $rs->f('count')); } }