aboutsummaryrefslogtreecommitdiff
path: root/modules/newsreel
diff options
context:
space:
mode:
Diffstat (limited to 'modules/newsreel')
-rw-r--r--modules/newsreel/index.php41
1 files changed, 23 insertions, 18 deletions
diff --git a/modules/newsreel/index.php b/modules/newsreel/index.php
index 0a986c2..70b9958 100644
--- a/modules/newsreel/index.php
+++ b/modules/newsreel/index.php
@@ -8,22 +8,21 @@ var slide=new Array(); //declares a new array called banner
var x=0; //loop control and array counting variable
var timing=7000; //value is in milliseconds, used for 3 seconds on each image
<?php
+ global $db;
$x=0;
- $get_slides = mysql_query("SELECT * FROM `bayonet_newsreel` WHERE `visible`= 1 ORDER BY `weight` ASC LIMIT 0,6");
+ $result = $db->Query("SELECT * FROM `bayonet_newsreel` WHERE `visible`= 1 ORDER BY `weight` ASC LIMIT 0,6");
//$get_slides = mysql_query("SELECT * FROM `news_slideshow` WHERE `visible`=1");
-
- while($echo_slides = mysql_fetch_array($get_slides)){
-
+ $row = $db->fetch($result);
+
+ foreach($row as $slide){
echo 'slide['.$x.']=new Image();';
- echo 'slide['.$x.'].src="modules/newsreel/slides/'.$echo_slides['src'].'";';
- if($x==0){
- $startSRC=$echo_slides['src'];
- }
- $x++;
-
+ echo 'slide['.$x.'].src="modules/newsreel/slides/'.$slide['src'].'";';
+ if($x==0){
+ $startSRC=$slide['src'];
+ }
+ $x++;
}
-
$width = 100/$x;
?>
@@ -75,10 +74,9 @@ var timing=7000; //value is in milliseconds, used for 3 seconds on each image
nextSlide(x,false)
x++;
}
- <?php
- echo' if(x=='.$x.'){
- x=0;}';
- ?>
+ if(x==<?php echo $x; ?>){
+ x=0;
+ }
var timerId=setTimeout("playBanner()", timing);
}
}
@@ -95,16 +93,23 @@ window.onload = init_Slides; //starts the reels movement
<div class="content1"><div class="content2">
<img src="modules/newsreel/slides/<?php echo $startSRC; ?>" name="myBanner" alt="newsreel" />
- <table border="0" cellspacing="0" cellpadding="0" height="21px" width="100%">
+ <table border="0" cellspacing="0" cellpadding="0" style="height:21px;" width="100%">
<tr>
<?php
-$y=0;
+$y=0; /*
$get_slidenav = mysql_query("SELECT * FROM `bayonet_newsreel` WHERE `visible`= 1 ORDER BY `weight` ASC LIMIT 0, 6");
while($echo_slidenav = mysql_fetch_array($get_slidenav)){
echo '<td id="'.$y.'" width="'.$width.'%" class="slidenav" onclick="nextSlide(this.id,true)" onmouseover="mouseOverBG(this.id)" onmouseout="mouseOutBG(this.id)">'.$echo_slidenav['title'].'</td>';
$y++;
- }
+ } */
+ $result = $db->Query("SELECT * FROM `bayonet_newsreel` WHERE `visible`= 1 ORDER BY `weight` ASC LIMIT 0, 6");
+ $row = $db->Fetch($result);
+
+ foreach($row as $link){
+ echo "<td id=\"{$y}\" width=\"{$width}%\" class=\"slidenav\" onclick=\"javascript:nextSlide(this.id, true); return false;\" onmouseover=\"javascript:mouseOverBG(this.id); return false;\" onmouseout=\"javascript:mouseOutBG(this.id); return false;\">{$link['title']}</td>\n";
+ $y++;
+ }
?>
</tr>
</table>