Hi,
I saw a post here and made some modifications on it,
http://punbb.org/forums/viewtopic.php?id=8628
I also wanted the same option you wanted so I tweaked this a little, do the index.php portion, but instead of the viewforum.php, try this code below on the viewtopic.php
first step is backup, backup, and backup.
About line 42 of index.php, replace the following codes
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
into
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
That is it for the index.php, now to the viewtopic.php
About line 48 of viewtopic.php, replace the following codes
if (!$db->num_rows($result))
message($lang_common['Bad request']);
into
if (!$db->num_rows($result))
{
$result = $db->query('SELECT topic_id FROM '.$db->prefix.'posts WHERE id='.$pid);
if (!$db->num_rows($result))
message($lang_common['Bad request']);
else
message($lang_common['No view']);
}
Set all of your posts to members only view inside admin and then the change the language content accordingly..., I have tried this on version 1.2.7 and I do not know about it being applicable to newer versions, I havent checked.
I hope this one helps
Paul