doQuery(" SELECT *, UNIX_TIMESTAMP(datum) AS unixdatum, 'standbouw' AS type FROM portfolio_standbouw ", array(), 'projecten'); $projecten_standbouw = $db->getAllRecords('projecten'); # Eerst gaan we alle projecten opvragen uit de database. $db->doQuery(" SELECT *, UNIX_TIMESTAMP(datum) AS unixdatum, 'interieurbouw' AS type FROM portfolio_interieurbouw ", array(), 'projecten'); $projecten_interieurbouw = $db->getAllRecords('projecten'); if (isset($_GET['type'])) { switch($_GET['type']) { case 'standbouw': $projecten = & $projecten_standbouw; $titel = 'Standbouw'; $pagina = 'standbouw-portfolio-{page}.php'; break; case 'interieurbouw': $projecten = & $projecten_interieurbouw; $titel = 'Interieurbouw'; $pagina = 'interieurbouw-portfolio-{page}.php'; break; } } else { $projecten = array_merge($projecten_standbouw, $projecten_interieurbouw); $titel = 'Standbouw / Interieurbouw'; $pagina = 'portfolio-overzicht-{page}.php'; } function my_sort($a_, $b_) { if ($a_['volgnr'] == $b_['volgnr']) { if ($a_['unixdatum'] == $b_['unixdatum']) { return strcmp($a_['titel'], $b_['titel']); } return ($a_['unixdatum'] < $b_['unixdatum']) ? 1 : -1; } return ($a_['volgnr'] < $b_['volgnr']) ? 1 : -1; } usort($projecten, "my_sort"); $page = empty($_GET['page']) ? 1 : (integer) $_GET['page']; $pages = ceil(count($projecten) / $per_page); # Hier gaan we kijken op welke pagina de individuele projecten staan in de kleine paginering # box. $__index['standbouw'] = -1; $__index['interieurbouw'] = -1; $__page['standbouw'] = 1; $__page['interieurbouw'] = 1; for ($i = 0; $i < count($projecten); $i++) { $type = & $projecten[$i]['type']; $__index[$type]++; if ( $__page[$type] > 1 && ($__index[$type] - (__PER_PAGE_SMALL__ - 1)) % (__PER_PAGE_SMALL__ - 2) == 0 ) $__page[$type]++; if ( $__page[$type] == 1 && $__index[$type] == __PER_PAGE_SMALL__ - 1 ) $__page[$type]++; $projecten[$i]['page'] = $__page[$projecten[$i]['type']]; } ?>
 

Hier staan we voor!

Portfolio

1) { ?>
0) { ?>
  • image