TinyPortal

Development => Support => Topic started by: GhostRider2110 on March 03, 2009, 07:33:35 PM

Title: News fader in top panel block, Blueskies theme help.
Post by: GhostRider2110 on March 03, 2009, 07:33:35 PM
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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: ZarPrime on March 03, 2009, 07:39:28 PM
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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: GhostRider2110 on March 03, 2009, 07:41:14 PM
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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: ZarPrime on March 03, 2009, 07:46:27 PM
Post it.  That way I can put your exact code in my test site and see if it works.

ZP
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: IchBin on March 03, 2009, 07:49:15 PM
Do you have the news turned on in the theme settings?
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: GhostRider2110 on March 03, 2009, 07:50:08 PM
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....
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: GhostRider2110 on March 03, 2009, 07:53:35 PM
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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: ZarPrime on March 03, 2009, 08:01:14 PM
"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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: ZarPrime on March 03, 2009, 08:12:36 PM
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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: 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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: IchBin on March 03, 2009, 08:50:36 PM
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:
}
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: ZarPrime on March 03, 2009, 08:52:36 PM
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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: GhostRider2110 on March 03, 2009, 09:04:20 PM
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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: GhostRider2110 on March 04, 2009, 03:25:14 PM
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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: Ken. on March 04, 2009, 04:04:14 PM
You got it right Mitch. :up:
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: GhostRider2110 on March 04, 2009, 04:06:47 PM
See, you can teach an old dog new tricks.. :)
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: ZarPrime on March 04, 2009, 04:09:05 PM
That's what we're here for. :knuppel2: >:D

Glad we got you all sorted.

ZarPrime
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: GhostRider2110 on March 04, 2009, 04:18:58 PM
HAHAHA... not "ALL"  just this issue.. be prepared for more..     :2funny:  :coolsmiley:
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: IchBin on March 04, 2009, 04:49:59 PM
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
Title: Re: News fader in top panel block, Blueskies theme help.
Post by: GhostRider2110 on March 04, 2009, 04:55:18 PM
 :o  :-X