TinyPortal

Development => Feedback => Topic started by: DreamSinger on September 06, 2009, 05:56:26 AM

Title: Can't prevent guests from viewing news box
Post by: DreamSinger on September 06, 2009, 05:56:26 AM
Hi, I asked for help at the smf forum, and they sent me here.

I'm putting together a forum for a group of homeschool girls, and I am trying to make it as private as possible.

I disabled registration. All members will be registered manually by me. I have the smf box unchecked for allowing guests to browse the forum in the basic features section.

In the tiny portal front page section, I have the circle checked "no", for allowing guests to view the news box. However, when I log out, I can still see the news box. Am I overlooking something? Is there any way I can prevent guests from seeing the news box?

Thanks in advance for assistance in this!

Demian
smf 1.1.10/tp v1.0 beta 49.7/Bright Forest Theme
http://www.atagahi.net (http://www.atagahi.net)
Title: Re: Can't prevent guests from viewing news box
Post by: IchBin on September 06, 2009, 06:03:56 AM
That is actually an SMF problem. They don't appear to recognize that it is actually the news code in the theme. Open the index.template.php file and find this code:
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<tr>
<td id="nieuws" colspan="2" class="tborder2" height="41">
<span>', $txt[102], '</span>:<br />
', $context['random_news_line'], '
</td>
</tr>';


Change it to this:
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']) && !$context['user']['is_guest'])
echo '
<tr>
<td id="nieuws" colspan="2" class="tborder2" height="41">
<span>', $txt[102], '</span>:<br />
', $context['random_news_line'], '
</td>
</tr>';
Title: Re: Can't prevent guests from viewing news box
Post by: DreamSinger on September 06, 2009, 12:00:39 PM
Yes! Thank you, perfect!  :)