vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Show Thread Enhancements - Hide Printable View Link in threads and Printable View Page for certain usergroups (https://vborg.vbsupport.ru/showthread.php?t=262961)

yin9 04-30-2011 10:00 PM

Hide Printable View Link in threads and Printable View Page for certain usergroups
 
1 Attachment(s)
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:

Code:

<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:

Code:

<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:

Code:

</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:

Code:

</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:

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

Quote:

Originally Posted by Merenguista (Post 2201264)
thanks .. marked as installed ..

Thanks for mark.

Greetings.


All times are GMT. The time now is 10:50 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04545 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete