You are welcome and it looks like soft deleted is -1 in approved field.
<php>$openTopics = ipsRegistry::DB()->buildAndFetch( array( 'select' => 'count(*) as count','from' => 'topics','where' => "forum_id=3 and state='open' and approved is > -1"));</php>
ok here is the code for template . If in php program use without the , php> && < /php>
<php>$openTopics = ipsRegistry::DB()->buildAndFetch( array( 'select' => 'count(*) as count','from' => 'topics','where' => "forum_id=3 and state='open'"));</php>
to display in template ( of course use any layout you like)
********************************* {$openTopics['count']} topics in forum 3. ********************************************