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: 264
  • 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]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

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

0 Members and 1 Guest are viewing this topic.

Offline stikkki

  • Semi Newbie
  • *
  • Posts: 14
    • Eots Dzine
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Make news block fade
« on: March 26, 2009, 09:21:47 AM »
im building a forum for a charity organisation and i would like the news block to fade like the news fader on the forum rather than the news changing on page refresh

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Make news block fade
« Reply #1 on: April 08, 2009, 03:46:56 AM »
Put the following code into a Custom PHP block:
Code: [Select]
global $context, $settings;

echo '
<div id="sp_news_fader_', $id, '" class="sp_center sp_fullwidth"><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(\'sp_news_fader_', $id, '\').currentStyle) != "undefined")
{
foreColor = document.getElementById(\'sp_news_fader_', $id, '\').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(\'sp_news_fader_', $id, '\');
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(\'sp_news_fader_', $id, '\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'sp_news_fader_', $id, '\');
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>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
smfFadeScroller = document.getElementById(\'sp_news_fader_', $id, '\');
// ]]></script>';
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline stikkki

  • Semi Newbie
  • *
  • Posts: 14
    • Eots Dzine
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Make news block fade
« Reply #2 on: April 10, 2009, 09:26:58 AM »
this didnt work and actually didnt change the news even on refresh

Offline dougsbrat

  • Jr. Member
  • **
  • Posts: 55
  • Pull my finger!
Re: Make news block fade
« Reply #3 on: April 10, 2009, 10:25:18 AM »
I tried it and its great!  ;D thanks

be sure you have more than one news message for it to fade to, else one will be as shown with no fade.


I have another request for this...
is it possible for the block size to be fixed?
because:
when using the fade and the news items are not the same height (text lines or image) then the block size changes as each is shown, causing the lower blocks to move too  :'(


thanks for a good block

Offline stikkki

  • Semi Newbie
  • *
  • Posts: 14
    • Eots Dzine
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Make news block fade
« Reply #4 on: April 10, 2009, 11:01:44 AM »
be sure you have more than one news message for it to fade to, else one will be as shown with no fade.

lol im not that think

i have 3 news items set up
i created a php block, added the above code and placed it in top block position but it only displays the first news item

http://www.somersetstaffies.org.uk/index.php

Offline dougsbrat

  • Jr. Member
  • **
  • Posts: 55
  • Pull my finger!
Re: Make news block fade
« Reply #5 on: April 10, 2009, 12:31:22 PM »
I gues I am   ;D cause I only had one news item and took a minute to figure it out.

BTW I use
SMF 1.1.8 and see you have 2.0
perhaps its that or a server setting?

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Make news block fade
« Reply #6 on: April 11, 2009, 03:21:56 AM »
Use the code below for SMF 2 RC1:
Code: [Select]
   global $context, $settings;

   echo '
                        <div id="smfNewsFader"><div id="smfFadeScroller" class="sp_center sp_fullwidth"><span>', $context['news_lines'][0], '</span></div></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, foreEl, 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")
{

foreEl = document.getElementById(\'smfFadeScroller\');

while (document.defaultView.getComputedStyle(foreEl, null).getPropertyCSSValue("color") == null && typeof(foreEl.parentNode) != "undefined" && typeof(foreEl.parentNode.tagName) != "undefined")
foreEl = foreEl.parentNode;

foreColor = document.defaultView.getComputedStyle(foreEl, null).getPropertyValue("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).getPropertyCSSValue("background-color") == null && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;

backColor = document.defaultView.getComputedStyle(backEl, null).getPropertyValue("background-color");//.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'], '/scripts/fader.js"></script>';
« Last Edit: April 11, 2009, 03:26:14 AM by LHVWB »
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline stikkki

  • Semi Newbie
  • *
  • Posts: 14
    • Eots Dzine
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Make news block fade
« Reply #7 on: April 11, 2009, 08:44:39 AM »
sorry i should of said it was 2.0

that worked fine LHVWB, thanx

Offline geekfairy

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: Make news block fade
« Reply #8 on: May 03, 2009, 10:34:36 PM »
This works beautifully :)

Is there any way to not show titles/names of certain blocks?

I'm using this one to show some banners but would prefer it not to have to have a title sitting on the top of the block.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Make news block fade
« Reply #9 on: May 04, 2009, 12:33:08 AM »
Check the 'No Title' checkbox under the 'Style Options' area, when you edit a block.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline geekfairy

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: Make news block fade
« Reply #10 on: May 04, 2009, 12:38:41 AM »
 :-[ I thought I'd seen it there somewhere.

Not feeling well today...that's my only excuse  :P

Oh, and thankyou! :)


Offline geekfairy

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: Make news block fade
« Reply #11 on: May 04, 2009, 04:31:34 AM »
Is there a way to fix the height of the news block? I am finding that in Firefox, the first time a page is loaded the news block jumps as it fades to nothing and the next banner fades in. I only have three banners on there right now and once it has cycled through once it is fine.

I had the same problem with the SMF news fader and that was solved by editing the template files to fix the height of the news box. What would I need to edit to do the same with this block?

Thanks :)

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Make news block fade
« Reply #12 on: May 04, 2009, 05:09:32 AM »
Use the style options, you should be able to add 'height:20px;' to the style parameter for the body of the block.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline geekfairy

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: Make news block fade
« Reply #13 on: May 04, 2009, 05:25:10 AM »
Perfect  :D

Thanks so much. I'm really loving SP  :D

Offline Chit-Chat ChatterBox Boss

  • Semi Newbie
  • *
  • Posts: 9
  • SMF Version: 2 RC1
  • SP Version: 2.2
Re: Make news block fade
« Reply #14 on: May 15, 2009, 02:07:38 PM »
Sweet thanks!
« Last Edit: May 15, 2009, 03:25:23 PM by cafontaine »

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Make news block fade
« Reply #15 on: June 16, 2009, 12:06:53 AM »
Put the following code into a Custom PHP block:
Brilliant! Works like a charm.  Thanks!
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline primetime

  • Semi Newbie
  • *
  • Posts: 8
  • SMF Version: 2 RC1
  • SP Version: 2.2.2
Re: Make news block fade
« Reply #16 on: July 10, 2009, 05:37:00 PM »
Works great!!

Offline amlucent

  • Jr. Member
  • **
  • Posts: 65
  • Gender: Male
    • The Good Old Days [Old] Guild
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Make news block fade
« Reply #17 on: July 18, 2009, 03:25:59 AM »
When I use the code for SMF 2.0 it only fades on the board index..  I have my news block set to show up on "all pages"... can I make it fade everywhere?
« Last Edit: July 18, 2009, 01:16:21 PM by amlucent »

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 #18 on: January 05, 2010, 03:38:16 PM »
Not fades on 2.0 RC but fades on forum.
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 #19 on: January 17, 2010, 05:06:44 AM »
I'm getting error "Syntax error in block code. Please check the code." when adding the code. I am on 2.0 RC2
SimplePortal 2.3.1
"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 #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