Ir para conteúdo

Featured Replies

Postado

Ola galera do Tk, boa tarde!

Alguém poderia me ajudar, estou com um problema, no meu site não aparece o rank de skills, somente o de level...
alguém sabe como puxar da database desses skills usando o mesmo esquema de nivel?

 

obrigado desde já...

 

Spoiler

image.thumb.png.48351e8455bad92e29b2faf2d31321c3.png

 

 

Highscores.php

 

Spoiler

<?php
require("config.php");
$ide = new IDE;
try {$ide->loadInjections("highscores");} catch(Exception $e) {error($e->getMessage()); }
echo form_open('highscores');
	$uri = $this->uri->segment(5) ? $this->uri->segment(5) : 0;

	if(count($config['worlds']) > 1) {
		echo "<b>World</b>&nbsp;&nbsp;";
		echo "<select name='world'>";
		foreach($config['worlds'] as $id=>$name) {
			if($_POST['world'] == $id)
			echo "<option selected='true' value='$id'>$name</option>";
			else
			echo "<option value='$id'>$name</option>";
		}
		echo "</select>";
	}
	
	echo "&nbsp;&nbsp;<b>Rank de</b>&nbsp;&nbsp;";
	echo "<select name='skill'>";
	echo "<option class='skill' ".set_select('skill', 1, true)." value='level'>Level</option>";
	echo "</select>";
	echo " <input type='submit' value='Mostrar'>";

	echo "</form>";

	echo "<h2><center>Ranking of ". (is_numeric($type) ? $skills[$type] : $type) ." on ".$config['worlds'][$world]."</center></h2>";
	
	$i = 1 + $uri;
	echo "<table width='100%'>";
	if(is_numeric($type)) {
		
		echo "<tr><td width='5%'><b><center>*</center></b></td><td width='40%'><center><b>Name</b></center></td><td width='5%'><center><b>Skill</b></center></td></tr>";
		foreach($players as $player) {
			if(in_array($player['name'], $config['newchar_vocations'][0])) continue;
			echo '<tr><td width="5%" align="center">'.$i.'</center></td><td width="40%" align="center"><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'" class="'. ($player['online'] ? 'green' : 'red') .'">'.$player['name'].'</a></td><td width="5%" align="center">'.$player['value'].'</td></tr>';
			$i++;
		}
	}else{
		switch($type) {
			case 'level':
			echo "<tr><td width='5%'><b><center>*</center></b></td><td width='40%'><center><b>Name</b></center></td><td width='10%'><center><b>Exp</b></center></td><td width='5%'><center><b>Level</b></center></td></tr>";
			foreach($players as $player) {
				if(in_array($player['name'], $config['newchar_vocations'][0])) continue;
				echo '<tr><td width="5%" align="center">'.$i.'</td><td width="40%" align="center"><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'" class="'. ($player['online'] ? 'green' : 'red') .'">'.$player['name'].'</a></td><td width="10%" align="center">'.$player['experience'].'</td><td width="5%" align="center">'.$player['level'].'</td></tr>';
				$i++;
			}
			break;
			case 'magic':
			echo "<tr><td width='5%'><b><center>*</center></b></td><td width='40%'><center><b>Name</b></center></td><td width='5%'><center><b>Magic</b></center></td></tr>";
			foreach($players as $player) {
				if(in_array($player['name'], $config['newchar_vocations'][0])) continue;
				echo '<tr><td width="5%" align="center">'.$i.'</td><td width="40%" align="center"><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'" class="'. ($player['online'] ? 'green' : 'red') .'">'.$player['name'].'</a></td><td width="5%" align="center">'. $player['maglevel'] .'</td></tr>';
				$i++;	
			}
			break;
		}	
	}
	echo "</table>";
	echo $this->pagination->create_links();

 

 

 

VALENDO 2REP+.

AJfwFit.png&key=fe4d679c24a3f021c13992ab

Resolvido por Yan Liima

Ir para solução
Postado
  • Solução

Não sei como está seus outros highscore, mas creio que o valor que coloquei esteja certo, já que é o padrão que vem no models.

