<?php

// -----------------------------------------------------------------------
// This file is part of aroundme
// 
// Copyright (C) 2003, 2005 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., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
// -----------------------------------------------------------------------

include_once "inc/header.inc.php";

//setup blog
require_once($c_node['dir']['class_path'] . 'Blog.class.php');
$blog = new Blog($db, $c_node['rsp']['item_type']['blog'], $date, $file);


if (isset($_REQUEST['blog_id'])) {
	$blog->blog_id = $_REQUEST['blog_id'];
}


//a blog item can sit under either a group, social net, my sections of aroundme
// if so we swap out menus and include group info
if (!empty($_REQUEST['group_id'])) { // page under group section
    //setup group
	$group_id = $_REQUEST['group_id'];
	include "inc/header_group.inc.php";
	require_once($languagePath . 'g_common.lang.php');
	
	//apply group to schedule
	$blog->group_id = $group_id;
	$blog->file = $file;
}
else {
	require_once($languageArrayPath . 'arr_user.lang.php');
	
	if (!empty($_REQUEST['user_id'])) { // page under sn section
	    include "inc/header_sn.inc.php";
		require_once($languagePath . 'sn_common.lang.php');
		$menu_section = "sn"; //sets menu in default template
		
		$blog->user_id = $_REQUEST['user_id'];
		$blog->degree_id = $degree_path['degree'];
		$blog->rsp_level_id = $c_node['rsp']['rsp_level']['node'];
		$blog->rsp_status_id = $c_node['rsp']['status']['live'];
		$blog->group_id = 0; //selects where group_id=null
	}
	else { // section is "my"
		include "inc/header_my.inc.php";
		require_once($languagePath . 'my_common.lang.php');
		$menu_section = "my"; //sets menu in default template
		$blog->user_id = $me['user_id'];
	}
}


//append language setup
require_once($languageArrayPath . 'arr_user.lang.php');
require_once($languageArrayPath . 'arr_genre.lang.php');
require_once($languageArrayPath . 'arr_language_name.lang.php');

?>
