collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 265
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: Make news block fade  (Read 25235 times)

0 Members and 1 Guest are viewing this topic.

Offline Nothingness

  • Jr. Member
  • **
  • Posts: 69
  • Gender: Male
  • I am...the architect of my own destruction...
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Make news block fade
« Reply #20 on: January 18, 2010, 06:11:33 PM »
Bump.
"Do you wallow in self-pity, or do you learn to use the gifts God gave you and command fear and respect, and defend against those who would do us harm"

Offline Nothingness

  • Jr. Member
  • **
  • Posts: 69
  • Gender: Male
  • I am...the architect of my own destruction...
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Make news block fade
« Reply #21 on: January 20, 2010, 12:18:47 PM »
If no one knows the answer or the fix to this just simply answer with a no instead of not replying at all.
« Last Edit: February 03, 2010, 11:53:53 PM by Dismal Shadow »
"Do you wallow in self-pity, or do you learn to use the gifts God gave you and command fear and respect, and defend against those who would do us harm"

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Make news block fade
« Reply #22 on: January 29, 2010, 12:43:30 PM »
For SMF 1.1 version:

Code: [Select]
global $context, $settings;

if (!empty($context['fader_news_lines']))
{
echo '
<div style="text-align: center;">';

// Prepare all the javascript settings.
echo '
<div id="smfFadeScroller" style="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": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 255, "g": 255, "b": 255};
// 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>';
}

For SMF 2.0 RC2 version:

Code: [Select]
global $context, $settings;

if (!empty($context['fader_news_lines']))
{
echo '
<div id="newsfader">
<ul class="reset" id="smfFadeScroller">';

foreach ($context['news_lines'] as $news)
echo '
<li>', $news, '</li>';

echo '
</ul>
</div>
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/fader.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var oNewsFader = new smf_NewsFader({
sSelf: \'oNewsFader\',
sFaderControlId: \'smfFadeScroller\',
sItemTemplate: ', JavaScriptEscape('<strong>%1$s</strong>'), ',
iFadeDelay: ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], '
});
// ]]></script>';
}
And slowly, you come to realize... It's all as it should be...

Offline Gurbet_42

  • Full Member
  • ***
  • Posts: 166
  • Gender: Male
    • Müziksiz ilahiler
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Make news block fade
« Reply #23 on: January 29, 2010, 05:57:07 PM »
Thanks   [SiNaN].
http://ilahivesohbet.com  -  Müziksiz ilahiler

Offline Nothingness

  • Jr. Member
  • **
  • Posts: 69
  • Gender: Male
  • I am...the architect of my own destruction...
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Make news block fade
« Reply #24 on: February 03, 2010, 11:12:56 PM »
Preview works but why am I getting "Syntax error in block code. Please check the code." when I apply the block.
"Do you wallow in self-pity, or do you learn to use the gifts God gave you and command fear and respect, and defend against those who would do us harm"

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Make news block fade
« Reply #25 on: February 04, 2010, 03:41:40 AM »
It might be a bug related to PHP validation, and your news content. You can disable PHP validation from Admin > SimplePortal > Configuration > General Settings > Disable PHP Validation. I suggest that you enable it back after you create the block.
And slowly, you come to realize... It's all as it should be...

Offline grafitus

  • Comrade
  • *
  • Posts: 1554
  • Gender: Male
  • just looking for own old energy
  • SMF Version: None
  • SP Version: None
Re: Make news block fade
« Reply #26 on: February 04, 2010, 05:50:26 AM »
Thanks for code [SiNaN]. I've tried, it works. :P
my modsI don't reply support PMs. Please use support forums.

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Make news block fade
« Reply #27 on: February 04, 2010, 06:52:03 AM »
Thanks for code [SiNaN]. I've tried, it works. :P

+1 It sure looks good too.
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline Nothingness

  • Jr. Member
  • **
  • Posts: 69
  • Gender: Male
  • I am...the architect of my own destruction...
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Make news block fade
« Reply #28 on: February 04, 2010, 10:00:13 AM »
Perfect, thank you [SiNaN]. It works. So this error will be fixed in the next update, no?
"Do you wallow in self-pity, or do you learn to use the gifts God gave you and command fear and respect, and defend against those who would do us harm"

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Make news block fade
« Reply #29 on: February 04, 2010, 10:20:56 AM »
It isn't easy to detect PHP syntax error and this is a rare case. But I'll keep that in mind, if I have a better solution.
And slowly, you come to realize... It's all as it should be...

Offline raffo

  • Jr. Member
  • **
  • Posts: 70
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Make news block fade
« Reply #30 on: May 19, 2010, 10:27:45 AM »
it works, but with some problems:

1) when the page loads, users see for a while all the news in the block, that after about 300 milliseconds resize itself

2) it always starts from the first news... it'd be nice to start from a random one adn goes to others always randomly (without repeting before finishing all of them)

3) the news block is too much high... is possible to make a little shorter in height? i inserted height:20px; to style of body, but then the news are unreadable, because appears a scroll sidebar on the side

4) when one news is longer than others, the block continues to resize every single news... :(

thanks
« Last Edit: May 19, 2010, 10:42:11 AM by raffo »

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Make news block fade
« Reply #31 on: May 19, 2010, 10:35:12 AM »
Raffo can you let us have a link to the forum please.

Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline raffo

  • Jr. Member
  • **
  • Posts: 70
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Make news block fade
« Reply #32 on: May 19, 2010, 10:41:25 AM »
here it's...

i 'll mantain it for some hours... :)
thanks

http://*********
« Last Edit: May 19, 2010, 11:06:17 AM by raffo »

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Make news block fade
« Reply #33 on: May 19, 2010, 10:46:16 AM »
The newsfaders resizing is automatic ie when a smiley or bold text is used.

Have you thought about making the text scroll across the page instead?

Have a look at the portal on www.mkaware.co.uk ( Announcements).

If you want to do it like that then I can point you in the right direction.
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline raffo

  • Jr. Member
  • **
  • Posts: 70
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Make news block fade
« Reply #34 on: May 19, 2010, 10:55:34 AM »
thanks, but i don't like the scrolling...

my problem was noticed when i choose the normal SMF news fading... it works only on forum and it is perfect... but it doesn't work on homepage of SP...

using, instead, just the top block of SP, in portal and forum, makes what we are talking about now... :(

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Make news block fade
« Reply #35 on: May 19, 2010, 10:57:26 AM »
No worries it's a preference thing.

Using the top block as you mentioned is another way of course.

Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline raffo

  • Jr. Member
  • **
  • Posts: 70
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Make news block fade
« Reply #36 on: May 19, 2010, 11:02:28 AM »
so, there isn't a way to replicate in the custom PHP block the same code that SMF use in forum news?

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Make news block fade
« Reply #37 on: May 19, 2010, 11:04:09 AM »
Will have to wait and hope someone who knows coding can help.

Sorry bud.  :-[
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline raffo

  • Jr. Member
  • **
  • Posts: 70
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Make news block fade
« Reply #38 on: May 19, 2010, 11:06:02 AM »
thanks man! :)

Offline Tricky

  • Semi Newbie
  • *
  • Posts: 27
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Make news block fade
« Reply #39 on: August 04, 2011, 08:06:37 AM »
Thanks [SiNaN] just what i was looking for