gpigate
07-16-2007, 03:12 PM
http://www.dynamicdrive.com/dynamicindex2/expandticker2.htm
I am trying to modify the ticker that George provided to pull the ticker contents from a mysql database. I have done this before in other tickers but for some reason I just can't get this one to work. I am not the best with javascript so feel free to laugh.
top of the page
<?php
$ticker = mysql_query("SELECT * FROM table_ticker WHERE display =1 ORDER BY display_order");
if (mysql_num_rows($ticker)>0) {
then body and style... then script
<script language="JavaScript1.2">
/***********************************************
* George's Expandable Ticker- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
//configure tickercontents[] to set the messges you wish be displayed (HTML codes accepted)
var tickercontents=new Array()
<?php
$i = 0;
while ($tick = mysql_fetch_array($ticker)) {
?>
tickercontents[<?php echo $i?>]='<?php echo $tick['content']?>'
<?php
$i++;
}
?>
This is how it is originally done in the ticker
var tickercontents=new Array()
tickercontents[0]='enter text here'
tickercontents[1]='more text here'
any help or ideas would be greatly appreciated.
I am trying to modify the ticker that George provided to pull the ticker contents from a mysql database. I have done this before in other tickers but for some reason I just can't get this one to work. I am not the best with javascript so feel free to laugh.
top of the page
<?php
$ticker = mysql_query("SELECT * FROM table_ticker WHERE display =1 ORDER BY display_order");
if (mysql_num_rows($ticker)>0) {
then body and style... then script
<script language="JavaScript1.2">
/***********************************************
* George's Expandable Ticker- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
//configure tickercontents[] to set the messges you wish be displayed (HTML codes accepted)
var tickercontents=new Array()
<?php
$i = 0;
while ($tick = mysql_fetch_array($ticker)) {
?>
tickercontents[<?php echo $i?>]='<?php echo $tick['content']?>'
<?php
$i++;
}
?>
This is how it is originally done in the ticker
var tickercontents=new Array()
tickercontents[0]='enter text here'
tickercontents[1]='more text here'
any help or ideas would be greatly appreciated.