Postado Março 14, 2019 6 anos Olá galera alguem pode me ajudar colocar esse codigo pra puxar por id as imagens de cada vocação?. Por ex: Gaara: ID 307, NA IMAGEM 307. Vai pro site junto com os outros tops 5. Spoiler <?php ################################################################################# ## CONFIGURATION PAGE ## ################################################################################# ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- # ## ---------------------------------------------------------------------------- # ## Script created by Kavvson (http://otland.net/members/kavvson/) and MiPo91 # ## Author & developer: MiPo91 and Kavvson # ## # ## Helpers: MiPo91 <http://www.otland.net> # ## Edited by: Kuzirashi # ################################################################################# ######################## ## Connection ## ######################## ## Leave these values ## ######################## $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); echo' <div id="visual-info"><div class="name">Top Players Frags</div></div><br><br><br> <table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr>'; $i = 0; foreach($SQL->query('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0,5;') as $player) { $V++; echo ' <td style="padding-right:20px;padding-top:3px" align="center"> <span style="color: #D5AC08;"> Rank : <p style="color:#336600;display:inline;padding: 0 0 2px 0;font-weight: bold;"> ' . $player['frags'] . ' <br /> <a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'"> <img src="'.WEBSITE.'/public/view/' . $playerVoc .'.png" width="90" height="90" border="0"/> <br /><b> <span style="color: #FFEEA8;">' . $player['name'] . '</b></a><br /> </td>'; } echo' </tr> </table>'; if(empty($i)) { echo ""; } echo "</div>"; echo "</div><br/>"; ?>
Postado Março 14, 2019 6 anos Este tópico foi movido para a área correta. Esta é uma mensagem automática!Pedimos que leia as regras do fórum! Spoiler This topic has been moved to the correct area. This is an automated message!Please read the forum rules. Projeto ATS (Naruto)Informações AbaixoFacebookYoutubeDiscord Tutoriais / ConteúdosClique Aqui
Postado Março 14, 2019 6 anos @KR3 Citar <?php ################################################################################# ## CONFIGURATION PAGE ## ################################################################################# ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- # ## ---------------------------------------------------------------------------- # ## Script created by Kavvson (http://otland.net/members/kavvson/) and MiPo91 # ## Author & developer: MiPo91 and Kavvson # ## # ## Helpers: MiPo91 <http://www.otland.net> # ## Edited by: Kuzirashi # ################################################################################# ######################## ## Connection ## ######################## ## Leave these values ## ######################## $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); echo' <div id="visual-info"><div class="name">Top Players Frags</div></div><br><br><br> <table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr>'; $i = 0; foreach($SQL->query('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0,5;') as $player) { $V++; echo ' <td style="padding-right:20px;padding-top:3px" align="center"> <span style="color: #D5AC08;"> Rank : <p style="color:#336600;display:inline;padding: 0 0 2px 0;font-weight: bold;"> ' . $player['frags'] . ' <br /> <a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'"> <img src="'.WEBSITE.'/public/view/vocations/' . $player['vocation'] .'.png" width="90" height="90" border="0"/> <br /><b> <span style="color: #FFEEA8;">' . $player['name'] . '</b></a><br /> </td>'; } echo' </tr> </table>'; if(empty($i)) { echo ""; } echo "</div>"; echo "</div><br/>"; ?> Fiz uma pequena alteração na varíavel $playerVoc para $player['vocation'], pois como está trazendo tudo em array fica mais prático se trabalhar desta forma. Agora basta tu teres uma pasta dentro do teu site com o nome vocations e dentro dela as imagens correspondentes. Ajudei? REP+ ? Servidor 8.6, Mapa Global Editado JKADS ?
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.