PDA

View Full Version : Problem with visible thread titles in private forum



fury
Sun 15th Jun '03, 1:14pm
People can see thread titles and last post dates of a forum that they have no permission to view the posts in. I leave the forum itself visible intentionally to let people know there is another forum that they could have access to if they were a contributor, but now with vB3 they can see the thread title and the last post date. I assume this is an unintentional feature because I don't see any code checking whether people have permission to view posts inside it.

fury
Sun 15th Jun '03, 1:20pm
Fixed it myself. Replace the three td's for replycount, threadcount, and lastpostinfo in forumhome_forumbit_levelx_post with this:


<td class="alt2"><if condition="!($forumperms & CANVIEWOTHERS)">-<else />$forum[replycount]</if></td>
<td class="alt1"><if condition="!($forumperms & CANVIEWOTHERS)">-<else />$forum[threadcount]</if></td>
<td class="alt2"><if condition="!($forumperms & CANVIEWOTHERS)">-<else />$forum[lastpostinfo]</if></td>

HostCom
Sun 15th Jun '03, 5:56pm
Fixed it myself. Replace the three td's for replycount, threadcount, and lastpostinfo in forumhome_forumbit_levelx_post with this:


<td class="alt2"><if condition="!($forumperms & CANVIEWOTHERS)">-<else />$forum[replycount]</if></td>
<td class="alt1"><if condition="!($forumperms & CANVIEWOTHERS)">-<else />$forum[threadcount]</if></td>
<td class="alt2"><if condition="!($forumperms & CANVIEWOTHERS)">-<else />$forum[lastpostinfo]</if></td>



Can you be a little more clearer on what I have to edit? Which template? Which code do I replace?

fury
Sun 15th Jun '03, 6:05pm
forumhome_forumbit_level1_post
forumhome_forumbit_level2_post

Find:

<td class="alt2">$forum[replycount]</td>
<td class="alt1">$forum[threadcount]</td>
<td class="alt2">$forum[lastpostinfo]</td>


Replace with:

<td class="alt2"><if condition="!($forumperms & CANVIEWOTHERS)">-<else />$forum[replycount]</if></td>
<td class="alt1"><if condition="!($forumperms & CANVIEWOTHERS)">-<else />$forum[threadcount]</if></td>
<td class="alt2"><if condition="!($forumperms & CANVIEWOTHERS)">-<else />$forum[lastpostinfo]</if></td>


Will replace reply count, thread count, and last post info with dashes if user does not have permission to view posts inside that forum. Example: http://www.otcentral.com/forum/index.php? - see Bomb Shelter

fury
Sun 15th Jun '03, 6:11pm
Also made an enhancement to the FORUMDISPLAY template which shows a message other than "There have been no posts in the last 1000 days" if the forum is visible but the user is not allowed to read posts in it.

Edit FORUMDISPLAY template.

Find:
<if condition="$hasthreads">
<!-- show threads -->
$forumdisplaybits
<!-- end show threads -->
<else />
<!-- show no threads message -->
<tr>
<td class="alt1" colspan="$foruminfo[bottomcolspan]" align="center">
<div style="padding: 16px">
<b>There have been no posts in the last $daysprune days in this forum.</b><br />
<span class="smallfont">Try using the controls below to search for any older posts that may exist.</span>
</div>
</td>
</tr>
<!-- end show no threads message -->
</if>


Replace with: (insert your preferred message in place of highlighted text)


<if condition="$hasthreads">
<!-- show threads -->
$forumdisplaybits
<!-- end show threads -->
<else />
<if condition="!($forumperms & CANVIEWOTHERS)">
<!-- show no access message -->
<tr>
<td class="alt1" colspan="$foruminfo[bottomcolspan]" align="center">
<div style="padding: 16px">
<b>You are not permitted to view posts in this forum</b><br />
<span class="smallfont">You must be a Contributor, Moderator, or Administrator to gain access.</span>
</div>
</td>
</tr>
<!-- end show no access message -->
<else />
<!-- show no threads message -->
<tr>
<td class="alt1" colspan="$foruminfo[bottomcolspan]" align="center">
<div style="padding: 16px">
<b>There have been no posts in the last $daysprune days in this forum.</b><br />
<span class="smallfont">Try using the controls below to search for any older posts that may exist.</span>
</div>
</td>
</tr>
<!-- end show no threads message -->
</if></if>

HostCom
Sun 15th Jun '03, 6:15pm
GREAT! Thanks bro :)

fury
Sun 15th Jun '03, 6:15pm
No problem. http://smilies.xibase.com/beerbang.gif

Scott MacVicar
Mon 16th Jun '03, 7:10pm
ok fixed it to make it be treated like a regular forum.

Boofo
Mon 16th Jun '03, 10:03pm
ok fixed it to make it be treated like a regular forum.

Like a regular forum? What do you mean?