function message_to_clan($p_message) { $error = null; $user_id = self_char_id(); $clan_id = get_clan_by_player_id($user_id)->getID(); $clan_members = query_resultset("SELECT player_id, uname\n\t FROM clan JOIN clan_player ON _clan_id = clan_id JOIN players ON player_id = _player_id\n\t WHERE clan_id = :clan", array(':clan' => $clan_id)); $messaged_to = array(); foreach ($clan_members as $loop_member) { send_message($user_id, $loop_member['player_id'], $p_message, $type = 1); $messaged_to[] = $loop_member['uname']; } return implode(', ', $messaged_to); }
function is_clan_leader($player_id) { return ($clan = get_clan_by_player_id($player_id)) && $player_id == $clan->getLeaderID(); }
}*/ $changed = PlayerDAO::saveDetails($char); redirect('/stats.php?changed=' . (int) $changed . ($profile_changed ? '&profile_changed=1' : '')); } /* if(false && DEBUG){ $description = 'This is a description here and all'; $goals = 'Kill ninja of the ramen clan'; $beliefs = 'I believe in a one true ninja god'; $instincts = 'When I hear whistling, I duck'; $traits = 'Hardy, nervous, meaty, silent'; } */ $player = self_info(); //$player['created_date']=$player['created_date']? date("c", strtotime($player['created_date'])) : null; $class_theme = class_theme($char->class_identity()); $level_category = level_category($player['level']); $status_list = get_status_list(); $gravatar_url = generate_gravatar_url($player['player_id']); $gurl = $gravatar_url; $rank_display = get_rank($char_id); // rank display. $profile_editable = $player['messages']; $parts = get_certain_vars(get_defined_vars(), ['player', 'level_category', 'status_list', 'description', 'goals', 'beliefs', 'instincts', 'traits', 'dev', 'changed']); // Set the parts array's player clan if any is found. if ($parts['player_clan'] = get_clan_by_player_id($char_id)) { // Set the char clan name and id for later usage. $parts['clan_name'] = $parts['player_clan']->getName(); $parts['clan_id'] = $parts['player_clan']->getID(); } display_page('stats.tpl', 'Ninja Stats', $parts, array('quickstat' => 'player'));
// Pull the items and some necessary data about them. $items = inventory_counts($char_id, $last_item_used); $valid_items = rco($items); // row count //debug($items); } // End of the there-was-no-attack-error section $set_bounty_section = ''; $communication_section = ''; $player_clan_section = ''; $clan = get_clan_by_player_id($player_info['player_id']); $same_clan = false; $player_info = format_health_percent($player_info); // Player clan and clan members if ($clan) { $viewer_clan = is_logged_in() ? get_clan_by_player_id($viewing_player_obj->vo->player_id) : null; $clan_members = get_clan_members($clan->getID())->fetchAll(); // TODO - When we switch to Smarty 3, remove fetchAll for foreach $clan_id = $clan->getID(); $clan_name = $clan->getName(); if ($viewer_clan) { $same_clan = $clan->getID() == $viewer_clan->getID(); $display_clan_options = $username && !$self && $same_clan && is_clan_leader($viewing_player_obj->vo->player_id); } else { $same_clan = $display_clan_options = false; } } // Send the info to the template. $template = 'player.tpl'; $parts = get_certain_vars(get_defined_vars(), array('char_info', 'viewing_player_obj', 'target_player_obj', 'combat_skills', 'targeted_skills', 'player_info', 'self', 'rank_spot', 'kills_today', 'level_category', 'gravatar_url', 'status_list', 'clan', 'clan_members', 'items', 'duel_checked')); }