$guild_errors[] = 'Guild with ID <b>' . $guild_id . '</b> doesn\'t exist.'; } if (empty($guild_errors)) { $guild_leader_char = $guild->getOwner(); $rank_list = $guild->getGuildRanksList(); $guild_leader = FALSE; $account_players = $account_logged->getPlayers(); foreach ($account_players as $player) { if ($guild_leader_char->getId() == $player->getId()) { $guild_vice = TRUE; $guild_leader = TRUE; $level_in_guild = 3; } } if ($guild_leader) { $new_rank = new GuildRank(); $new_rank->setGuild($guild); $new_rank->setLevel(1); $new_rank->setName($ranknew); $new_rank->save(); header("Location: ?subtopic=guilds&guild=" . $guild_id . "&action=manager"); $main_content .= 'New rank added. Redirecting...'; } else { $guild_errors[] = 'You are not a leader of guild!'; } } if (!empty($guild_errors)) { $main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url(' . $layout_name . '/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url(' . $layout_name . '/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>'; foreach ($guild_errors as $guild_error) { $main_content .= '<li>' . $guild_error; }
} $threads = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('account_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('world_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('rank_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('vocation') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('level') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . "," . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . "," . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_smile') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_aid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('last_edit_aid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('edit_date') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = " . (int) $thread_id . " ORDER BY " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " LIMIT " . $posts_per_page . " OFFSET " . $page * $posts_per_page)->fetchAll(); if (isset($threads[0]['name'])) { $SQL->query("UPDATE " . $SQL->tableName('z_forum') . " SET " . $SQL->fieldName('views') . "=" . $SQL->fieldName('views') . "+1 WHERE " . $SQL->fieldName('id') . " = " . (int) $thread_id); } $main_content .= '<a href="?subtopic=forum">Boards</a> >> <a href="?subtopic=forum&action=show_board&id=' . $threads[0]['section'] . '">' . $sections[$threads[0]['section']] . '</a> >> <b>' . htmlspecialchars($thread_name['post_topic']) . '</b>'; $main_content .= '<br /><br /><a href="?subtopic=forum&action=new_post&thread_id=' . $thread_id . '"><img src="images/forum/post.gif" border="0" /></a><br /><br />Page: ' . $links_to_pages . '<br /><table width="100%"><tr bgcolor="' . $config['site']['lightborder'] . '" width="100%"><td colspan="2"><font size="4"><b>' . htmlspecialchars($thread_name['post_topic']) . '</b></font><font size="1"><br />by <a href="?subtopic=characters&name=' . urlencode($thread_name['name']) . '">' . htmlspecialchars($thread_name['name']) . '</a></font></td></tr><tr bgcolor="' . $config['site']['vdarkborder'] . '"><td width="200"><font color="white" size="1"><b>Author</b></font></td><td> </td></tr>'; foreach ($threads as $thread) { if (!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<tr bgcolor="' . $bgcolor . '"><td valign="top"><a href="?subtopic=characters&name=' . urlencode($thread['name']) . '">' . htmlspecialchars($thread['name']) . '</a><br /><br /><font size="1">Profession: ' . htmlspecialchars(Website::getVocationName($thread['vocation'])) . '<br />Level: ' . $thread['level'] . '<br />'; $rank = new GuildRank($thread['rank_id']); if ($rank->isLoaded()) { $guild = $rank->getGuild(); if ($guild->isLoaded()) { $main_content .= htmlspecialchars($rank->getName()) . ' of <a href="?subtopic=guilds&action=show&guild=' . $guild->getId() . '">' . htmlspecialchars($guild->getName()) . '</a><br />'; } } $posts = $SQL->query("SELECT COUNT(" . $SQL->fieldName('id') . ") AS 'posts' FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->fieldName('author_aid') . "=" . (int) $thread['account_id'])->fetch(); $main_content .= '<br />Posts: ' . (int) $posts['posts'] . '<br /></font></td><td valign="top">' . showPost(htmlspecialchars($thread['post_topic']), htmlspecialchars($thread['post_text']), $thread['post_smile']) . '</td></tr> <tr bgcolor="' . $bgcolor . '"><td><font size="1">' . date('d.m.y H:i:s', $thread['post_date']); if ($thread['edit_date'] > 0) { if ($thread['last_edit_aid'] != $thread['author_aid']) { $main_content .= '<br />Edited by moderator'; } else { $main_content .= '<br />Edited by ' . htmlspecialchars($thread['name']); }