HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers45/smuldersinterieurprojecten.nl/wwwroot/pages/getImpressions.php
<?php

function getImpressions($key,$linkname){
	
	//get info from database
	$query = 'SELECT DISTINCT a.id, a.title, a.linkname, a.thumb 
				FROM '.$linkname.'_albums AS a, status AS s
				WHERE s.active = 1
				AND s.itemId = a.id
				AND s.page = "'.$linkname.'"
				ORDER BY albumOrder DESC';
	$result = mysql_query($query);
	
	$numPhotos = mysql_num_rows($result);
		
	//set max items
	$maxPhotos = 6;
	$numPages = ceil($numPhotos / $maxPhotos); 
	if($numPages == 0) $numPages = 1;
	$thisPage = 1;


	$output = '';
	$output .= '<div class="albumContainer" id="album'.$key.'">';
		$output .= '<div class="albumBar">';
			$output .= '<h2 class="floatLeft">impressies</h2>';
			//$output .= '<span class="projectCount floatRight">1 / 3</span>';
			$output .= '<div class="clear"></div>';
		$output .= '</div>';
		
		$output .= '<div class="albumContent">';
		$output .= '<div class="albumColumnHolder">';
		$output .= '<div class="albumColumn">';
		$output .= '<div class="albumRow">';
		
		$bigColCount = 0;
		$colCount = 0;
		$count = 0;
		
		while($record = mysql_fetch_assoc($result)){
			$albumId = $record['id'];
			$title = $record['title'];
			$thumb = '/images/'.$linkname.'/'.$albumId.'/thumb/'.$record['thumb'];
			
			if($bigColCount == 0 && $count != 0){		
				//end row
				$output .= '<div class="clear"></div>';
				$output .= '</div>';
				//end column
				$output .= '<div class="clear"></div>';
				$output .= '</div>';
				//new column
				$output .= '<div class="albumColumn">';
				//new row
				$output .= '<div class="albumRow">';
			}
			else if($colCount == 0 && $count != 0){
				$output .= '<div class="clear"></div>';
				$output .= '</div>';
				$output .= '<div class="albumRow">';
			}
			
			$output .= '<div class="albumThumb';
			if($colCount == 2)$output .= ' noMargin';
			
			$output .= '">';
				
				
			//album thumb
			//other photos
			
			//get photos from database
			$photoQuery = 'SELECT filename 
						FROM '.$linkname.'_photos
						WHERE albumId = "'.$albumId.'"
						ORDER BY photoOrder DESC LIMIT 6';
			$photoResult = mysql_query($photoQuery);
			
			$files = array();
			$i = 0;
			
			
			while($photoRecord = mysql_fetch_assoc($photoResult)){
				$files[$i] = '/images/'.$linkname.'/'.$albumId.'/'.$photoRecord['filename'];
				$i++;
			}
			//first image
			$sb_linkname = str_replace('-','_',$linkname);
			$output .= '<a href="'.$files[0].'" class="shadowbox" data-rel="shadowbox['.$sb_linkname.$albumId.']" title="Gebruik de pijlen voor meer foto&rsquo;s van dit interieur."><img src="'.$thumb.'" alt="" height="200"/></a>';
			
			//rest
			for($n=1;$n<$i;$n++){
				$output .= '<a href="'.$files[$n].'" class="shadowbox" data-rel="shadowbox['.$sb_linkname.$albumId.']" title="Gebruik de pijlen voor meer foto&rsquo;s van dit interieur."></a>';
			}
			
			$output .= '<div class="albumInfo">'.ucfirst($title).'&nbsp;&nbsp;( '.$i.' foto';
			if($i != 1) $output .= '&rsquo;s';
			$output .= ' )</div>';

			
			$output .= '</div>';
					
			$colCount++;
			$count++;
			$bigColCount++;
			
			if($colCount == 3){
				$colCount = 0;
			}	
			
			if($bigColCount == $maxPhotos){
				$bigColCount = 0;
			}			
		}
		//end row
		$output .= '<div class="clear"></div>';
		$output .= '</div>';
		//end column
		$output .= '<div class="clear"></div>';
		$output .= '</div>';
		//end columnHolder
		$output .= '<div class="clear"></div>';
		$output .= '</div>';
			
		$output .= '<div class="albumBar albumFooterBar">';
			// $output .= '<span class="floatLeft link"><img src="./images/structure/arrowSmallLeft.png" alt="Smulders Interieur Heeze - vorige project" class="barArrow"/> <span class="adjustKerningV">V</span>orige pagina</span>';
			if($numPages > 1) $output .= '<span class="floatRight link" onClick="largeAlbumNextPage(\''.$linkname.'\','.$key.','.$numPages.','.($thisPage+1).',\'next\');" ><span class="adjustKerningV">V</span>olgende pagina <img src="./images/structure/arrowSmallRight.png" alt="Smulders Interieur Heeze - vorige project" class="barArrow"/></span>'; 
		$output .= '</div>';
		
		//end content
		$output .= '</div>';
	//end albumCon	
	$output .= '</div>';

					
	return $output;
}

?>