kito2
www.masteria.net
Like topic name says: How to make that vice leaders can invite member to guild too?
public function hasViceLeader($id) {
$this->load->database();
$viceRank = 2;
return $this->db->query( 'SELECT `p`.`id`, `p`.`name` FROM `guild_ranks` AS `r` LEFT JOIN `players` AS `p` ON `p`.`rank_id` = `r`.`id` WHERE `r`.`guild_id` = '.(int) $id.' AND `r`.`level` = '.(int) $viceRank.' AND `p`.`account_id` = '.(int) $_SESSION['account_id'].';' )->num_rows == 0 ? false: true;
}
if(!$this->guilds_model->isGuildLeader($data['guild'][0]['ownerid']) or !$this->guilds_model->hasViceLeader($id)) $ide->redirect(WEBSITE."/index.php/guilds");
if(!$this->guilds_model->isGuildLeader($data['guild'][0]['ownerid'])) $ide->redirect(WEBSITE."/index.php/guilds");
if(!$this->guilds_model->isGuildLeader($data['guild'][0]['ownerid']) and !$this->guilds_model->hasViceLeader($id)) $ide->redirect(WEBSITE."/index.php/guilds");
if(!$this->guilds_model->isGuildLeader($data['guild'][0]['ownerid']) or !$this->guilds_model->hasViceLeader($id)) $ide->redirect(WEBSITE."/index.php/guilds");
$data['guild'] = $guild;
$this->load->model("guilds_model");
$data['viceleaders'] = $this->guilds_model->hasViceLeader($id);
if($ide->isLogged() && in_array($guild->getOwner(), $account_players)) {
if(($ide->isLogged() && in_array($guild->getOwner(), $account_players)) or $viceleaders) {