MYSQL ERROR:

' . mysql_error() . '

QUERY:

' . nl2br( $q ) . '

' ); return $data; } /* cache */ $uri = strtolower( $_SERVER["REQUEST_URI"] ); $pos = strpos( $uri, '?' ); if ($pos !== false) { $uri = substr( $uri, 0, $pos ); } $cfile = 'cache/' . slugify($uri) . '.html'; $cfile2 = 'cache/' . slugify($uri) . '.xml'; if( $_SERVER['REQUEST_METHOD']!='POST' && is_file( $cfile ) ){ /* && ( time() - filemtime ( $cfile ) < 7*24*60*60 ) */ readfile( $cfile ); echo "\n"; echo "\n"; exit; } else if( $_SERVER['REQUEST_METHOD']!='POST' && is_file( $cfile2 ) ){ /* && ( time() - filemtime ( $cfile ) < 7*24*60*60 ) */ header ("content-type: text/xml", true); readfile( $cfile2 ); echo "\n"; echo "\n"; exit; } /* globals */ $toroot[] = array(); $navstr = ''; $requestvars = array(); $currentid = 0; $fullurl = ''; $crumb = ''; $isvalid = 1; $registeredfunctions = array('date'); /* hoogste */ $urlvars = explode( '/', $uri ); $lang = $urlvars[1]; foreach( $_REQUEST as $k=>$v ){ if( substr( $k,0,5 ) != "__utm" && $k!='PHPSESSID' ){ $requestvars[] = "$k=$v"; } } /* includes */ include( 'inc/config.php' ); include( 'inc/dbconnect.php' ); /* check Url */ for( $validurlvars=1; $validurlvars= 1;"; $tmprow = mysql_fetch_assoc( query( $q ) ); } if( $isvalid==1 && $tmprow['id'] > 0 ){ $currentid = $tmprow['id']; $fullurl .= '/' . $tmprow['url']; $crumb .= '/ ' . $tmprow['name'] . ' '; $toroot[$tmprow['id']] = $fullurl; } else { //break; $requestvars[] = mysql_real_escape_string( $urlvars[$validurlvars] ); $isvalid = 0; } unset( $tmprow ); } require_once( 'inc/functions.php' ); //var_dump( $registeredfunctions ); /* 404 - geen pagina gevonden */ if( $currentid == 0 ){ include_once( 'inc/404.php' ); exit; } else { $master = next( $toroot ); $masterid = key( $toroot ); $masterurl = $toroot[$masterid]; $q = " SELECT p.id AS id, p.dbtype AS dbtype, p.cache as cache, p.dbparent AS dbparent, p.title AS title, p.name AS name, p.metakeywords AS metakeywords, p.metadescription AS metadescription, p.head AS head, p.content AS content, t.content AS tcontent FROM " . $GLOBALS['dbprefix'] . "_pages AS p LEFT JOIN " . $GLOBALS['dbprefix'] . "_templates AS t ON ( p.template = t.id ) WHERE p.id='" . $currentid . "' AND p.status >= 1 "; } $row = mysql_fetch_assoc( query( $q ) ); $content = stripslashes( $row['content'] ); $template = stripslashes( $row['tcontent'] ); /* module include*/ if( file_exists( 'inc/module/' . $row['id'] . '.php' ) ){ include( 'inc/module/' . $row['id'] . '.php' ); } /* vervang standaard template velden*/ $ts = array( '#\%%TITLE\%%#', '#\%%NAME\%%#', '#\%%DESCRIPTION\%%#', '#\%%KEYWORDS\%%#', '#\%%HEAD\%%#', '#\%%NAV\%%#', '#\%%FOOTERNAV\%%#', '#\%%SUBNAV\%%#', '#\%%CONTENT\%%#', '#\%%MASTER\%%#', '#\%%MASTERURL\%%#', '#\%%URL\%%#', '#\%%CRUMB\%%#' ); $tr = array( htmlspecialchars( $row['title'] ), htmlspecialchars( $row['name'] ), htmlspecialchars( $row['metadescription'] ), htmlspecialchars( $row['metakeywords'] ), stripslashes( $row['head'] ), nav(), footernav(), subnav( $masterid, $masterurl ), $content, $masterid, $masterurl, $fullurl, $crumb ); $template = preg_replace( $ts, $tr, $template ); /* vervang dynamische content als de corresponderende functie bestaat (in index of include)*/ function vervangDyn( $arr ){ if( function_exists( $arr[1] ) ){ return $arr[1]( $arr[2] ); } else { return $arr[1] . " = " . $arr[2]; } } /* vervang dynamische content */ $template = preg_replace_callback( "#\%%(\w*?):(.*?)\%%#", 'vervangDyn', $template ); /* verwerktijd */ if( !isset( $notags ) ){ $template .= "\n\n\n\n\n\n"; } /* schrijf cache */ if( $row['cache']==1 && $_SERVER['REQUEST_METHOD']!='POST' ){ $file = @fopen( $cfile, "wb" ); @fwrite( $file, $template ); @fclose ( $file ); } /* sluit db-connectie*/ if( $GLOBALS['mysql_persistent']!=1 ){ mysql_close(); } /* output naar browser*/ echo $template; exit; ?>