PDA

View Full Version : Show Thread Enhancements - Hide Printable View Link in threads and Printable View Page for certain usergroups


yin9
04-30-2011, 10:00 PM
Hi all, it's a simple template mod, i was searching for that and don't find for VB4, if it existed, would appreciate a mod that eliminated, sorry for my English.

This simple mod allow you hide print link of Threads tools and hide print page for guests or certain groups.

AdminCP -> Styles & Templates -> Search in Template -> Search for Text -> printthread

SHOWTHREAD Template

Search for:

<li><a href="printthread.php?{vb:raw session.sessionurl}t={vb:raw threadid}<vb:if condition="$perpage">&amp;pp={vb:raw perpage}</vb:if><vb:if condition="$pagenumber">&amp;page={vb:raw pagenumber}</vb:if>" accesskey="3"
rel="nofollow">{vb:rawphrase show_printable_version}</a></li>



Replace to:

<li><vb:if condition="is_member_of($bbuserinfo, 2,5,6,7)"><a href="printthread.php?{vb:raw session.sessionurl}t={vb:raw threadid}<vb:if condition="$perpage">&amp;pp={vb:raw perpage}</vb:if><vb:if condition="$pagenumber">&amp;page={vb:raw pagenumber}</vb:if>" accesskey="3"
rel="nofollow">{vb:rawphrase show_printable_version}</a></vb:if></li>



printthread Template

Search for:

</vb:if>

<ul id="postlist">
{vb:raw postbits}
</ul>

<vb:if condition="$show['pagenav']">
<div class="floatcontainer">
<a class="maxperpage" href="printthread.php?{vb:raw session.sessionurl}t={vb:raw threadid}&amp;pp={vb:raw maxperpage}">{vb:rawphrase show_x_posts_on_one_page, {vb:raw maxperpage}}</a>
<div id="pagination_bottom">
{vb:raw pagenav}
</div>
</div>
</vb:if>



Replace to:

</vb:if>

<vb:if condition="is_member_of($bbuserinfo, 2,5,6,7)"><ul id="postlist">
{vb:raw postbits}
</ul>

<vb:if condition="$show['pagenav']">
<div class="floatcontainer">
<a class="maxperpage" href="printthread.php?{vb:raw session.sessionurl}t={vb:raw threadid}&amp;pp={vb:raw maxperpage}">{vb:rawphrase show_x_posts_on_one_page, {vb:raw maxperpage}}</a>
<div id="pagination_bottom">
{vb:raw pagenav}
</div>
</div>
</vb:if></vb:if>



If you want more usergroups can see print link in thread and print page, add usergroup id in conditional code:

is_member_of($bbuserinfo, 2,5,6,7,25,26,29)


If you want some usergroup can't see print link and print page, don't put his id or remove his id at this condicional code.

Merenguista
05-29-2011, 01:31 PM
thanks .. marked as installed ..

yin9
06-11-2011, 09:22 AM
thanks .. marked as installed ..

Thanks for mark.

Greetings.