/** * Generate a tag cloud */ function generate_cloud($language) { include 'classes/jforg_tags.php'; $result .= '<div id="tags">'; $tags = new jforg_tags(); $cloud = $tags->tag_cloud(); foreach ($cloud as $tag) { $result2 = ''; $result2 .= "<a href=\"/" . $language; $result2 .= "/tag/"; $result2 .= $tag['tag_value'] . ".htm\""; $result2 .= "class=\"class" . $tag['class'] . "\" >"; $result2 .= $tag['tag_value'] . "</a> "; $unsorted[$tag['tag_value']] = $result2; } ksort($unsorted); foreach ($unsorted as $sorted) { $result .= $sorted; } $result .= '</div>'; return $result; }
<?php include 'classes/jforg_tags.php'; $tags = new jforg_tags(); $template->set_frame('fullpage', 'green'); $content = '<form action="{FORM_ACTION}" method="post"> <table cellpadding="0" cellspacing="2" border="0">'; $tag_value = $_GET['tag_value']; $users = $tags->list_users($tag_value); if (!empty($_POST['submit'])) { $_POST['tag'] = $_POST['search_tagged_users']; $url = $_POST['tag'] . '.htm'; if ($url != ".htm") { header("location:" . $url); } } $content .= '<tr><td class="left">{LANG_TAG}</td><td class="right">' . $tag_value . '</td></tr><tr><td>{LANG_USERS}:</td>'; foreach ($users as $tagged_users) { $content .= '<td><a href="{LINK_MEMBERS}' . $user->get_nick($tagged_users) . '.htm">' . $user->get_nick($tagged_users) . '</a></td></tr><tr><td></td>'; } $content .= '<td></td></tr>'; $content .= '<tr><td valign="top"><br />{LANG_SEARCH_WHO_HAVE_TAG}</td><td><br /><input type="text" name="search_tagged_users" value="">'; $content .= ' </td></tr>'; $content .= '</td></tr>'; $content .= '<tr><td> </td><td><br /><input class="submit" value="{LANG_SEARCH}" name="submit" type="submit" /></td></tr></table></form>'; $template->replace('FULLPAGE_TEXT', $content); $template->replace('LOGIN', '{LANG_LOGOUT}'); $template->replace('REGISTER', '{LANG_OPTIONS}'); $template->replace('LINK_LOGIN', '{LINK_LOGOUT}'); $template->replace('LINK_REGISTER', '{LINK_OPTIONS}'); $template->replace('LOGIN', '{LANG_LOGIN}');
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}"); } }
<?php include 'classes/jforg_tags.php'; $tags = new jforg_tags(); $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) {
include 'includes/config.php'; include 'classes/jforg_template.php'; include 'classes/jforg_user.php'; include 'classes/jforg_tags.php'; if (in_array($_GET['lang'], $config['languages'])) { $language = $_GET['lang']; } else { die('Language ist nicht bekannt'); } if (is_int($_GET['id'] + 0)) { $user_id = $_GET['id']; } else { die('ID is not an int' . $_GET['id']); } $user = new jforg_user(); $tags = new jforg_tags(); $template = new jforg_template(); $template->set_path('design'); $template->set_frame('fullpage', 'green'); $template->hover_on('green'); SESSION_START(); if ($user->login($_SESSION['nick'], $_SESSION['passwd'])) { $template->replace('LOGIN', '{LANG_LOGOUT}'); $template->replace('REGISTER', '{LANG_OPTIONS}'); $template->replace('LINK_LOGIN', '{LINK_LOGOUT}'); $template->replace('LINK_REGISTER', '{LINK_OPTIONS}'); } else { $template->replace('LOGIN', '{LANG_LOGIN}'); $template->replace('REGISTER', '{LANG_REGISTER}'); } $content = '<table cellpadding="0" cellspacing="2" border="0">';