SMF 1.1.8
TP 1.0 B3
Modified Blue Skies theme
URL http://usscalemasters.org/forums/ (http://usscalemasters.org/forums/)
I place the code found here:
http://www.tinyportal.net/index.php/topic,19906.0.html (http://www.tinyportal.net/index.php/topic,19906.0.html)
In a PHP Code block in Top Panel but can't seem to get things to display. Since this was written to work in a different theme, are there changes I need to make for BlueSkies?
I have tried different combos of settings, with frame/title, without frame/title. Since I can see the title if turned on, I know the block itself is working..
Thanks
--Mitch
Mitch,
First of all make sure you have at least 1 News Item in ...
Admin --> Main --> News and Newsletters
If you do, post the code you're using here
Inside code tags
and someone will take a look at it.
ZarPrime
Thanks ZarP, I have 3 news items.. Was not going to repeat the code since it is already in the link I posted and it is just verbatim in mine.. If I need to I will though... --Mitch
Post it. That way I can put your exact code in my test site and see if it works.
ZP
Do you have the news turned on in the theme settings?
Ok.... posting... hehehe
global $context, $settings, $options, $txt, $scripturl, $modSettings;
// Show the news fader? (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<div style="height: 50px; background: url('.$settings['images_url'].'/machine.jpg) repeat-x;">';
// Prepare all the javascript settings.
echo '
<div id="smfFadeScroller" style="text-align: center; width: 90%; padding: 2px;"><b>', $context['news_lines'][0], '</b></div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// 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": 155, "g": 185, "b": 255}, smfFadeTo = {"r": 0, "g": 0, "b": 0};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";
var foreColor, backEl, backColor;
if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
{
foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};
backEl = document.getElementById(\'smfFadeScroller\');
while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
backEl = backEl.parentNode;
backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
}
else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
{
foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};
backEl = document.getElementById(\'smfFadeScroller\');
while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;
backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
}
// List all the lines of the news for display.
var smfFadeContent = new Array(
"', implode('",
"', $context['fader_news_lines']), '"
);
// ]]></script><script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/fader.js"></script></div>';
}
Thanks....
Quote from: IchBinâ„¢ on March 03, 2009, 07:49:15 PM
Do you have the news turned on in the theme settings?
Ok, I see what you are talking about, yes news is enabled, but I don't have checked "Show news fader on board index"
--Mitch
"Enable News" does not need to be checked but "Show news fader on board index" does need to be checked. This is in current theme.
Your code is exactly the same as what I use on my site except the height of the div and the fade delay.
Other than that, there is no reason that this shouldn't be working.
ZarPrime
One of your News Items (the second one I think) causes a scrollbar to appear. You can fix this by increasing the div height slightly. 5000 may be a little slow for the fade delay. I'd consider trying 4000 just to see what you think.
I'm moving this to support.
ZarPrime
Yep that did it.. So I guess there is no way to have it now show up in the borad forum then. Also fixed the height, thanks...
--Mitch
You should be able to turn the news fader off for the theme. And then remove the if statement in the code to make it work. In the code remove this and see if it works.
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
AND this at the end:
}
Quote from: GhostRider2110 on March 03, 2009, 08:23:24 PM
Yep that did it.. So I guess there is no way to have it now show up in the borad forum then. Also fixed the height, thanks...
--Mitch
Mitch, if it is in the top panel just set your visual options for the block to show it in the Forum, or in all pages and sections, whatever you choose.
ZarPrime
Yes, that works... turned that off and modified the code Ichbin and all is good.. now the news fader is in the same spot on the different pages.. Thanks guys!!!
--Mitch
Seems to be working like a champ.. thanks Zar and Ich... Marked as solved. (and I think I marked it right this time.. hahaha )
--Mitch
You got it right Mitch. :up:
See, you can teach an old dog new tricks.. :)
That's what we're here for. :knuppel2: >:D
Glad we got you all sorted.
ZarPrime
HAHAHA... not "ALL" just this issue.. be prepared for more.. :2funny: :coolsmiley:
Quote from: GhostRider2110 on March 04, 2009, 04:18:58 PM
HAHAHA... not "ALL" just this issue.. be prepared for more.. :2funny: :coolsmiley:
Puts a post ban on Mitch.
muahahahah! :P
:o :-X