Location: PHPKode > projects > Quantum Game Library for PHP > Quantum_Star_SE-2.2.0-RC2/news_scroll.php






// this file is deprecated - I'd try figuring out why still included but who could tell? MtR )24 Mar 2004(










//slider's width
var swidth=150

//slider's height
var sheight=72

//slider's speed
var sspeed=2

//messages: change to your own; use as many as you'd like; set up Hyperlinks to URLs as you normally do: <a target=... href="... URL ...">..message..</a>
var singletext=new Array()

<?
require("g_d.php");
require("$games_dir/config.dat.php");
if(!isset($db_name) || $db_name == "")
{
  $db_name = $db;
}
$link = mysql_connect("$database_host","$database_user","$database_password");
mysql_select_db(__FILE__,__LINE__,$database);
function db(__FILE__,__LINE__,$string) {
  global $query;
  $query = mysql_query($string) or mysql_die($string);
}
function dbr() {
  global $query;
  return mysql_fetch_array($query);
}
function mysql_die($string) {
	echo "Database Failure.<br /><br />Query:<br />$string<br /><br /> MySQL Error Num:<br />".mysql_errno()."<br /><br />Mysql Error:<br />".mysql_error();
	exit;
}
db(__FILE__,__LINE__,"select * from ${db_name}_news order by timestamp desc limit 10");
$cnt = 0;
while($news_itms = dbr()) {
	echo("singletext[$cnt]='<div align=\"center\">".date("M d - H:i",$news_itms[timestamp])."<br />".stripslashes($news_itms[headline])."</div>'");
	$cnt = $cnt + 1;
}
?>

if (singletext.length>1)
i=1
else
i=0
function start(){
if (document.all){
ieslider1.style.top=sheight
iemarquee(ieslider1)
}
else if (document.layers){
document.ns4slider.document.ns4slider1.top=sheight
document.ns4slider.document.ns4slider1.visibility='show'
ns4marquee(document.ns4slider.document.ns4slider1)
}
else if (document.getElementById&&!document.all){
document.getElementById('ns6slider1').style.top=sheight
ns6marquee(document.getElementById('ns6slider1'))
}
}
function iemarquee(whichdiv){
iediv=eval(whichdiv)
if (iediv.style.pixelTop>0&&iediv.style.pixelTop<=sspeed){
iediv.style.pixelTop=0
setTimeout("iemarquee(iediv)",100)
}
if (iediv.style.pixelTop>=sheight*-1){
iediv.style.pixelTop-=sspeed
setTimeout("iemarquee(iediv)",100)
}
else{
iediv.style.pixelTop=sheight
iediv.innerHTML=singletext[i]
if (i==singletext.length-1)
i=0
else
i++
}
}
function ns4marquee(whichlayer){
ns4layer=eval(whichlayer)
if (ns4layer.top>0&&ns4layer.top<=sspeed){
ns4layer.top=0
setTimeout("ns4marquee(ns4layer)",100)
}
if (ns4layer.top>=sheight*-1){
ns4layer.top-=sspeed
setTimeout("ns4marquee(ns4layer)",100)
}
else{
ns4layer.top=sheight
ns4layer.document.write(singletext[i])
ns4layer.document.close()
if (i==singletext.length-1)
i=0
else
i++
}
}
function ns6marquee(whichdiv){
ns6div=eval(whichdiv)
if (parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed){
ns6div.style.top=0
setTimeout("ns6marquee(ns6div)",100)
}
if (parseInt(ns6div.style.top)>=sheight*-1){
ns6div.style.top=parseInt(ns6div.style.top)-sspeed
setTimeout("ns6marquee(ns6div)",100)
}
else{
ns6div.style.top=sheight
ns6div.innerHTML=singletext[i]
if (i==singletext.length-1)
i=0
else
i++
}
}
//  End -->
Return current item: Quantum Game Library for PHP