<?php
require("config.php");
$ide = new IDE;
try {$ide->loadInjections("highscores");} catch(Exception $e) {error($e->getMessage()); }
echo form_open('highscores');
	$uri = $this->uri->segment(5) ? $this->uri->segment(5) : 0;

	if(count($config['worlds']) > 1) {
		echo "<b>World</b>&nbsp;&nbsp;";
		echo "<select name='world'>";
		foreach($config['worlds'] as $id=>$name) {
			if($_POST['world'] == $id)
			echo "<option selected='true' value='$id'>$name</option>";
			else
			echo "<option value='$id'>$name</option>";
		}
		echo "</select>";
	}
	
	echo "&nbsp;&nbsp;<b>Rank de</b>&nbsp;&nbsp;";
	echo "<select name='skill'>";
	echo "<option class='skill' ".set_select('skill', 1, true)." value='level'>Level</option>";
	echo "<option class='skill' ".set_select('skill', 9)." value='magic'>Magic Level</option>";
	echo "<option class='skill' ".set_select('skill', 2)." value='1'>Fist fighting</option>";
	echo "<option class='skill' ".set_select('skill', 3)." value='2'>Club fighting</option>";
	echo "<option class='skill' ".set_select('skill', 4)." value='3'>Sword fighting</option>";
	echo "<option class='skill' ".set_select('skill', 5)." value='4'>Axe fighting</option>";
	echo "<option class='skill' ".set_select('skill', 6)." value='5'>Distance fighting</option>";
	echo "<option class='skill' ".set_select('skill', 7)." value='6'>Shielding</option>";
	echo "<option class='skill' ".set_select('skill', 8)." value='7'>Fishing</option>";
	echo "</select>";
	echo " <input type='submit' value='Mostrar'>";

	echo "</form>";

	echo "<h2><center>Ranking of ". (is_numeric($type) ? $skills[$type] : $type) ." on ".$config['worlds'][$world]."</center></h2>";
	
	$i = 1 + $uri;
	echo "<table width='100%'>";
	if(is_numeric($type)) {
		
		echo "<tr><td width='5%'><b><center>*</center></b></td><td width='40%'><center><b>Name</b></center></td><td width='5%'><center><b>Skill</b></center></td></tr>";
		foreach($players as $player) {
			if(in_array($player['name'], $config['newchar_vocations'][0])) continue;
			echo '<tr><td width="5%" align="center">'.$i.'</center></td><td width="40%" align="center"><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'" class="'. ($player['online'] ? 'green' : 'red') .'">'.$player['name'].'</a></td><td width="5%" align="center">'.$player['value'].'</td></tr>';
			$i++;
		}
	}else{
		switch($type) {
			case 'level':
			echo "<tr><td width='5%'><b><center>*</center></b></td><td width='40%'><center><b>Name</b></center></td><td width='10%'><center><b>Exp</b></center></td><td width='5%'><center><b>Level</b></center></td></tr>";
			foreach($players as $player) {
				if(in_array($player['name'], $config['newchar_vocations'][0])) continue;
				echo '<tr><td width="5%" align="center">'.$i.'</td><td width="40%" align="center"><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'" class="'. ($player['online'] ? 'green' : 'red') .'">'.$player['name'].'</a></td><td width="10%" align="center">'.$player['experience'].'</td><td width="5%" align="center">'.$player['level'].'</td></tr>';
				$i++;
			}
			break;
			case 'magic':
			echo "<tr><td width='5%'><b><center>*</center></b></td><td width='40%'><center><b>Name</b></center></td><td width='5%'><center><b>Magic</b></center></td></tr>";
			foreach($players as $player) {
				if(in_array($player['name'], $config['newchar_vocations'][0])) continue;
				echo '<tr><td width="5%" align="center">'.$i.'</td><td width="40%" align="center"><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'" class="'. ($player['online'] ? 'green' : 'red') .'">'.$player['name'].'</a></td><td width="5%" align="center">'. $player['maglevel'] .'</td></tr>';
				$i++;	
			}
			break;
		}	
	}
	echo "</table>";
	echo $this->pagination->create_links();

 

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

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!

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

Postado
  • Autor
45 minutos atrás, Yan Liima disse:

Não sei como está seus outros highscore, mas creio que o valor que coloquei esteja certo, já que é o padrão que vem no models.


