Wedge
Public area => The Pub => Support => Topic started by: Jurien on October 16th, 2014, 12:02 AM
-
Prevent not logged in users are able to print topics.I would like to have this option for logged in users only
-
I know there is a directive to the search engine/crawlers,not to index these pages (for what it's worth),but still very long topics can cause memory issues when they or not logged in users hits to start the print box.
Did several attempts to add a line like this if ($context['user']['is_logged']) in Display.php but it's still a no go,must be doing something wrong but I'm stuck :help:
// Lastly, set up the navigation items that we're going to be using.
$context['nav_buttons'] = array(
'normal' => array(
'reply' => array('test' => 'can_reply', 'text' => 'reply', 'url' => '<URL>?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last=' . $context['topic_last_message'], 'class' => 'active'),
($context['is_marked_notify'] ? 'unnotify' : 'notify') => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'custom' => 'onclick="return ask(' . JavaScriptEscape($txt['notification_' . ($context['is_marked_notify'] ? 'disable_topic' : 'enable_topic')]) . ', e);"', 'url' => '<URL>?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_query']),
'mark_unread' => array('test' => 'can_mark_unread', 'text' => 'mark_unread', 'url' => '<URL>?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_query']),
'send' => array('test' => 'can_send_topic', 'text' => 'send_topic', 'url' => '<URL>?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0'),
'print' => array('text' => 'print', 'custom' => 'rel="nofollow"', 'url' => '<URL>?action=printpage;topic=' . $context['current_topic'] . '.0'),
-
First, $context['user']['is_logged'] isnt good, better use we::$is_guest.
Second, write a plugin :D
Dont worry, did that for you.
http://wedge.org/pub/plugins/8717/plugin-no-print-for-guests/msg296572/#msg296572