How to show all forum news instead of random news?

Started by guppy, May 20, 2005, 12:32:46 AM

Previous topic - Next topic

guppy

Hi,

I'm using a javascript news ticker to show the random forum news. How can I show all the forum news likewise?

I'm looking at this piece of code from BoardIndex.template.php:

// Show the news fader?  (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<div class="tborder" style="margin-bottom: 2ex;">
<table border="0" width="100%" cellspacing="1" cellpadding="4">
<tr class="titlebg" align="center">
<td>', $txt[102], '</td>
</tr>
<tr>
<td valign="middle" align="center" height="60">';

// Prepare all the javascript settings.
echo '
<div id="smfFadeScroller" style="width: 90%; padding: 2px; color: #000000;"><b>', $context['news_lines'][0], '</b></div>
<script language="JavaScript1.2" type="text/javascript"><!--
// The fading delay (in ms.)
var smfFadeDelay = ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], ';
// Fade from... what text color?  To which background color?
var smfFadeFrom = {"r": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 255, "g": 255, "b": 255};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";

// List all the lines of the news for display.
var smfFadeContent = new Array(
"', implode('",
"', $context['fader_news_lines']), '"
);
// --></script>
<script language="JavaScript1.2" type="text/javascript" src="', $settings['default_theme_url'], '/fader.js"></script>
</td>
</tr>
</table>
</div>';
}


My trial and error wasn't too successful. Which part of this code do I use to show all the forum news? Do I need to build an array for the forum news to be shown one by one (like the news fader)?

Thanks in advance  :)

Edit: Btw, I should mention I only know very basic php (well enough to edit templates) and I only know how to use ready-to-use javascripts by filling in the values..  :-[

[Unknown]

You'll want something like:

echo implode('<br />', $context['news_lines']);

But, if you want JavaScript... then fader_news_lines is just what you want.  How is the news fader different from what you're trying to achieve?

-[Unknown]

guppy

i'm trying to achieve the "Latest" feature at http://news.bbc.co.uk/ where the first news is typed out and followed by the other news.

at the moment, i use random news so the news repeats itself.

this' probably a personal thing..  :P i'll prefer news that is typed out because i believe the eyes will follow the typing movement and the timing will be just right for the next news. i tried to picture myself as a user. if i set the fading too fast, i might not finish reading the news before it fades. but if i set it too slow, i could have finished and go on to some other parts of the forum already. i'ld most probably miss the other news until i see them by chance.

cheers!

geezmo

I think I want something like that too, a news list where the old ones get deleted out and the new news gets to the top of the list. Is there already a mod or code for this? Thanks!


Advertisement: