vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to Disable the printable version (https://vborg.vbsupport.ru/showthread.php?t=240254)

Classico 04-11-2010 09:37 PM

How to Disable the printable version
 
Hi,

I?m trying yo disable the printable version for guests ( VB4 ).

In the printthread template i try to use this code:

Code:

if (empty($vbulletin->userinfo['userid']))
{
    print_no_permission();
}

But does not work.... :(

Can you please help me?

Thanks!!! :)

Andy 04-13-2010 12:49 AM

1 Attachment(s)
You will want to create a plugin like this.

Attachment 115696

MARCO1 04-15-2010 10:30 AM

I'll create this Mod today, And Send PM To you when I finish it :)

borbole 04-15-2010 03:38 PM

There is already a mod for that I believe.

https://vborg.vbsupport.ru/showthread.php?t=231478

MARCO1 04-15-2010 05:47 PM

Quote:

Originally Posted by borbole (Post 2021757)
There is already a mod for that I believe.

https://vborg.vbsupport.ru/showthread.php?t=231478

Why we should use DB ? We can make the same Mod without any DB Changes!

borbole 04-15-2010 05:57 PM

Quote:

Originally Posted by MARCO1 (Post 2021828)
Why we should use DB ? We can make the same Mod without any DB Changes!

I haven''t seen how the mod is coded. I simply informed the OP that what he wanted could be achived with that mod. It is up to him if he wants to use it or not or request another one.

MARCO1 04-16-2010 12:29 AM

Quote:

Originally Posted by borbole (Post 2021831)
I haven''t seen how the mod is coded. I simply informed the OP that what he wanted could be achived with that mod. It is up to him if he wants to use it or not or request another one.

Yes, I Guessed that, You just trying to help, Thanks for your support borbole I like this kind of people :)

Wolver2 07-18-2015 06:43 AM

Quote:

Originally Posted by MARCO1 (Post 2021973)
Yes, I Guessed that, You just trying to help, Thanks for your support borbole I like this kind of people :)

Couldnt find the Mod u created on this.

As I was looking for a Mod to completely give No access to anyone to print function

MarkFL 07-18-2015 06:51 AM

You could go to your "SHOWTHREAD" template, and locate the code:

PHP Code:

<li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}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

and change it to:

PHP Code:

<vb:comment><li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}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></vb:comment


cellarius 07-18-2015 08:57 PM

Which will not prevent people from seeing the printable version if they know the direct link.

Wolver2 07-18-2015 10:56 PM

Thanks MarkFL sadly They know the url of the printable version :( anyone to block everyone?

Quote:

Originally Posted by MarkFL (Post 2550582)
You could go to your "SHOWTHREAD" template, and locate the code:

PHP Code:

<li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}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

and change it to:

PHP Code:

<vb:comment><li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}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></vb:comment



MarkFL 07-18-2015 11:08 PM

Try adding:

PHP Code:

if (!$_SERVER['HTTP_REFERER'])
{
    exit;


at the top of your "printthread.php" file.

MarkFL 07-19-2015 06:57 AM

1 Attachment(s)
If you wish to avoid template edits and PHP file hacks, then download and import the attached add-on. It uses 1 plugin to inject a snippet of javascript to remove the "Show Printable Version" item from the "Thread Tools" menu, and another plugin that will deny permission to anyone trying to access the script manually. :up:

There are no settings to configure, once it is imported, it is active.

Wolver2 07-20-2015 12:08 PM

Appreciate it MarkFL , I will try and report to u once i get home

Stratis 07-26-2018 02:19 PM

Quote:

Originally Posted by Wolver2 (Post 2550836)
Appreciate it MarkFL , I will try and report to u once i get home

Yep, I am waiting three years for your report, I assume you forgot it :D


Mark I just test this, "Show Printable Version" phrase-option is still there.
It does not allow though to see the page. Stratis, you do not have permission to access this page. This could be due to one of several reasons:


This is ok, but if the option "Show Printable Version" is not there it would be great. Thanks any way. :)

MarkFL 07-26-2018 03:21 PM

Quote:

Originally Posted by Stratis (Post 2595725)
Yep, I am waiting three years for your report, I assume you forgot it :D


Mark I just test this, "Show Printable Version" phrase-option is still there.
It does not allow though to see the page. Stratis, you do not have permission to access this page. This could be due to one of several reasons:


This is ok, but if the option "Show Printable Version" is not there it would be great. Thanks any way. :)

I just dug this out, blew off the cobwebs and tested it...everything works perfectly for me.

Stratis 07-26-2018 05:04 PM

Quote:

Originally Posted by MarkFL (Post 2595728)
I just dug this out, blew off the cobwebs and tested it...everything works perfectly for me.

I see though the option and it does not let see the page. It does that we want, it would be better if it worked to me to hide the option :)


Thanks for another time.

MarkFL 07-26-2018 05:41 PM

It does hide the option. Try it with the default style.

What version of vB are you testing it with? What browser are you using?

Stratis 07-27-2018 02:45 AM

vb 4.2.0, with all styles and all browsers.
Just test this #9
This hides the option, so i will use that with the product-markflnoprintable.xml :)

MarkFL 07-27-2018 03:41 AM

I am guessing your template is different then, and so the javascript doesn't work.

Stratis 07-27-2018 06:54 AM

Quote:

Originally Posted by MarkFL (Post 2595742)
I am guessing your template is different then, and so the javascript doesn't work.

I never had change the default skin, so template is default.
Any way thanks Mark, as with both up changes i am ok now :)

MarkFL 07-27-2018 06:59 AM

What I mean is, the default template in your older version of vB must be different enough from the one in later versions to keep the javascript from working. That's my guess.

Guest20210129 10-02-2019 09:07 AM

Quote:

Originally Posted by MarkFL (Post 2550694)
If you wish to avoid template edits and PHP file hacks, then download and import the attached add-on. It uses 1 plugin to inject a snippet of javascript to remove the "Show Printable Version" item from the "Thread Tools" menu, and another plugin that will deny permission to anyone trying to access the script manually. :up:

There are no settings to configure, once it is imported, it is active.

Thanks, works on 4.2.5


All times are GMT. The time now is 04:09 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.01283 seconds
  • Memory Usage 1,786KB
  • 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
  • (1)bbcode_code_printable
  • (5)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (23)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