-
Notifications
You must be signed in to change notification settings - Fork 1
/
fader.php
67 lines (56 loc) · 2.4 KB
/
fader.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script>
// Ticker Constructor
news = new newsTicker();
// Initialize the Ticker, You need to supply the HTML id as the argument, returns true or false.
var result = news.initTicker('news_ticker');
// I have put in some safaty precautions, but just in case always check the return value from initTicker().
if (result == true)
{
// Set the width of the Ticker (in pixles)
news.Width(500);
// Gets the Width of the Ticker (in pixles)
var width = news.Width();
// Sets the Interval/Update Time in seconds.
news.Interval(5);
// Gets the Interval/Update Time in Seconds.
var interval = news.Interval();
// I have decided on adding single news articles at a time due to it makes it more easier to add when using PHP or XSL.
// We can supply the information by either of the following ways:
// 1: Supply the information from a Database and inserting it with PHP.
// 2: Supply the information from a Database and convert it into XML (for formatting) and have the XSLT Stylesheet extract the information and insert it.
<?php
global $db_logging;
$startdate = date("Y/m/d");
$res = $db->Execute("SELECT * FROM {$db->prefix}news WHERE date > '{$startdate} 00:00:00' AND date < '{$startdate} 23:59:59' ORDER BY news_id");
db_op_result ($db, $res, __LINE__, __FILE__, $db_logging);
if ($res->EOF)
{
echo " url = 'news.php';\n";
echo " text = \"{$l->get('l_news_none')}\";\n";
echo " type = null; // Not used as yet.\n";
echo " delay = 5; // in seconds.\n";
echo " news.addArticle(url, text, type, delay);\n";
}
else
{
while (!$res->EOF)
{
$row = $res->fields;
$headline = addslashes($row['headline']);
echo " url = 'news.php';\n";
echo " text = '{$headline}';\n";
echo " type = '{$row['news_type']}'; // Not used as yet.\n";
echo " delay = 5; // in seconds.\n";
echo " news.addArticle(url, text, type, delay);\n";
echo "\n";
$res->MoveNext();
}
echo " news.addArticle(null, 'End of News', null, 5);\n";
}
?>
// Starts the Ticker.
news.startTicker();
// If for some reason you need to stop the Ticker use the following line.
// news.stopTicker();
}
</script>