} $number_of_rows++; $main_content .= '<tr bgcolor="' . $bgcolor . '"><td valign="top" style="padding: 5px;"><a href="?subtopic=characters&name=' . urlencode($thread['name']) . '">' . $thread['name'] . '</a><br /><small>' . $pos[$thread['group_id']] . '</small>'; if ($thread['group_id'] >= 4) { $main_content .= '<br /><img src="images/cip_post_icon.gif" />'; } $main_content .= '<br /><br />'; if ($config['site']['worlds_num'] > 1) { $main_content .= ' <small>Habitante de ' . $config['site']['worlds'][$thread['world_id']] . '</small><br />'; } if ($thread['group_id'] < 4) { $main_content .= '<font size="1">Vocação: ' . $vocation_name[$thread['world_id']][$thread['promotion']][$thread['vocation']] . '<br />Nível: ' . $thread['level'] . '<br />'; $thread['post_text'] = strip_tags($thread['post_text']); } $rank = new OTS_GuildRank(); $rank->load($thread['rank_id']); if ($rank->isLoaded()) { $guild = $rank->getGuild(); if ($guild->isLoaded()) { $main_content .= $rank->getName() . ' da guild <a href="?subtopic=guilds&action=show&guild=' . $guild->getId() . '">' . $guild->getName() . '</a><br />'; } } $posts = $SQL->query("SELECT COUNT(`id`) AS 'posts' FROM `z_forum` WHERE `author_guid`=" . (int) $thread['author_guid'])->fetch(); $main_content .= '<br />Tópicos: ' . (int) $posts['posts'] . '<br />Reputação: ' . $rep[$thread['group_id']] . '</font></td><td valign="top" style="padding: 4px;">' . showPost($thread['post_topic'], $thread['post_text'], $thread['post_smile']) . '</td></tr> <tr bgcolor="' . $bgcolor . '" height="40"><td><font size="1"> <img src="images/logo_newpost.gif" />' . date('d/m/Y', $thread['post_date']) . ' às ' . date('H:i:s', $thread['post_date']); if ($thread['edit_date'] > 0) { if ($thread['last_edit_aid'] != $thread['author_aid']) { $main_content .= '<br /><br>Editado por um moderador'; } else { $main_content .= '<br /><br>Editado por ' . $thread['name']; }
/** * Assigned guild rank. * * <p> * Note: Since 0.0.3 version this method throws {@link E_OTS_NotLoaded E_OTS_NotLoaded} exception instead of triggering E_USER_WARNING. * </p> * * @version 0.1.0 * @return OTS_GuildRank|null Guild rank (null if not member of any). * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ public function getRank() { if (!isset($this->data['rank_id'])) { throw new E_OTS_NotLoaded(); } if ($this->data['rank_id'] == 0) { return null; } $guildRank = new OTS_GuildRank(); $guildRank->load($this->data['rank_id']); return $guildRank; }
if (empty($guild_errors)) { if ($logged) { $guild_leader_char = $guild->getOwner(); $rank_list = $guild->getGuildRanksList(); $rank_list->orderBy('level', POT::ORDER_DESC); $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 OTS_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()) {
/** * @version 0.1.0 * @return array List of ranks. * @throws E_OTS_NotLoaded If guild is not loaded. * @deprecated 0.0.5 Use getGuildRanksList(). */ public function getGuildRanks() { if (!isset($this->data['id'])) { throw new E_OTS_NotLoaded(); } $guildRanks = array(); foreach ($this->db->query('SELECT ' . $this->db->fieldName('id') . ' FROM ' . $this->db->tableName('guild_ranks') . ' WHERE ' . $this->db->fieldName('guild_id') . ' = ' . $this->data['id'])->fetchAll() as $guildRank) { // creates new object $object = new OTS_GuildRank(); $object->load($guildRank['id']); $guildRanks[] = $object; } return $guildRanks; }