Turn off Printable View

Started by gerrymore, January 26, 2005, 12:46:24 PM

Previous topic - Next topic

gerrymore

Is there a way to turn off the prinatble view of the forum? I Admin my son's school forum and some teachers and parents are noticing a lot of "Guests" printing off pages, and would like it stopped if possible.
SMF RC1, Tiny Portal 0.75, Coppermine 1.3.3, Flashchat.

ryanbsoftware

#1
Quote from: gerrymore on January 26, 2005, 12:46:24 PM
Is there a way to turn off the prinatble view of the forum? I Admin my son's school forum and some teachers and parents are noticing a lot of "Guests" printing off pages, and would like it stopped if possible.

well i don't think you can disable that without some sort of modification, plus they could just print the normal version, you can make it to where guests have to login tho in the admin panel.

Admin -> Edit Features And Options -> Unselct "Allow guests to browse the forum"

Oldiesmann

That will work, but it's a bit drastic...

This will stop them...

First step - hide the "print" button ;)

Themes/*/Display.template.php (should be the same in most themes)

Find
$buttonArray[] = '<a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0" target="_blank">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/print.gif" alt="' . $txt[465] . '" border="0" />' : $txt[465]) . '</a>';

Replace
if(!$context['user']['is_guest'])
$buttonArray[] = '<a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0" target="_blank">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/print.gif" alt="' . $txt[465] . '" border="0" />' : $txt[465]) . '</a>';


Second step - force them to login if they try to do it anyway...

index.php

Find
// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', '.xml'))))
{
require_once($sourcedir . '/Subs-Auth.php');
return 'KickGuest';
}


Add after that
// Guests can't print topics...
elseif ($user_info['is_guest'] && $_REQUEST['action'] == 'printpage')
{
require_once($sourcedir . '/Subs-Auth.php');
return 'KickGuest';
}

ryanbsoftware

Quote from: Oldiesmann on January 26, 2005, 05:03:38 PM
That will work, but it's a bit drastic...

true but it's a school forum, i'd bet anyone who needs legit access to it has an account.  so it wouldn't be a big deal but would be easier to do.

Enigma

I have noticed that when Searchbots are on the forum, it may show up as they are printing a certain topic.

Advertisement: