Location: PHPKode > projects > l2jweb > index.php
<?
require_once ('config.php');
//include ('/home/alexb8/blogs/wp-content/plugins/firestats/php/db-hit.php');
//fs_add_site_hit(5);

if (DEBUG)
{
    $sql = "SELECT `id` FROM `web_developers` WHERE `ip`='" . $_SERVER['REMOTE_ADDR'] .
        "';";
    $dev_id_sql = $db->query($sql);
    if ($db->num_rows($dev_id_sql) != 0)
    {
        $ok = true;
    } else
    {
        $content = '<div align="center" class="normalred">Down for meintanince!</div>';
        $smarty->assign('CONTENT', $content);
        $ok = false;
    }
} else
    $ok = true;
if ($ok)
{
    $STATUS = $smarty->fetch('stats.tpl');
    $LOGIN = $smarty->fetch('loginbox.tpl');
    //switch page
    if (!isset($_GET['page']))
        $_GET['page'] = 'main';
    switch ($_GET['page'])
    {
        case 'register':
            require_once ('register.php');
            break;
        case 'display_user':
            break;
        case 'login':
            require_once ('login.php');
            $LOGIN = '';
            break;
		case 'activ_new_pass':
			require_once('set_new_passwd.php');
			$LOGIN = '';
			break;
        case 'verify_user':
            require_once ('verify_user.php');
            break;
        case 'forum':
            require_once ('login_safe.php');
            break;
        case 'main':
            if ($_SESSION['admin'])
                $content = 'Welcome ' . $_SESSION['admin'] . '!';
            else
                $content = 'Welcome guest!';
            break;
        case 'change_passwd':
            require_once ('login_safe.php');
            require_once ('change_passwd.php');
            break;
        case 'forgot_password':
            require_once ('get_passwd.php');
            break;
        case 'activ_new_pass':
            break;
        case 'admin':
            if ($_SESSION['level'] <= 100)
                $content = ' <div align="center" class="normalred">You are not allowed to see this zone!</div>';
            else
                require_once ('administrare.php'); //for the moment. We will define some actions for this in the future
            break;
        default:
            $content = '<div align="center" class="normalred">Page does not exist!</div>';
    }
    if ($_SESSION['level'] > 60)
        $ADMIN = $smarty->fetch('adminbox.tpl');
    require_once ('ucp_menu.php');
    @$smarty->assign('ADMIN_PANEL', $ADMIN);
    require_once ('list_top_users.php');
    require_once ('announcements.php');
    $smarty->assign('CONTENT', $content);
    $smarty->assign('STATUS', $STATUS);
    $smarty->assign('LOGIN', $LOGIN);
}
$smarty->display('index.tpl');

?>
Return current item: l2jweb