makePHP_SELF(); if ($_GET['href']) { $sql = 'SELECT * FROM contents_main WHERE href = "' . $classCommon->stripQuotes($_GET['href']) . '" AND lang_id = '.$langFront; $res = $classDB->query($sql); if (!$contents = $classDB->fetch_assoc($res)) { if (preg_match('/(.+)\/(.+)/', $classCommon->stripQuotes($_GET['href']), $matches)) { if (explode('/', $matches[1])){ $explode = explode('/', $matches[1]); $href = $classCommon->stripQuotes($explode[0]); $sql = 'SELECT * FROM contents_main WHERE href = "' . $href . '" AND module <> 0 AND lang_id = '.$langFront; }else{ $sql = 'SELECT * FROM contents_main WHERE href = "' . $classCommon->stripQuotes($matches[1]) . '" AND module <> 0 AND lang_id = '.$langFront; } $res = $classDB->query($sql); if (!$contents = $classDB->fetch_assoc($res)) { if ($explode) $matches[1] = $explode[0]; $contents['module'] = $classCommon->field2data('contents_modules', 'id', 'href="'.$matches[1].'"'); $contentsInfo = $classCommon->getDataField('contents_main', array('href','fileshash'), 'module='.$contents['module'].' AND lang_id = '.$langFront); $headers['href'] = $contentsInfo->href; $headers['fileshash'] = $contentsInfo->fileshash; if ($contents['module']) { $moduleHref = $classCommon->id2data('contents_modules', 'href', $contents['module']); $_GET['href'] = $matches[2]; $moduleAction = 'view'; if (file_exists(PATH . 'inc/modules/'.$moduleHref.'/'.$moduleAction.'/actions.inc.php')) include('inc/modules/'.$moduleHref.'/'.$moduleAction.'/actions.inc.php'); } }else{ $headers['href'] = $contents['href']; $headers['fileshash'] = $contents['fileshash']; if ($contents['module']) { $moduleHref = $classCommon->id2data('contents_modules', 'href', $contents['module']); } $_GET['href'] = $matches[2]; $moduleAction = 'view'; if (file_exists(PATH . 'inc/modules/'.$moduleHref.'/'.$moduleAction.'/actions.inc.php')) include('inc/modules/'.$moduleHref.'/'.$moduleAction.'/actions.inc.php'); } #check for header image $files = $classFiles->maskFileExists('images/headers/', $headers['fileshash'] . '.*', false); if ($files[0]) { $imgData = getimagesize(PATH . $files[0]); $header['img'] = str_replace($headers['fileshash'], $headers['href'], $files[0]); $header['image'] = $header['img']; $header['size'] = $imgData[3]; #$images = $header['img']; } }else{ $exit = true; } }else{ if ($contents['module']) { #default action = list $moduleHref = $classCommon->id2data('contents_modules', 'href', $contents['module']); if (file_exists(PATH . 'inc/modules/'.$moduleHref.'/list/actions.inc.php')) include('inc/modules/'.$moduleHref.'/list/actions.inc.php'); } #check for header image $files = $classFiles->maskFileExists('images/headers/', $contents['fileshash'] . '.*', false); if ($files[0]) { $imgData = getimagesize(PATH . $files[0]); $header['img'] = str_replace($contents['fileshash'], $contents['href'], $files[0]); $header['image'] = $header['img']; $header['size'] = $imgData[3]; #$images = $header['img']; } if ($contents['meta_title'] || $contents['meta_keywords'] || $contents['meta_description']) { $meta['title'] = $contents['meta_title']; $meta['keywords'] = $contents['meta_keywords']; $meta['description'] = $contents['meta_description']; }else{ #default meta $setDefaultMeta = true; } } } if ($exit) { header("HTTP/1.0 404 Not Found"); header('location: '.SITE_URL.'404.html'); exit; } #include forms processor include('inc/modules/form_processor.inc.php'); #include recaptcha require_once('inc/recaptcha-php-1.11/recaptchalib.php'); $recaptcha = '' .recaptcha_get_html(RECAPTCHA_PUBLIC); $finalContents = $contents['contents']; $finalContents = str_replace('{recaptcha}', $recaptcha, $finalContents); if ($setDefaultMeta) { #default meta $classMeta = new meta(); if ($contents['title']) { $meta = array('title' => $contents['title'], 'description' => $classMeta->strip(strip_tags($finalContents)), 'keywords' => $classMeta->parseKeywords($contents['title'])); }else{ $meta = array('title' => CFG_DEFAULT_META_TITLE, 'description' => $classMeta->strip(CFG_DEFAULT_META_DESCRIPTION), 'keywords' => CFG_DEFAULT_META_KEYWORDS); } } ?> $fileToInclude) { if (file_exists($fileToInclude)) { ob_start(); include(PATH . $fileToInclude); $fileContents = ob_get_contents(); ob_end_clean(); ob_start(); } $finalContents = str_replace($matches[0][$key], '', $finalContents); $contentsOutside .= $fileContents; unset($fileToInclude); } } echo $contentsOutside; ?>

$fileToInclude) { if (file_exists($fileToInclude)) { ob_start(); include($fileToInclude); $fileContents = ob_get_contents(); ob_end_clean(); ob_start(); } $finalContents = str_replace($matches[0][$key], $fileContents, $finalContents); unset($fileToInclude); } } echo $finalContents; if ($moduleHref && file_exists(PATH . 'inc/modules/'.$moduleHref.'/list/body.inc.php')) include('inc/modules/'.$moduleHref.'/list/body.inc.php'); } ?>