<code>
Place scroller.txt (writeable for you're webserver)
and scroller.php in a directory, adjust HTML code
and you're set to go
Include in the file where you want the scroller to
appear the following IFRAME:
<IFRAME FRAMEBORDER=0 src='scroller.php' SCROLLING=no HEIGHT=18 WIDTH="100%" MARGINWIDTH=0 MARGINHEIGHT=0>
</IFRAME>
File: Scroller.txt (9 lines)
------------------
klik op de scroller om jouw tekst toe te voegen
1
2
3
4
5
6
7
8
File: Scroller.php
------------------
<?
#
# Scroller.php
# Copyright (c) 2003 by CoMPa Technology
# http://www.compa.nl
#
# Designed for http://www.wilhelmina.org
# and all others who like the functionality
#
# Start session (for keeping track and not letting
# users fill up the string
session_start();
# Get variables
$act=$_GET['act'];
$info=$_POST['info'];
# What file to keep the text's in
$file="./scroller.txt";
# What seperator to use (can be html text)
$sep="<img alt='' src='w16logo.gif' height=10>";
if ( $act == "" )
{
if (is_file($file)) {
$content=file($file);
$arraycount=count($content);
while ( $arraycount != 0 ) {
$scroller = $scroller2;
$arraycount--;
$line=preg_replace("/(<.+?>)/", "", $content[$arraycount]);
$scroller2 = "$line $sep $scroller";
}
$scroller = "$sep <font color=#0000ff><i>$line</i></font> $sep $scroller <font color=#0000ff><i>$line</i></font> $sep";
?>
<!-- !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" -->
<!-- link rel="stylesheet" type="text/css" href="inc/w16.css" -->
<!-- link rel="stylesheet" type="text/css" href="inc/nomargin.css" -->
<marquee style="cursor: default" onclick="window.open('scroller.php?act=edit','edit',config='height=200,width=300,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=no');" hspace=0 vspace=0 scrollamount=6 onmouseover=stop(this); onmouseout=start(this);>
<?php echo "$scroller";?>
</marquee>
<?
}
exit;
}
if ( $act == "edit" && $_SESSION['scroller_post'] != "true" )
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<link rel="stylesheet" type="text/css" href="inc/w16.css">
<BODY onload=document.forms[0].elements[0].focus();>
<DIV ALIGN=CENTER>
<FORM METHOD=POST ACTION="scroller.php?act=add">
<FONT SIZE=6>Jouw tekst:</FONT><BR>
<INPUT TYPE=TEXT NAME=info SIZE=30 MAXLENGTH=40><BR>
<INPUT TYPE=SUBMIT VALUE="Toevoegen">
</FORM>
</DIV>
</BODY>
</HTML>
<?
} elseif ( $_SESSION['scroller_post'] == "true" ) {
?>
<script type="text/javascript">alert('Je hebt al iets toegevoegd, voor discussies, ga naar het forum');</script>
<BODY onload="self.close()">
<?
}
if ( $act == "add" )
{
$_SESSION['scroller_post']="true";
if ($content=file($file)) {
# Leave first two intact, reroute all others
$i=1;
while ($i<8) { $content[$i]=$content[$i+1]; $i++; }
# add new one
$content[8]=$info."\n";
$file=fopen($file,'w');
$i=0; $contentsize=9;
while ($i<=$contentsize) {
$content[$i]=preg_replace("/(<.+?>)/", "", $content[$i]);
$content[$i]=stripslashes($content[$i]);
fputs($file,$content[$i]);
$i++;
}
fclose($file);
}
?>
<BODY onload="window.opener.navigate(window.opener.document.location.href); self.close()">
<?
}
exit;
?>
</code>