Пример #1
0
        }
        $j += 1;
    }
}
// get list of media
$mediaquery = mysql_query("SELECT * FROM files");
// you need at least php 5.2.0
if (version_compare('5.2.0', PHP_VERSION, '>')) {
    exit($txt['page_oldphp']);
}
// set up the templating system
$page = new PageBuilder();
register_shutdown_function(array($page, 'outputAll'));
// and now let's have some content!
ob_start('parsebbcode');
$page->addBodyClass('page-' . preg_replace('/[^a-zA-Z0-9\\s]/', '', $pid));
switch ($_GET['p']) {
    case 'logout':
        include $location['admin2'] . '/logout.php';
        break;
    case 'media':
        include $location['root'] . '/media.php';
        break;
    default:
        if ($j == 0) {
            $page->setTitle($txt['text_error']);
            echo $txt['noexist'];
        } else {
            $page->setTitle($curpgtitle);
            echo $pagecontent;
        }