<?php

define("ROOT_PATH", '');
include_once './includes/common.inc.php';
include_once './classes/album_content.inc.php';
include_once './classes/group.inc.php';
include_once './modules/pic_managment/interface.inc.php';
include_once './includes/functions.inc.php';
include_once './languages/' . $userdata['user_lang'] . '/lang_main.php';
include_once './includes/template.inc.php';
include_once ROOT_PATH . 'libs/pclzip/pclzip.lib.php';
// move this to index.php
validate_config();
// bigbrother stop the view of the last viewed content
session_start();
stop_view($HTTP_SESSION_VARS['view_start'], $HTTP_SESSION_VARS['view_content_id']);
$HTTP_SESSION_VARS['view_start'] = 0;
$HTTP_SESSION_VARS['view_content_id'] = 0;
if (isset($HTTP_GET_VARS['first_content'])) {
    $HTTP_SESSION_VARS['first_content'] = $HTTP_GET_VARS['first_content'];
}
unset($HTTP_SESSION_VARS['contents']);
if (!isset($HTTP_GET_VARS['cat_id'])) {
    $HTTP_GET_VARS['cat_id'] = $config_vars['root_categorie'];
    $template_file = 'index';
}
// create new categorie
if (isset($HTTP_POST_VARS['newcat'])) {
    $new_cat = new categorie();
    $new_cat->set_parent_id($HTTP_GET_VARS['cat_id']);
    $new_cat->set_name($HTTP_POST_VARS['cat_name']);
function load_config($config_name = false)
{
    if (!$config_name) {
        $config_name = basename(__FILE__, 'php') . 'config.php';
    }
    if (!file_exists($config_name)) {
        error("Could not find {$config_name}");
    }
    $config = (include $config_name);
    $config = validate_config($config);
    return $config;
}