Don't show the news to guests?

Started by tfs, June 29, 2009, 11:34:35 AM

Previous topic - Next topic

tfs

2.0 RC1-1

Is there a way to keep guests from seeing the news?
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

Marcus Forsberg

Are you using the default theme or a custom theme?

tfs

A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

N3RVE

Index.template.php

Code (Find) Select

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<div id="random_news"><h3>', $txt['news'], ':</h3><p>', $context['random_news_line'], '</p></div>';


Code (Replace with) Select

// Show a random news item? (or you could pick one from news_lines...)
if ($context['user']['is_logged'] && $settings['enable_news'])
echo '
<div id="random_news"><h3>', $txt['news'], ':</h3><p>', $context['random_news_line'], '</p></div>';


Make a backup, I haven't tested this :)

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

tfs

That appears to work.  Thanks.  Now the search engine trolls will quit hitting all the links I have in the news pointing to different things in the forum.  This should definitely be made an option in SMF.
A good tree cannot bring forth evil fruit, neither can an evil tree bring forth good fruit.

N3RVE

I'll build a mod if I find some free time ;)
Marking this solved

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

Advertisement: