diff options
| author | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-27 10:44:57 -0500 | 
|---|---|---|
| committer | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-27 10:44:57 -0500 | 
| commit | d526decc4884710ae7fafe7aa5171e7f59b24292 (patch) | |
| tree | 12c07f3ef6ab9bf5a4f278a7b00720996c41667d /modules/newsreel/index.php | |
| parent | 07253dc75c69cf585ad39a218f3f2cf97b773987 (diff) | |
| download | bayonetcms-d526decc4884710ae7fafe7aa5171e7f59b24292.tar.gz | |
MySQL -> MySQLi
Fixed memory leaks after Fetching arrays
Removed all while loops that interfaced with $db->Fetch()
Rewrote RSS module
Fixed syntax error in donations module
Fixed link structure for news module
Reverting to old page display method
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@402 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'modules/newsreel/index.php')
| -rw-r--r-- | modules/newsreel/index.php | 41 | 
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>  | 
