Advertisement:

Author Topic: Hiding random news if no news is available.  (Read 17353 times)

Offline m3talc0re

  • Full Member
  • ***
  • Posts: 630
  • Gender: Male
  • Life Sux, use hax, lol.
Hiding random news if no news is available.
« on: July 13, 2008, 11:15:38 PM »
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.

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: Hiding random news if no news is available.
« Reply #1 on: July 21, 2008, 03:00:06 AM »
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

Quote
Microsoft 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