Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Aiheen aloitti: kayte - helmikuu 27, 2006, 09:08:39 AP

Otsikko: disable guests from viewing avatars or sig lines
Kirjoitti: kayte - helmikuu 27, 2006, 09:08:39 AP
i did a search and i found a code posted, but the thread was from 2004, and if i put it where they say to at time time it puts it right in a code for attachments.

also is there any way to keep guests from printing threads?
Otsikko: Re: disable guests from viewing avatars or sig lines
Kirjoitti: RyanJones - helmikuu 27, 2006, 11:10:43 AP
Try this:

Open: /Themes/themeName/Display.template.php

Find:


'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'),
'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
);



Replace With:


'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0')
  );
  if (!$context['user']['is_guest'])
$normal_buttons['print'] = array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0');


Close: /Themes/themeName/Display.template.php




Open:/Sources/Printpage.php

Find:


if (empty($topic))
fatal_lang_error(472, false);




After, Add:


  if ($context['user']['is_guest']);
    fatal_lang_error(223, false);


Close: /Sources/Printpage.php




Cheers,

Ryan Jones
Otsikko: Re: disable guests from viewing avatars or sig lines
Kirjoitti: Aitsukai - helmikuu 27, 2006, 02:55:49 IP
The below code hides avatars and signatures from guests on posts. This was tested using 1.1 RC2 only.

Open: /Themes/[your theme name]/Display.template.php

Find:
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

Replace with:
if (!$message['user']['is_guest'] && !empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

Find:
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))

Replace with:
if (!$message['user']['is_guest'] && !empty($message['member']['signature']) && empty($options['show_no_signatures']))

Save and upload.
Otsikko: Re: disable guests from viewing avatars or sig lines
Kirjoitti: kayte - helmikuu 27, 2006, 04:55:22 IP
thank you. i will try this tonight when i don't have little fingers trying to type. :P
Otsikko: Re: disable guests from viewing avatars or sig lines
Kirjoitti: Aitsukai - maaliskuu 01, 2006, 07:19:13 IP
I'm sorry if that gave you an error. I double checked and still didn't see the missing dash. :(
Otsikko: Re: disable guests from viewing avatars or sig lines
Kirjoitti: kezayah - maaliskuu 15, 2006, 02:55:39 AP
Lainaus käyttäjältä: Aitsukai - helmikuu 27, 2006, 02:55:49 IP
The below code hides avatars and signatures from guests on posts. This was tested using 1.1 RC2 only.

Open: /Themes/[your theme name]/Display.template.php

Find:
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

Replace with:
if (!$message['member']['is_guest'] && !empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

Find:
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))

Replace with:
if (!$message['member']['is_guest'] && !empty($message['member']['signature']) && empty($options['show_no_signatures']))

Save and upload.
snif  :'(
It's not working !!!  :(
Otsikko: Re: disable guests from viewing avatars or sig lines
Kirjoitti: Aitsukai - maaliskuu 15, 2006, 05:33:17 AP
I feel so foolish. I edited it, try now.
Otsikko: Re: disable guests from viewing avatars or sig lines
Kirjoitti: kezayah - maaliskuu 15, 2006, 07:06:15 AP
It's not working too !!!  :(
Otsikko: Re: disable guests from viewing avatars or sig lines
Kirjoitti: winrules - maaliskuu 15, 2006, 03:48:11 IP
Lainaus käyttäjältä: kezayah - maaliskuu 15, 2006, 02:55:39 AP
Lainaus käyttäjältä: Aitsukai - helmikuu 27, 2006, 02:55:49 IP
The below code hides avatars and signatures from guests on posts. This was tested using 1.1 RC2 only.

Open: /Themes/[your theme name]/Display.template.php

Find:
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

Replace with:
if (!$message['member']['is_guest'] && !empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

Find:
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))

Replace with:
if (!$message['member']['is_guest'] && !empty($message['member']['signature']) && empty($options['show_no_signatures']))

Save and upload.
snif  :'(
It's not working !!!  :(
you have to use $context['user']['is_guest']

in display.template.php
find:

if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

replace

if (!$context['user']['is_guest'] && !empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))


find

if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))

replace:

if (!$context['user']['is_guest'] && !empty($message['member']['signature']) && empty($options['show_no_signatures']))
Otsikko: Re: disable guests from viewing avatars or sig lines
Kirjoitti: kezayah - maaliskuu 15, 2006, 04:34:23 IP
IT'S WORKIIIIIIIIIIIING !!!  8)
Thanks Winrules