Piabeta Kun 359 Posted October 3, 2012 Share Posted October 3, 2012 (edited) Bem eu achei algo que pode ter ultilidade a quem goste de dar nova cara ao seu site! Não é nada mais que uma pagina de top frags com skulls na mesma quantidade de frags! Crie uma Pagina Chamada Topkills.php e dentro coloque isso: <?php function skull($how){ $skulls = ""; for($i=0;$i<$how;$i++){ $skulls .= "<img src=\"http://otland.net/images/redskull.gif\"/>"; } return $skulls; } $main_content .= '<div style="text-align: center; font-weight: bold;"><h2>Top 100 killers on ' . $config['server']['serverName'] . '.NET/ORG/EU W/E</h2></div> <table border="0" cellspacing="1" cellpadding="4" width="100%"> <tr bgcolor="' . $config['site']['vdarkborder'] . '"> <td class="white" style="text-align: center; font-weight: bold;" width="4%">#</td> <td class="white" style="text-align: center; font-weight: bold;" width="30%">Name</td> <td class="white" style="text-align: center; font-weight: bold;" width="30%">Skulls</td> <td class="white" style="text-align: center; font-weight: bold;" width="10%">Frags</td> </tr>'; $i = 0; $pl = $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 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0,100;')->fetchAll(); foreach($pl as $player) { $i++; $skull = $player['frags']; $main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']) . '"> <td style="text-align: center;">'.$i.'</td> <td style="text-align: center;"><a href="?subtopic=characters&name=' . urlencode($player['name']) . '">' . $player['name'] . '</a></td> <td style="text-align: center;">' . skull($skull/100). '</td> <td style="text-align: center;">' . $player['frags'] . '</td> </tr>'; } $main_content .= '</table>'; ?> Agora vá em index.php e adicione isso: case "topkillers"; $topic = "topkillers"; $subtopic = "topkillers"; include("topkillers.php"); break; E em layouts/seulayout/layout.php Adicione isso <a href='index.php?subtopic=topkillers'> <div id='submenu_topkillers' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_guilds' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'>Top Killers</div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a> Abaixo disso: <a href='index.php?subtopic=guilds'> <div id='submenu_guilds' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_guilds' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'>Guilds</div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a> Imagem da pagina Creditos Ninja e PiabetaMan01 (por trazer o conteúdo ao forum!) Edited October 3, 2012 by PiabetaMan01 Link to comment Share on other sites More sharing options...
Foquinhaa 55 Posted October 3, 2012 Share Posted October 3, 2012 Legal mas tipo , você podia fazer assim qnd o player chegar a 10 kills ficaria black skull , mas se esse player morrer , ele perderá os itens? ou será skull de enfeite? Link to comment Share on other sites More sharing options...
Piabeta Kun 359 Posted October 4, 2012 Author Share Posted October 4, 2012 Essa pagina é só um enfeite, realmente eu pensei em fazer skill em tempo real, mais acho um pouco desnecessario ja que no whoisonline ja mostra a skull do player em tempo real! Link to comment Share on other sites More sharing options...
Demonbholder 420 Posted October 5, 2012 Share Posted October 5, 2012 Não acho que isso seja um tutorial, acredito que seja um código. Procede? Link to comment Share on other sites More sharing options...
Critical 70 Posted October 5, 2012 Share Posted October 5, 2012 (edited) ''Tutorial aprovado'', movido para seção correta. Atenciosamente, Critical. Edited October 5, 2012 by Critical Link to comment Share on other sites More sharing options...
Piabeta Kun 359 Posted October 5, 2012 Author Share Posted October 5, 2012 Não acho que isso seja um tutorial, acredito que seja um código. Procede? Em websites todos tutoriais são pareceidos pelo fato de serem codigos prontos, mais sempre ensinamos como aplicar o codigo e editalo se possivel! Dai ele se torna um tutorial! Link to comment Share on other sites More sharing options...
Dark KMK 0 Posted April 3, 2019 Share Posted April 3, 2019 Em 03/10/2012 em 02:55, Piabeta Kun disse: case "topkillers"; $topic = "topkillers"; $subtopic = "topkillers"; include("topkillers.php"); break; Não entendo, porque quando tento colocar esta linha da erro logo após coloca-la. Essa é Index: Spoiler <?php // comment to show E_NOTICE [undefinied variable etc.], comment if you want make script and see all errors error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE); // true = show sent queries and SQL queries status/status code/error message define('DEBUG_DATABASE', false); define('INITIALIZED', true); // if not defined before, set 'false' to load all normal if(!defined('ONLY_PAGE')) define('ONLY_PAGE', false); // check if site is disabled/requires installation include_once('./system/load.loadCheck.php'); // fix user data, load config, enable class auto loader include_once('./system/load.init.php'); // DATABASE include_once('./system/load.database.php'); if(DEBUG_DATABASE) Website::getDBHandle()->setPrintQueries(true); // DATABASE END // LOGIN if(!ONLY_PAGE) include_once('./system/load.login.php'); // LOGIN END // COMPAT // some parts in that file can be blocked because of ONLY_PAGE constant include_once('./system/load.compat.php'); // COMPAT END // LOAD PAGE include_once('./system/load.page.php'); // LOAD PAGE END // LAYOUT // with ONLY_PAGE we return only page text, not layout if(!ONLY_PAGE) include_once('./system/load.layout.php'); else echo $main_content; // LAYOUT END Link to comment Share on other sites More sharing options...
Recommended Posts