Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: Puchu - helmikuu 05, 2005, 02:05:47 AP

Otsikko: News to guests
Kirjoitti: Puchu - helmikuu 05, 2005, 02:05:47 AP
Is there anyway possible to get rid of news to be seen by guests?
I am referring to the non-flash news that is on top with the login area...



If so any help would be appreciatted.
Otsikko: Re: News to guests
Kirjoitti: Puchu - helmikuu 06, 2005, 01:14:59 AP
I'll take it it can't be done... since there have been no comments yet...
Otsikko: Re: News to guests
Kirjoitti: Jerry - helmikuu 06, 2005, 02:37:24 AP
it is possible, here.... ;)

Default Theme:
Open /Theme/default/index.template.php
Find:
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">', $context['random_news_line'], '</div>
</div>';

Replace with:
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']) && $context['user']['is_logged'])
echo '
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">', $context['random_news_line'], '</div>
</div>';
Otsikko: Re: News to guests
Kirjoitti: Puchu - helmikuu 06, 2005, 01:12:52 IP
Thank you, on my file it was not like that but I found the news line and added what you said the && $context['user']['is_logged'])

it didnn't work, but I started fideling with it some, and ended up with

if (!empty($settings['enable_news']) && !empty($context['user']['is_logged'])


There is a long line of different items within it so I threw that in and now it works :)