diff --git a/src/Models/Entities/UserEntity.php b/src/Models/Entities/UserEntity.php index 9820b631..82666a71 100644 --- a/src/Models/Entities/UserEntity.php +++ b/src/Models/Entities/UserEntity.php @@ -148,4 +148,13 @@ class UserEntity extends AbstractEntity ->where('commenter_id = ?')->put($this->id); return Database::fetchOne($sqlQuery)['count']; } + + public function getPostCount() + { + $sqlQuery = (new SqlQuery) + ->select('count(1)')->as('count') + ->from('post') + ->where('uploader_id = ?')->put($this->id); + return Database::fetchOne($sqlQuery)['count']; + } } diff --git a/src/Views/user-list.phtml b/src/Views/user-list.phtml index b6b4e7ec..b7f90245 100644 --- a/src/Views/user-list.phtml +++ b/src/Views/user-list.phtml @@ -43,7 +43,7 @@