<?php

// -----------------------------------------------------------------------
// This file is part of AROUNDMe
// 
// Copyright (C) 2003 - 2006 Barnraiser
// http://www.barnraiser.org/
// info@barnraiser.org
// 
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option) any
// later version.
// 
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with program; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
// 02110-1301, USA.
// -----------------------------------------------------------------------
$menu_section = "structure";
include "inc/header.inc.php";


// SETUP LANGUAGE --------------------------------------------------------
require_once($languagePath . 'common.lang.php');
require_once($languageArrayPath . 'arr_acs.lang.php');

$lang['txt_node_rules'] = readTxtFile($languageTextPath . "node_rules.txt.php");
$lang['txt_node_structure'] = readTxtFile($languageTextPath . "node_structure.txt.php");

if (isset($me['user_id']) && $me['user_id'] > 0) {
	$output_user = $user->getUser($me['user_id']);
}
	
//wiki
require_once('class/Wiki/Wiki.php');
$wiki = new Text_Wiki();
$wiki->disableRule('wikilink');
$lang['txt_node_rules'] = stripslashes($lang['txt_node_rules']);
$lang['txt_node_rules'] = $wiki->transform($lang['txt_node_rules'], 'Xhtml');
$lang['txt_node_structure'] = stripslashes($lang['txt_node_structure']);
$lang['txt_node_structure'] = $wiki->transform($lang['txt_node_structure'], 'Xhtml');

// SETUP STATISTICS -----------------------------------------------------

require_once('class/Statistic.class.php');
$statistic = new Statistic($db, null);
$statistic->user_status = $c_node['user']['status'];
$output_statistics = $statistic->getAllUserStatistics();


// MOVE TO TEMPLATE -----------------------------------------------------
if (!empty($output_statistics)) {
	$body->set('statistics', $output_statistics);
}

if (!empty($output_user)) {
   $body->set('user', $output_user);
}
else {
	$body->set('default_role_id', $c_node['arr_acs']['node_role_visitor']);
}

$body->set('release', $c_node['release']);

include "inc/footer.inc.php";

?>
