Ir para conteúdo
  • Cadastre-se

(Resolvido)[ModerAcc] Erro na página de Guilds


Ir para solução Resolvido por Yan Liima,

Posts Recomendados

Bom dia amigos do TK!

Alguém sabe sobre esse erro do modern acc e como fixa-lo?

Antes de entrar players nao estava aparecendo isso... Depois que entrou 3, surgiu este erro... o que pode ser?

Meus conhecimentos em Websites se resumem a Html 5, Css3 e algumas plataformas infelizmente. Já tentei algumas coisas de outros forums, mais nada deu certo... só aqui no TK mesmo pra alguém me salvar!

 

Valendo 3 Rep+.

 

Muuuito obrigado desde ja ? 

 

Spoiler:

Spoiler

Screenshot_26.thumb.png.41cbef008c6a79534f33dfd1521daa9d.png

 

Editado por joaovitorbk9 (veja o histórico de edições)

AJfwFit.png&key=fe4d679c24a3f021c13992ab

Link para o post
Compartilhar em outros sites

Troque seu guilds_model.php por esse:


<?phpclass Guilds_Model extends Model {	public function getGuildsList($world_id = null) {		$this->load->database();		$ext = (!empty($world_id)) ? "WHERE `world_id` = '$world_id'": "";		$guilds = array();		$sql = $this->db->query("SELECT `id`, `world_id`, `name`, `motd` FROM `guilds` $ext")->result();			foreach($sql as $cmd) {				$guilds[] = array("id"=>$cmd->id, "world_id"=>$cmd->world_id, "name"=>$cmd->name, "motd"=>$cmd->motd);			}		return $guilds;	}		public function getCharactersAllowedToCreateGuild($level = 0) {		$this->load->database();		$characters = array();		$sql = $this->db->query("SELECT `id`, `name`, `level` FROM `players` WHERE `rank_id` = '0' AND `level` >= '{$level}' AND `account_id` = '{$_SESSION['account_id']}'")->result();		foreach($sql as $cmd) {			$characters[] = array('id'=>$cmd->id, 'name'=>$cmd->name,'level'=>$cmd->level);		}		return $characters;	}		public function checkPlayerCreatingGuild($id) {		require_once("system/application/config/create_character.php");		$this->load->database();		$sql = $this->db->query("SELECT `id` FROM `players` WHERE `id` = '$id' AND `level` >= '".LEVELTOCREATEGUILD."' AND `account_id` = '{$_SESSION['account_id']}'")->row_array();		if(count($sql) == 0) return false; else return true;	}		public function checkGuildName($name) {		$this->load->database();		$name = $this->db->escape($name);		$sql = $this->db->query('SELECT `id` FROM `guilds` WHERE `name` = "'.$name.'"')->row_array();		if(count($sql) == 0) return true; else return false;		}		public function createGuild($name, $character) {		$ots = POT::getInstance();		$ots->connect(POT::DB_MYSQL, connection());		$player = new OTS_Player();		$player->load($character);		$new_guild = new OTS_Guild();		$new_guild->setCreationData(time());		$new_guild->setName($name);		$new_guild->setOwner($player);		$new_guild->save();		$new_guild->setCustomField('motd', 'New guild. Leader must edit this text :)');		$new_guild->setCustomField('creationdata', time());		$new_guild->setCustomField('world_id', $player->getWorld());		$ranks = $new_guild->getGuildRanksList();		$ranks->orderBy('level', POT::ORDER_DESC);		foreach($ranks as $rank)			if($rank->getLevel() == 3)			{				$player->setRank($rank);				$player->save();			}		return $new_guild->getId();	}		public function getGuildInfo($id) {		$this->load->database();		return $this->db->query("SELECT `world_id`, `name`, `ownerid`, `creationdata`, `motd` FROM `guilds` WHERE `id` = '".$id."'")->result_array();	}		public function isGuildLeader($id) {		$this->load->database();		return ($this->db->query("SELECT `id` FROM `players` WHERE `id` = '".$id."' AND `account_id` = '".$_SESSION['account_id']."' ")->num_rows == 0) ? false: true;	}	public function isViceLeader($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` = '".$id."' AND `r`.`level` = '".$viceRank."' AND `p`.`account_id` = '".$_SESSION['account_id']."' ")->num_rows == 0) ? false: true;    	}			public function isLeader($id) {        	$this->load->database();        	$Rank = 3;	        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` = '".$id."' AND `r`.`level` = '".$Rank."' AND `p`.`account_id` = '".$_SESSION['account_id']."' ")->num_rows == 0) ? false: true;    	}  		public function isInvitable($name) {		$this->load->database();		return $this->db->query("SELECT `rank_id` FROM `players` WHERE `name` = \"".$name."\"")->result_array();	}		public function getCharacterId($name) {		$this->load->database();		return $this->db->query("SELECT `id` FROM `players` WHERE `name` = \"".$name."\"")->result_array();	}		public function invite($id, $player) {		$this->load->database();		$this->db->query("INSERT INTO `guild_invites` VALUES('".$player."', '".$id."')");	}		public function getMembers($id) {		$this->load->database();		return $this->db->query("SELECT players.id, players.name, guild_ranks.name AS guild_rank FROM guild_ranks LEFT JOIN players ON rank_id = guild_ranks.id WHERE guild_ranks.guild_id = '".$id."' ORDER BY guild_ranks.level DESC")->result_array();	}		public function isGuildMember($id, $player) {		$this->load->database();		return ($this->db->query("SELECT players.rank_id FROM players, guild_ranks WHERE players.rank_id = guild_ranks.id AND players.id = '".$player."' AND guild_ranks.guild_id = '".$id."'")->num_rows == 0) ? false: true;	}		public function getMemberDescription($id) {		$this->load->database();		return $this->db->query("SELECT `guildnick` FROM `players` WHERE `id` = '".$id."'")->result_array();	}		public function changeDescription($player, $desc) {		$this->load->database();		$this->db->query("UPDATE players SET guildnick = \"".$desc."\" WHERE id = '".$player."'");	}		public function getMemberRank($id) {		$this->load->database();		return $this->db->query("SELECT rank_id FROM players WHERE id = '".$id."'")->result_array();	}		public function getRanks($id) {		$this->load->database();		return $this->db->query("SELECT `name`, `id` FROM guild_ranks WHERE guild_id = '".$id."'")->result_array();	}		public function getRanksID($id) {		$this->load->database();		return $this->db->query("SELECT `id` FROM guild_ranks WHERE guild_id = '".$id."'")->result_array();	}		public function changeRank($player, $rank) {		$this->load->database();		$this->db->query("UPDATE `players` SET `rank_id` = '".$rank."' WHERE `id` = '".$player."'");	}		public function kick($id) {		$this->load->database();		$this->db->query("UPDATE `players` SET `guildnick` = '', `rank_id` = '0' WHERE `id` = '".$id."'");	}		public function leave($id) {		$this->load->database();		$this->db->query("UPDATE `players` SET `guildnick` = '', `rank_id` = '0' WHERE `id` = '".$id."'");	}		public function changeMotd($id, $motd) {		$this->load->database();		$this->db->query("UPDATE `guilds` SET `motd` = \"".$motd."\" WHERE `id` = '".$id."'");	}		public function deleteGuild($id) {		$this->load->database();		$this->db->query("DELETE FROM `guilds` WHERE `id` = '".$id."'");		//Triggers should do rest of the job.			if(file_exists("public/guild_logos/".$id.".gif"))				unlink("public/guild_logos/".$id.".gif");	}	public function canUpdate($tarkistus) {		$this->load->database();		$sql = $this->db->query("SELECT `name` FROM `players` WHERE `id` = ".$tarkistus."")->row_array();		return $sql;		}	}?>

Vai no index.php e procure por

E_ALL

Recomendo deixar assim:

E_ALL ^ E_NOTICE

════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═══╗

Te Ajudei? Rep + e ficamos Quits

166420979_logoyanliimaornight.png.33f822b8970081a5b3646e85dbfd5934.png

Precisando de ajuda?

discord.png.1ecd188791d0141f74d99db371a2e0a4.png.890d5a38d7bcde75543c72b624a65de1.pngDiscord: Yan Liima #3702

Programador Júnior de LUA, PHP e JavaScript

Juntos somos lendas, separados somos Mitos!

╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝

Link para o post
Compartilhar em outros sites
15 minutos atrás, Yan Liima disse:

Troque seu guilds_model.php por esse:

 

  Ocultar conteúdo

 



<?phpclass Guilds_Model extends Model {	public function getGuildsList($world_id = null) {		$this->load->database();		$ext = (!empty($world_id)) ? "WHERE `world_id` = '$world_id'": "";		$guilds = array();		$sql = $this->db->query("SELECT `id`, `world_id`, `name`, `motd` FROM `guilds` $ext")->result();			foreach($sql as $cmd) {				$guilds[] = array("id"=>$cmd->id, "world_id"=>$cmd->world_id, "name"=>$cmd->name, "motd"=>$cmd->motd);			}		return $guilds;	}		public function getCharactersAllowedToCreateGuild($level = 0) {		$this->load->database();		$characters = array();		$sql = $this->db->query("SELECT `id`, `name`, `level` FROM `players` WHERE `rank_id` = '0' AND `level` >= '{$level}' AND `account_id` = '{$_SESSION['account_id']}'")->result();		foreach($sql as $cmd) {			$characters[] = array('id'=>$cmd->id, 'name'=>$cmd->name,'level'=>$cmd->level);		}		return $characters;	}		public function checkPlayerCreatingGuild($id) {		require_once("system/application/config/create_character.php");		$this->load->database();		$sql = $this->db->query("SELECT `id` FROM `players` WHERE `id` = '$id' AND `level` >= '".LEVELTOCREATEGUILD."' AND `account_id` = '{$_SESSION['account_id']}'")->row_array();		if(count($sql) == 0) return false; else return true;	}		public function checkGuildName($name) {		$this->load->database();		$name = $this->db->escape($name);		$sql = $this->db->query('SELECT `id` FROM `guilds` WHERE `name` = "'.$name.'"')->row_array();		if(count($sql) == 0) return true; else return false;		}		public function createGuild($name, $character) {		$ots = POT::getInstance();		$ots->connect(POT::DB_MYSQL, connection());		$player = new OTS_Player();		$player->load($character);		$new_guild = new OTS_Guild();		$new_guild->setCreationData(time());		$new_guild->setName($name);		$new_guild->setOwner($player);		$new_guild->save();		$new_guild->setCustomField('motd', 'New guild. Leader must edit this text :)');		$new_guild->setCustomField('creationdata', time());		$new_guild->setCustomField('world_id', $player->getWorld());		$ranks = $new_guild->getGuildRanksList();		$ranks->orderBy('level', POT::ORDER_DESC);		foreach($ranks as $rank)			if($rank->getLevel() == 3)			{				$player->setRank($rank);				$player->save();			}		return $new_guild->getId();	}		public function getGuildInfo($id) {		$this->load->database();		return $this->db->query("SELECT `world_id`, `name`, `ownerid`, `creationdata`, `motd` FROM `guilds` WHERE `id` = '".$id."'")->result_array();	}		public function isGuildLeader($id) {		$this->load->database();		return ($this->db->query("SELECT `id` FROM `players` WHERE `id` = '".$id."' AND `account_id` = '".$_SESSION['account_id']."' ")->num_rows == 0) ? false: true;	}	public function isViceLeader($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` = '".$id."' AND `r`.`level` = '".$viceRank."' AND `p`.`account_id` = '".$_SESSION['account_id']."' ")->num_rows == 0) ? false: true;    	}			public function isLeader($id) {        	$this->load->database();        	$Rank = 3;	        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` = '".$id."' AND `r`.`level` = '".$Rank."' AND `p`.`account_id` = '".$_SESSION['account_id']."' ")->num_rows == 0) ? false: true;    	}  		public function isInvitable($name) {		$this->load->database();		return $this->db->query("SELECT `rank_id` FROM `players` WHERE `name` = \"".$name."\"")->result_array();	}		public function getCharacterId($name) {		$this->load->database();		return $this->db->query("SELECT `id` FROM `players` WHERE `name` = \"".$name."\"")->result_array();	}		public function invite($id, $player) {		$this->load->database();		$this->db->query("INSERT INTO `guild_invites` VALUES('".$player."', '".$id."')");	}		public function getMembers($id) {		$this->load->database();		return $this->db->query("SELECT players.id, players.name, guild_ranks.name AS guild_rank FROM guild_ranks LEFT JOIN players ON rank_id = guild_ranks.id WHERE guild_ranks.guild_id = '".$id."' ORDER BY guild_ranks.level DESC")->result_array();	}		public function isGuildMember($id, $player) {		$this->load->database();		return ($this->db->query("SELECT players.rank_id FROM players, guild_ranks WHERE players.rank_id = guild_ranks.id AND players.id = '".$player."' AND guild_ranks.guild_id = '".$id."'")->num_rows == 0) ? false: true;	}		public function getMemberDescription($id) {		$this->load->database();		return $this->db->query("SELECT `guildnick` FROM `players` WHERE `id` = '".$id."'")->result_array();	}		public function changeDescription($player, $desc) {		$this->load->database();		$this->db->query("UPDATE players SET guildnick = \"".$desc."\" WHERE id = '".$player."'");	}		public function getMemberRank($id) {		$this->load->database();		return $this->db->query("SELECT rank_id FROM players WHERE id = '".$id."'")->result_array();	}		public function getRanks($id) {		$this->load->database();		return $this->db->query("SELECT `name`, `id` FROM guild_ranks WHERE guild_id = '".$id."'")->result_array();	}		public function getRanksID($id) {		$this->load->database();		return $this->db->query("SELECT `id` FROM guild_ranks WHERE guild_id = '".$id."'")->result_array();	}		public function changeRank($player, $rank) {		$this->load->database();		$this->db->query("UPDATE `players` SET `rank_id` = '".$rank."' WHERE `id` = '".$player."'");	}		public function kick($id) {		$this->load->database();		$this->db->query("UPDATE `players` SET `guildnick` = '', `rank_id` = '0' WHERE `id` = '".$id."'");	}		public function leave($id) {		$this->load->database();		$this->db->query("UPDATE `players` SET `guildnick` = '', `rank_id` = '0' WHERE `id` = '".$id."'");	}		public function changeMotd($id, $motd) {		$this->load->database();		$this->db->query("UPDATE `guilds` SET `motd` = \"".$motd."\" WHERE `id` = '".$id."'");	}		public function deleteGuild($id) {		$this->load->database();		$this->db->query("DELETE FROM `guilds` WHERE `id` = '".$id."'");		//Triggers should do rest of the job.			if(file_exists("public/guild_logos/".$id.".gif"))				unlink("public/guild_logos/".$id.".gif");	}	public function canUpdate($tarkistus) {		$this->load->database();		$sql = $this->db->query("SELECT `name` FROM `players` WHERE `id` = ".$tarkistus."")->row_array();		return $sql;		}	}?>

 

 

Vai no index.php e procure por

 


E_ALL

 

Recomendo deixar assim:

 


E_ALL ^ E_NOTICE

 

 

@Yan Liima

Alterei o models_php e quando clico na guild ali na home da esse erro:

Spoiler

Parse error: syntax error, unexpected T_STRING in C:\xamppp\htdocs\system\application\models\guilds_model.php on line 1

 

Altera aqui? 

 

Spoiler

/*
|---------------------------------------------------------------
| PHP ERROR REPORTING LEVEL
|---------------------------------------------------------------
|
| By default CI & IDE runs with error reporting set to ALL.  For security
| reasons you are encouraged to change this when your site goes live.
| For more info visit: http://www.php.net/error_reporting
|
*/
    error_reporting(E_ALL ^ E_NOTICE);

 

Editado por joaovitorbk9 (veja o histórico de edições)

AJfwFit.png&key=fe4d679c24a3f021c13992ab

Link para o post
Compartilhar em outros sites
  • Solução
8 horas atrás, joaovitorbk9 disse:

@Yan Liima

Alterei o models_php e quando clico na guild ali na home da esse erro:

  Mostrar conteúdo oculto

Parse error: syntax error, unexpected T_STRING in C:\xamppp\htdocs\system\application\models\guilds_model.php on line 1

 

Altera aqui? 

 

  Ocultar conteúdo

/*
|---------------------------------------------------------------
| PHP ERROR REPORTING LEVEL
|---------------------------------------------------------------
|
| By default CI & IDE runs with error reporting set to ALL.  For security
| reasons you are encouraged to change this when your site goes live.
| For more info visit: http://www.php.net/error_reporting
|
*/
    error_reporting(E_ALL ^ E_NOTICE);

 

 

Isso ai mesmo!

Como que eu mandei pelo celular deve ter bugado ksksks. Baixe esses arquivos da guild e teste

system.rar

Editado por Yan Liima (veja o histórico de edições)

════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═══╗

Te Ajudei? Rep + e ficamos Quits

166420979_logoyanliimaornight.png.33f822b8970081a5b3646e85dbfd5934.png

Precisando de ajuda?

discord.png.1ecd188791d0141f74d99db371a2e0a4.png.890d5a38d7bcde75543c72b624a65de1.pngDiscord: Yan Liima #3702

Programador Júnior de LUA, PHP e JavaScript

Juntos somos lendas, separados somos Mitos!

╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝

Link para o post
Compartilhar em outros sites
16 horas atrás, Yan Liima disse:

Isso ai mesmo!

Como que eu mandei pelo celular deve ter bugado ksksks. Baixe esses arquivos da guild e teste

system.rar 9 kB · 0 downloads

 

Funcionando perfeitamente! <3 Ty

AJfwFit.png&key=fe4d679c24a3f021c13992ab

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo