Просмотр поста

.
Fenixrus
Screamer (28.01.2013 / 20:29)
Fenixrus, ОМГ, гг, такой вариант гораздо удобнее, можно например не использовать массив а заюзать конфиг, чем плодить тысячи кейсов
Или так :
index.php:
define('_IN_JOHNCMS', 1);
$rootpath = '../';
$headmod = 'qchat';
require_once ('../incfiles/core.php');
$path=realpath('./includes');
$files=array_diff(scandir($path),array('.', '..'));
foreach ($files as $file){
if (is_file($path . '/' . $file)){
$file=explode('.',$file);
$array[$file[0]]=$path;
}}
$textl='заголовок';
require_once ('../incfiles/head.php');
if (array_key_exists($act, $array)){
require_once($path . '/' . $act . '.php');
}else{
//здесь php код страницы
require_once ('../incfiles/end.php');
}