Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

@@ -109,12 +109,21 @@ class _ArchivedPost extends Post
* @param \IPS\Member $member The memner
* @return int
*/
public static function memberPostCount( \IPS\Member $member )
public static function memberPostCount( \IPS\Member $member, bool $includeNonPostCountIncreasing = FALSE, bool $includeHiddenAndPendingApproval = TRUE )
{
return static::db()->select( 'COUNT(*)', 'forums_archive_posts', array(
array( 'archive_author_id=?', $member->member_id ),
array( \IPS\Db::i()->in( 'archive_forum_id', iterator_to_array( \IPS\Db::i()->select( 'id', 'forums_forums', 'inc_postcount=0' ) ), TRUE ) )
) )->first();
$where = [];
$where[] = [ 'archive_author_id=?', $member->member_id ];
if ( !$includeNonPostCountIncreasing )
{
$where[] = [ \IPS\Db::i()->in( 'archive_forum_id', iterator_to_array( \IPS\Db::i()->select( 'id', 'forums_forums', 'inc_postcount=0' ) ) ) ];
}
if ( !$includeHiddenAndPendingApproval )
{
$where[] = [ 'archive_queued=0' ];
}
return \IPS\Db::i()->select( 'COUNT(*)', 'forums_posts', $where )->first();
}
/**