Good 4 Denunciar post Postado Março 10, 2010 Eu peguei uns scripts na internet, só que eles estão muito lento.. eu ainda consegui fazer com que ficasse mais rápido alguns scripts, mas esses não tenho idéia de como fazer.. //PEGA INFORMAÇÕES DO BANCO DE DADOS $main = $functions->pegaNivel(15); $cranny = $functions->pegaNivel(23); $granary = $functions->pegaNivel(11); //SEGUNDA PARTE! if($main == 0 && $id != 39 && $id != 40) { include("ok/main.tpl"); } if(($cranny == 0 || $cranny == 10) && $main >= 1 && $id != 39 && $id != 40) { include("ok/cranny.tpl"); } if(($granary == 0 || $granary == 20) && $main >= 1 && $id != 39 && $id != 40) { include("ok/granary.tpl"); } Eu vi que o script fica lento nesta segunda parte... acredito que seja porque tem várias verificações com if.. e o arquivo que é incluído é apenas html.. E estes ifs são vários, eu postei alguns só para vocês verem e me darem algumas dicas pra fazer melhor.. não sei se tem outro jeito de fazer que seja mais rápido.. não tenho idéia pq apenas nos ifs mesmo.. vlw Compartilhar este post Link para o post Compartilhar em outros sites
Aneildo 0 Denunciar post Postado Março 10, 2010 cara eu num sei se isso te ajuda mas pelo menos reduz um poco da verificação do $id e do $main em todo if <?php $main = $functions->pegaNivel(15); $cranny = $functions->pegaNivel(23); $granary = $functions->pegaNivel(11); if($id != 39 && $id != 40) { if($main == 0) include('ok/main.tpl'); else { if($cranny == 0 || $cranny == 10) include('ok/cranny.tpl'); if($granary == 0 || $granary == 20) include('ok/granary.tpl'); } } Compartilhar este post Link para o post Compartilhar em outros sites
Good 4 Denunciar post Postado Março 10, 2010 Vlw, mas acredito que não tem jeito mesmo.. pq cada if daqueles não tem nada relacionado com o outro.. mas o tópico já tá resolvido! Vlw pela ajuda.. Compartilhar este post Link para o post Compartilhar em outros sites