Пример #1
0
 if (empty($guild_errors)) {
     if ($logged) {
         $guild_leader_char = $guild->getOwner();
         $rank_list = $guild->getGuildRanksList();
         $guild_leader = FALSE;
         $account_players = $account_logged->getPlayers();
         foreach ($account_players as $player) {
             if ($guild->getOwner()->getId() == $player->getId()) {
                 $guild_leader = TRUE;
                 $level_in_guild = 3;
             }
         }
         if ($guild_leader) {
             $rank = new GuildRank();
             $rank->load($rank_to_delete);
             if (!$rank->isLoaded()) {
                 $guild_errors2[] = 'Rank with ID ' . $rank_to_delete . ' doesn\'t exist.';
             } else {
                 if ($rank->getGuild()->getId() != $guild->getId()) {
                     $guild_errors2[] = 'Rank with ID ' . $rank_to_delete . ' isn\'t from your guild.';
                 } else {
                     if (count($rank_list) < 2) {
                         $guild_errors2[] = 'You have only 1 rank in your guild. You can\'t delete this rank.';
                     } else {
                         $players_with_rank = $rank->getPlayersList();
                         $players_with_rank_number = count($players_with_rank);
                         if ($players_with_rank_number > 0) {
                             foreach ($rank_list as $checkrank) {
                                 if ($checkrank->getId() != $rank->getId()) {
                                     if ($checkrank->getLevel() <= $rank->getLevel()) {
                                         $new_rank = $checkrank;
Пример #2
0
 $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>&nbsp;</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']);
         }
         $main_content .= '<br />on ' . date('d.m.y H:i:s', $thread['edit_date']);