Top
Home

###################################################
##############  NewsRoll.php ##############
###################################################
###################################################

<?php
$file = "NewsRoller.xml";
$ROOT = simplexml_load_file($file) or die ("Yikes!");

/* EEE */

$Delay=$ROOT->CHANNEL->ITEM->Delay;
$Width=$ROOT->CHANNEL->ITEM->Width;
$Height=$ROOT->CHANNEL->ITEM->Height;
$Color=$ROOT->CHANNEL->ITEM->Color;
$BGImage=$ROOT->CHANNEL->ITEM->BGImage;
$slide01=$ROOT->CHANNEL->ITEM->slide01;
$slide02=$ROOT->CHANNEL->ITEM->slide02;
$slide03=$ROOT->CHANNEL->ITEM->slide03;
$slide04=$ROOT->CHANNEL->ITEM->slide04;
$slide05=$ROOT->CHANNEL->ITEM->slide05;
$slide06=$ROOT->CHANNEL->ITEM->slide06;
$slide07=$ROOT->CHANNEL->ITEM->slide07;
$slide08=$ROOT->CHANNEL->ITEM->slide08;
$slide09=$ROOT->CHANNEL->ITEM->slide09;
$slide10=$ROOT->CHANNEL->ITEM->slide10;
$padding=$ROOT->CHANNEL->ITEM->padding;
?>
<style>
.news{padding:<?php echo $padding; ?>px;}
</style>
<!-- FFF -->

<script type="text/javascript">

var scrollerdelay='<?php echo $Delay; ?>' //delay between msg scrolls. 3000=3 seconds.
var scrollerwidth='<?php echo $Width; ?>px'
var scrollerheight='<?php echo $Height; ?>px'
var scrollerbgcolor='<?php echo $Color; ?>'
var scrollerbackground='<?php echo $BGImage; ?>'

//configure the below variable to change the contents of the scroller
var messages=new Array()

<?php if (strlen($slide01) > 1){ ?>messages[0]="<div class=news><FONT FACE='Arial'><?php echo $slide01; ?></FONT></div>"<?php } ?>

<?php if (strlen($slide02) > 1){ ?>messages[1]="<div class=news><FONT FACE='Arial'><?php echo $slide02; ?></FONT></div>"<?php } ?>

<?php if (strlen($slide03) > 1){ ?>messages[2]="<div class=news><FONT FACE='Arial'><?php echo $slide03; ?></FONT></div>"<?php } ?>

<?php if (strlen($slide04) > 1){ ?>messages[3]="<div class=news><FONT FACE='Arial'><?php echo $slide04; ?></FONT></div>"<?php } ?>

<?php if (strlen($slide05) > 1){ ?>messages[4]="<div class=news><FONT FACE='Arial'><?php echo $slide05; ?></FONT></div>"<?php } ?>

<?php if (strlen($slide06) > 1){ ?>messages[5]="<div class=news><FONT FACE='Arial'><?php echo $slide06; ?></FONT></div>"<?php } ?>

<?php if (strlen($slide07) > 1){ ?>messages[6]="<div class=news><FONT FACE='Arial'><?php echo $slide07; ?></FONT></div>"<?php } ?>

<?php if (strlen($slide08) > 1){ ?>messages[7]="<div class=news><FONT FACE='Arial'><?php echo $slide08; ?></FONT></div>"<?php } ?>

<?php if (strlen($slide09) > 1){ ?>messages[8]="<div class=news><FONT FACE='Arial'><?php echo $slide09; ?></FONT></div>"<?php } ?>

<?php if (strlen($slide10) > 1){ ?> messages[9]="<div class=news><FONT FACE='Arial'><?php echo $slide10; ?></FONT></div>"<?php } ?>

//////Do not edit pass this line///////////////////////

