MyBB Community Forums

Full Version: Protected forum on Last post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to show message 'Protected Forum' instead of regular last post as shown in image.
Protected forums are accessible to specific usergroups.
Usergroups who have no permission to view that forum should see "Protected Forum' On last post.

[attachment=35688]

Can we add any template condition for it?
Please help.
Can anyone guide me on this please.
yes, you should use templates condition for this.
i try everything but it showing on all forums not on specific forums.
help me please.
(2016-02-22, 01:59 PM)Dr_The_One Wrote: [ -> ]i try everything but it showing on all forums not on specific forums.
help me please.

Install the PHP In Templates Plugin and edit your forumbit_depth2_forum_lastpost so that it looks like this:

<span class="smalltext"><if $forum['fid'] = X then>Protected Forum <else><a href="{$lastpost_link}" title="{$full_lastpost_subject}"><strong>{$lastpost_subject}</strong></a><br />{$lastpost_date}<br />{$lang->by} {$lastpost_profilelink}</if></span>

Replace the X after $forum['fid'] = with the ID number of your protected forum.
i also want to add groups exclusion to show last post .
i use below code and it show protected under all forum last post.

<if (in_array($mybb->user['usergroup'], array(4,9,10,12)) && in_array($forum['fid'], array(168,169))) then>

<table><tr>
<td>{$forum['lp_avatar']}</td>
<td><span class="smalltext"><a href="{$lastpost_link}" title="{$full_lastpost_subject}"><strong>{$lastpost_subject}</strong></a>
<br/>{$lastpost_date} {$lastpost_time}<br/> {$lastpost_profilelink}</span></td></tr></table>

<else> Protected Forum
</if>

can you guide me bro.
can those usergroups (4,9,10,12) see forums id=168,189? or it shows "protected forum" for them too?
no...even admin not able to see.
all have protected forum on last post.
Sorry for Bump.
please help.
its urgent.
Anyone want to help in this matter?