SimplePortal

Customization => Custom Coding => Topic started by: [dx] on November 20, 2008, 09:54:50 PM

Title: Board News Block Setting up News
Post by: [dx] on November 20, 2008, 09:54:50 PM
Hi there :)

I was wondering if somehow can be done that those Topic Names from Board News Block can be written in news base.

So let say, for example:

I choose to show 10 topics in board news block and each topic name is written to news db. Hope you understand what I'm saying about.

Later i'll use news in <marquee> to scrool latest news :]

Thanks in advance.
Title: Re: Board News Block Setting up News
Post by: bvs on November 21, 2008, 10:12:44 AM
I have done it using a PHP Block by placing a call to "board news" block  between marquee tag.

 sp_boardnews(32.0); 

As I use one board exclusively for the latest news, I don't have to filter it further. 

Hope this would help you
 
 :)

cheers!


Title: Re: Board News Block Setting up News
Post by: [dx] on November 21, 2008, 10:45:02 AM
Not really, can you show me your script
Title: Re: Board News Block Setting up News
Post by: bvs on November 21, 2008, 10:57:26 AM
other than the call to sp_boardnews function which is part of SP standard functions, the remaing code is for the marquee. Please note that  I found the HTML version of  this marquee script at  www.dynamicdrive.com and had to convert to pure PHP to put it in a PHP block.

Code: [Select]
echo "<style type='text/css'>";
echo "";
echo "#marqueecontainer{";
echo "position: relative;";
echo "width: 200px; /*marquee width */";
echo "height: 200px; /*marquee height */";
echo "background-color: white;";
echo "overflow: hidden;";
echo "border: 3px solid orange;";
echo "padding: 2px;";
echo "padding-left: 4px;";
echo "}";
echo "";
echo "</style>";
echo "";
echo "<script type='text/javascript'>";
echo "";
echo "/***********************************************";
echo "* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)";
echo "* This notice MUST stay intact for legal use";
echo "* Visit http://www.dynamicdrive.com/ for this script and 100s more.";
echo "***********************************************/";
echo "";
echo "var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)";
echo "var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)";
echo "var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?";
echo "";
echo "////NO NEED TO EDIT BELOW THIS LINE////////////";
echo "";
echo "var copyspeed=marqueespeed";
echo "var pausespeed=(pauseit==0)? copyspeed: 0";
echo "var actualheight=''";
echo "";
echo "function scrollmarquee(){";
echo "if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))";
echo "cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+'px'";
echo "else";
echo "cross_marquee.style.top=parseInt(marqueeheight)+8+'px'";
echo "}";
echo "";
echo "function initializemarquee(){";
echo "cross_marquee=document.getElementById('vmarquee')";
echo "cross_marquee.style.top=0";
echo "marqueeheight=document.getElementById('marqueecontainer').offsetHeight";
echo "actualheight=cross_marquee.offsetHeight";
echo "if (window.opera || navigator.userAgent.indexOf('Netscape/7')!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit";
echo "cross_marquee.style.height=marqueeheight+'px'";
echo "cross_marquee.style.overflow='scroll'";
echo "return";
echo "}";
echo "setTimeout('lefttime=setInterval('scrollmarquee()',30)', delayb4scroll)";
echo "}";
echo "";
echo "if (window.addEventListener)";
echo "window.addEventListener('load', initializemarquee, false)";
echo "else if (window.attachEvent)";
echo "window.attachEvent('onload', initializemarquee)";
echo "else if (document.getElementById)";
echo "window.onload=initializemarquee";
echo "";
echo "";
echo "</script>";
echo "";
echo "<div id='marqueecontainer' onMouseover='copyspeed=pausespeed' onMouseout='copyspeed=marqueespeed'>";
echo "<div id='vmarquee' style='position: absolute; width: 98%;'>";
echo "";
echo "<!--YOUR SCROLL CONTENT HERE-->";
echo "";
echo "<h4>Your scroller contents</h4>";
echo "This is just for testing ,,";
sp_boardnews(32.0);
echo "<!--YOUR SCROLL CONTENT HERE-->";
echo "";
echo "</div>";
echo "</div>";
echo "";
echo "";

Good luck!
Title: Re: Board News Block Setting up News
Post by: [dx] on November 21, 2008, 11:29:57 AM
I've searched in ManagaNews.php file from Source folder and found this

updateSettings(array('news' => implode("\n", $_POST['news'])));

Could be used in New Block when reading last news to update or something.

Any help :)
Title: Re: Board News Block Setting up News
Post by: ibm450 on November 21, 2008, 07:14:11 PM
dosnt scroll, whats it meant to do??
Title: Re: Board News Block Setting up News
Post by: [dx] on November 23, 2008, 10:53:43 AM
dosnt scroll, whats it meant to do??

What?

----------------

So, something can be done with setting up news?

Regards
Title: Re: Board News Block Setting up News
Post by: [dx] on December 07, 2008, 05:01:15 AM
Something about?
Title: Re: Board News Block Setting up News
Post by: [dx] on December 17, 2008, 08:40:21 AM
Bump.
SimplePortal 2.3.8 © 2008-2024, SimplePortal