<?php
require("config.php");
$ide = new IDE;
try {$ide->loadInjections("highscores");} catch(Exception $e) {error($e->getMessage()); }
echo form_open('highscores');
	$uri = $this->uri->segment(5) ? $this->uri->segment(5) : 0;

	if(count($config['worlds']) > 1) {
		echo "<b>World</b>&nbsp;&nbsp;";
		echo "<select name='world'>";
		foreach($config['worlds'] as $id=>$name) {
			if($_POST['world'] == $id)
			echo "<option selected='true' value='$id'>$name</option>";
			else
			echo "<option value='$id'>$name</option>";
		}
		echo "</select>";
	}
	
	echo "&nbsp;&nbsp;<b>Rank de</b>&nbsp;&nbsp;";
	echo "<select name='skill'>";
	echo "<option class='skill' ".set_select('skill', 1, true)." value='level'>Level</option>";
	echo "<option class='skill' ".set_select('skill', 9)." value='magic'>Magic Level</option>";
	echo "<option class='skill' ".set_select('skill', 2)." value='1'>Fist fighting</option>";
	echo "<option class='skill' ".set_select('skill', 3)." value='2'>Club fighting</option>";
	echo "<option class='skill' ".set_select('skill', 4)." value='3'>Sword fighting</option>";
	echo "<option class='skill' ".set_select('skill', 5)." value='4'>Axe fighting</option>";
	echo "<option class='skill' ".set_select('skill', 6)." value='5'>Distance fighting</option>";
	echo "<option class='skill' ".set_select('skill', 7)." value='6'>Shielding</option>";
	echo "<option class='skill' ".set_select('skill', 8)." value='7'>Fishing</option>";
	echo "</select>";
	echo " <input type='submit' value='Mostrar'>";

	echo "</form>";

	echo "<h2><center>Ranking of ". (is_numeric($type) ? $skills[$type] : $type) ." on ".$config['worlds'][$world]."</center></h2>";
	
	$i = 1 + $uri;
	echo "<table width='100%'>";
	if(is_numeric($type)) {
		
		echo "<tr><td width='5%'><b><center>*</center></b></td><td width='40%'><center><b>Name</b></center></td><td width='5%'><center><b>Skill</b></center></td></tr>";
		foreach($players as $player) {
			if(in_array($player['name'], $config['newchar_vocations'][0])) continue;
			echo '<tr><td width="5%" align="center">'.$i.'</center></td><td width="40%" align="center"><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'" class="'. ($player['online'] ? 'green' : 'red') .'">'.$player['name'].'</a></td><td width="5%" align="center">'.$player['value'].'</td></tr>';
			$i++;
		}
	}else{
		switch($type) {
			case 'level':
			echo "<tr><td width='5%'><b><center>*</center></b></td><td width='40%'><center><b>Name</b></center></td><td width='10%'><center><b>Exp</b></center></td><td width='5%'><center><b>Level</b></center></td></tr>";
			foreach($players as $player) {
				if(in_array($player['name'], $config['newchar_vocations'][0])) continue;
				echo '<tr><td width="5%" align="center">'.$i.'</td><td width="40%" align="center"><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'" class="'. ($player['online'] ? 'green' : 'red') .'">'.$player['name'].'</a></td><td width="10%" align="center">'.$player['experience'].'</td><td width="5%" align="center">'.$player['level'].'</td></tr>';
				$i++;
			}
			break;
			case 'magic':
			echo "<tr><td width='5%'><b><center>*</center></b></td><td width='40%'><center><b>Name</b></center></td><td width='5%'><center><b>Magic</b></center></td></tr>";
			foreach($players as $player) {
				if(in_array($player['name'], $config['newchar_vocations'][0])) continue;
				echo '<tr><td width="5%" align="center">'.$i.'</td><td width="40%" align="center"><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'" class="'. ($player['online'] ? 'green' : 'red') .'">'.$player['name'].'</a></td><td width="5%" align="center">'. $player['maglevel'] .'</td></tr>';
				$i++;	
			}
			break;
		}	
	}
	echo "</table>";
	echo $this->pagination->create_links();

 

 

Valeu <3 funcionando 100%.
oow voce sabe como eu colo um rank na Home do site, tipo rank Hokage? que puxa da databse pontos que ele ganhou por completar tasks? @Yan Liima

AJfwFit.png&key=fe4d679c24a3f021c13992ab

Postado
10 minutos atrás, joaovitorbk9 disse:

Valeu <3 funcionando 100%.
oow voce sabe como eu colo um rank na Home do site, tipo rank Hokage? que puxa da databse pontos que ele ganhou por completar tasks? @Yan Liima

 

Tu tem que fazer um PHP que puxe o valor na db e ai por em \injections\home\ ou por um include no index.tpl...

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

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!

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

Postado
  • Autor
35 minutos atrás, Yan Liima disse:

Tu tem que fazer um PHP que puxe o valor na db e ai por em \injections\home\ ou por um include no index.tpl...

 

Tem uma bse pra eu usar? eu faco o css.. *-* 

AJfwFit.png&key=fe4d679c24a3f021c13992ab

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo