<?php

// -----------------------------------------------------------------------
// This file is part of Igloo
//
// 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 = "my";
include "inc/header.inc.php";

if (!isset($me['user_id']) || $me['user_id'] < 1) {
	header("Location: index.php?" . strip_tags(SID));
	exit;
}

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


// SETUP TAGS
require_once('class/Tag.class.php');
$tag = new Tag($db, null);
$tag->user_id = $me['user_id'];

// PROCESS FORM ----------------------------------------------------------
if (isset($_POST['delete_tags']) && isset($frmdata['tag_bodies'])) {
	$tag->deleteTags($frmdata['tag_bodies']);
	
	return header("Location: my_tags.php?" . strip_tags(SID));
	exit;
}

$output_my_tags = $tag->selTags();


//move to template
if (!empty($output_my_tags)) {
	$body->set('my_tags', $output_my_tags);
}

include "inc/footer.inc.php";

?>