var ie=document.all
var dom=document.getElementById
if (messages.length>2)
i=2
else
i=0
function move(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
tdiv.style.top=0+"px"
setTimeout("move(tdiv)",scrollerdelay)
setTimeout("move2(second2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
setTimeout("move(tdiv)",50)
}
else{
tdiv.style.top=parseInt(scrollerheight)+"px"
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function move2(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
tdiv2.style.top=0+"px"
setTimeout("move2(tdiv2)",scrollerdelay)
setTimeout("move(first2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
setTimeout("move2(second2_obj)",50)
}
else{
tdiv2.style.top=parseInt(scrollerheight)+"px"
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function startscroll(){
first2_obj=ie? first2 : document.getElementById("first2")
second2_obj=ie? second2 : document.getElementById("second2")
move(first2_obj)
second2_obj.style.top=scrollerheight
second2_obj.style.visibility='visible'
}
if (ie||dom){
document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:4px;top:0px">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
document.write(messages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
if (window.addEventListener)
window.addEventListener("load", startscroll, false)
else if (window.attachEvent)
window.attachEvent("onload", startscroll)
else if (ie||dom)
window.onload=startscroll

</script>

###################################################
##############  NewsRoller.php ##############
###################################################
###################################################

<?php
error_reporting(0);
$submit=$_POST['submit'];

/* AAA */

$Delay=$_POST['Delay'];
$Width=$_POST['Width'];
$Height=$_POST['Height'];
$Color=$_POST['Color'];
$padding=$_POST['padding'];
$BGImage=$_POST['BGImage'];
$slide01=$_POST['slide01'];
$slide02=$_POST['slide02'];
$slide03=$_POST['slide03'];
$slide04=$_POST['slide04'];
$slide05=$_POST['slide05'];
$slide06=$_POST['slide06'];
$slide07=$_POST['slide07'];
$slide08=$_POST['slide08'];
$slide09=$_POST['slide09'];
$slide10=$_POST['slide10'];

if(isset($submit)){
$file = "NewsRoller.xml";
$ROOT = simplexml_load_file($file) or die ("Yikes!!");

/* BBB */

$ROOT->CHANNEL->ITEM->Delay ="$Delay";
$ROOT->CHANNEL->ITEM->Width ="$Width";
$ROOT->CHANNEL->ITEM->Height ="$Height";
$ROOT->CHANNEL->ITEM->Color ="$Color";
$ROOT->CHANNEL->ITEM->padding ="$padding";
$ROOT->CHANNEL->ITEM->BGImage ="$BGImage";
$ROOT->CHANNEL->ITEM->slide01 ="$slide01";
$ROOT->CHANNEL->ITEM->slide02 ="$slide02";
$ROOT->CHANNEL->ITEM->slide03 ="$slide03";
$ROOT->CHANNEL->ITEM->slide04 ="$slide04";
$ROOT->CHANNEL->ITEM->slide05 ="$slide05";
$ROOT->CHANNEL->ITEM->slide06 ="$slide06";
$ROOT->CHANNEL->ITEM->slide07 ="$slide07";
$ROOT->CHANNEL->ITEM->slide08 ="$slide08";
$ROOT->CHANNEL->ITEM->slide09 ="$slide09";
$ROOT->CHANNEL->ITEM->slide10 ="$slide10";

file_put_contents($file, $ROOT->asXML());
}
?>

<?php
$file = "NewsRoller.xml";
$ROOT = simplexml_load_file($file) or die ("Yikes!");
?>

<form name="FearDearg" action="NewsRoller.php" method="post">
<table border="0" cellpadding="0" cellspacing="2" width="122">

<!-- CCC -->

<tr>
<td><p align=right><nobr>Delay Time</td>
<td><input type="text" name="Delay" size="24" value="<?php echo $Delay; ?>"> </td>
</tr>
<tr>
<td><p align=right><nobr>Scroller Width</td>
<td><input type="text" name="Width" size="24" value="<?php echo $Width; ?>"> </td>
</tr>
<tr>
<td><p align=right><nobr>Scroller Height</td>
<td><input type="text" name="Height" size="24" value="<?php echo $Height; ?>"> </td>
</tr>
<tr>
<td><p align=right><nobr>Background Color</td>
<td><input type="text" name="Color" size="24" value="<?php echo $Color; ?>"> </td>
</tr>
<tr>
<td><p align=right><nobr>Padding</td>
<td><input type="text" name="padding" size="24" value="<?php echo $padding; ?>"> </td>
</tr>
<tr>
<td><p align=right><nobr>BG Image URL</td>
<td><input type="text" name="BGImage" size="54" value="<?php echo $BGImage; ?>"> </td>
</tr>
<tr>
<td valign=top><p align=right><nobr>Message 01</td>
<td> <TEXTAREA id="styled" NAME="slide01" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide01; ?></TEXTAREA> </td></tr>
<tr>

<tr>
<td valign=top><p align=right><nobr>Message 02</td>
<td> <TEXTAREA id="styled" NAME="slide02" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide02; ?></TEXTAREA> </td>
</tr>
<tr>

<tr>
<td valign=top><p align=right><nobr>Message 03</td>
<td><TEXTAREA id="styled" NAME="slide03" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide03; ?></TEXTAREA> </td>
</tr>
<tr>

<tr>
<td valign=top><p align=right><nobr>Message 04</td>
<td><TEXTAREA id="styled" NAME="slide04" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide04; ?></TEXTAREA> </td>
</tr>
<tr>

<tr>
<td valign=top><p align=right><nobr>Message 05</td>
<td><TEXTAREA id="styled" NAME="slide05" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide05; ?></TEXTAREA> </td>
</tr>
<tr>

<tr>
<td valign=top><p align=right><nobr>Message 06</td>
<td><TEXTAREA id="styled" NAME="slide06" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide06; ?></TEXTAREA> </td>
</tr>
<tr>

<tr>
<td valign=top><p align=right><nobr>Message 07</td>
<td><TEXTAREA id="styled" NAME="slide07" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide07; ?></TEXTAREA> </td>
</tr>
<tr>

<tr>
<td valign=top><p align=right><nobr>Message 08</td>
<td><TEXTAREA id="styled" NAME="slide08" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide08; ?></TEXTAREA> </td>
</tr>
<tr>

<tr>
<td valign=top><p align=right><nobr>Message 09</td>
<td><TEXTAREA id="styled" NAME="slide09" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide09; ?></TEXTAREA> </td>
</tr>
<tr>

<tr>
<td valign=top><p align=right><nobr>Message 10</td>
<td><TEXTAREA id="styled" NAME="slide10" ROWS="5" COLS="54" WRAP="virtual"> <?php echo $slide10; ?></TEXTAREA> </td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit"></td>
</tr>
</table>
</form>