$template->set_frame('fullpage', 'green'); $user_id = $user->get_id($_SESSION['nick']); if (!$user->login($_SESSION['nick'], $_SESSION['passwd'])) { die('You are not logged in'); } $content = '<form action="{FORM_ACTION}" method="post"> <table cellpadding="0" cellspacing="2" border="0">'; // add tag to a user if (!empty($_POST['submit'])) { $_POST['tags'] = strip_tags($_POST['tags_add']); $tags->add_tag($_POST['tags'], $user_id); } // remove the given tag_id from the user if (is_int(intval(ereg_replace('[^0-9]', '', $_GET['id'])))) { $tags_del = (int) $_GET['tag_id']; $tags->remove_tag($tags_del, $user_id); } else { die('ID is not an int' . $_GET['tag_id']); } $user_tags = $tags->get_user_tags($user_id); $content .= '<tr><td colspan="2"><a href="{LINK_OPTIONS}">{LANG_BACK_TO_OPTIONS}</a><br /><br /></td></tr>'; $content .= '<tr><td class="left">{LANG_NICK}</td><td class="right">' . $user->get_nick($user_id) . '</td></tr>'; $content .= '<tr><td>{LANG_JID}</td><td>' . $user->get_jid($user_id) . '</td></tr>'; $content .= '<tr><td><br />{LANG_AKTUAL_TAGS}</td><td><br />'; $content .= '<table cellpadding="0" cellspacing="2" border="0">'; // purint the tags foreach ($user_tags as $user_tags_content) { $tag_id = $tags->get_tag_id($user_tags_content); $content .= '<tr><td>' . $user_tags_content . '</td><td><a href="../../' . $language . '/{LANG_DEL_TAGS}/' . $tag_id . '.htm">{LANG_DEL_TAG}</a> <br /></tr>'; } $content .= '</table>';
function delete_user($nick) { include 'classes/jforg_tags.php'; $jforg_tags = new jforg_tags(); $id = $this->get_id($nick); $user_tags = $jforg_tags->get_user_tags($id); if ($user_tags != null) { foreach ($user_tags as $tag) { $jforg_tags->remove_tag($tag, $id); } } $sql = "DELETE FROM `user_details` WHERE `id` = '{$id}'"; $query = @mysql_query($sql, $this->connection); if (!$query) { die("jforg_user.delete_user: Die SQL Abfrage ist fehlgeschlagen - {$sql}"); } $sql = "DELETE FROM `user_login` WHERE `id` = '{$id}'"; $query = @mysql_query($sql, $this->connection); if (!$query) { die("jforg_user.delete_user: Die SQL Abfrage ist fehlgeschlagen - {$sql}"); } }