News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Hiding random news if no news is available.

Started by m3talc0re, July 13, 2008, 11:15:38 PM

Previous topic - Next topic

m3talc0re

Right now, if you have no news available for the random news box in the header, you'll see the space for it and the News: text without any news showing. To turn that off, you have to go to another settings area and disable the random news item altogether. A quick and easy fix for this is to simply hide it if no news is available.

Open the index.template.php and find this:
// Show a random news item? (or you could pick one from news_lines...) if (!empty($settings['enable_news'])) echo ' <td width="90%" class="titlebg2"> <span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span> </td>';

See the if statement? This is what you want (notice the if again):
// Show a random news item? (or you could pick one from news_lines...) if ((!empty($settings['enable_news'])) && (!empty($context['random_news_line']))) echo ' <td width="90%" class="titlebg2"> <span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span> </td>';
The real hell is your life gone wrong.

metallica48423

Hey thanks for the tip!

I had actually been looking for something like this for awhile.  Thanks!
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Advertisement: