Postado Março 12, 2019 6 anos 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 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> "; 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 " <b>Rank de</b> "; 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+.
Postado Março 12, 2019 6 anos 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> "; 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 " <b>Rank de</b> "; 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 Precisando de ajuda? Discord: Yan Liima #3702 Programador Júnior de LUA, PHP e JavaScript Juntos somos lendas, separados somos Mitos! ╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝
Postado Março 12, 2019 6 anos 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> "; 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 " <b>Rank de</b> "; 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 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
Postado Março 12, 2019 6 anos 10 minutos atrás, joaovitorbk9 disse: Valeu 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 Precisando de ajuda? Discord: Yan Liima #3702 Programador Júnior de LUA, PHP e JavaScript Juntos somos lendas, separados somos Mitos! ╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝
Postado Março 12, 2019 6 anos 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.. *-*
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.