Help with stock Ticker in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dotty
Forum Newbie
Posts: 1
Joined: Tue Sep 23, 2008 2:14 am

Help with stock Ticker in PHP

Post by dotty »

Hi, am a total newbie to this,so someone pls help me out...I have the following applet for a stock ticker(taken online).......I need to edit this code so that it displays stock quotes from the Kuwait Stock Exchange.......site is http://www.kuwaitse.com......hope someone will be patient enough to edit this code for me ..thanks a lot

<APPLET ID="TickerX" NAME="TickerX" Note the addition of the ID attribute!
CODE="Ticker.class"
ARCHIVE="Ticker.jar"
CODEBASE="http://java.barchart.com/ticker"
HEIGHT="40"
WIDTH="450"
>
<PARAM NAME="panels" VALUE="1">

<PARAM NAME="1:symbols" VALUE="'Indices,$NASX:Nasdaq Comp,'Stocks,IBM,GE,EBAY,YHOO:Yahoo!">
<PARAM NAME="1:scroll" VALUE="-1, 50">
<PARAM NAME="1:bgcolor" VALUE="#000000">
<PARAM NAME="1:fgcolor" VALUE="#FFFFFF">
<PARAM NAME="1scolor" VALUE="#00CC00">
<PARAM NAME="1:ngcolor" VALUE="#FF3333">
<PARAM NAME="1:hilight" VALUE="#FFFF00">
<PARAM NAME="1:font" VALUE="Arial, Bold, 12">
<PARAM NAME="1:multiline" VALUE="true">
</APPLET>

<SCRIPT LANGUAGE="JavaScript">
// Set the initDelay and initDIrection to be the same as the values defined in the params
var initDelay = 50;
var initDirection = -1;

var curDelay = initDelay;
var curDirection = initDirection;

function changeScroll(dir) {
// Calling changeScroll with the same dir makes the ticker go faster
if (dir == 0) {
curDelay = 0;
curDirection = 0;
}
else if (dir == curDirection)
curDelay -= 10;
else {
curDirection = dir;
curDelay = initDelay;
}

// You can't have a negative delay. And some rational limit must be set
if (curDelay < 5)
curDelay = 5;

var a = document.getElementById('TickerX');
if (a) {
a.setScroll(1, curDirection, curDelay);
}
}
</SCRIPT>

<A HREF="javascript:changeScroll(-1);"> &lt</A> • <A HREF="javascript:changeScroll(0);">0</A> • <A HREF="javascript:changeScroll(1);">&gt</A>
Post Reply