Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/03/2015, 14:31
tutuyales
(Desactivado)
 
Fecha de Ingreso: junio-2013
Mensajes: 24
Antigüedad: 11 años, 5 meses
Puntos: 1
Pregunta Respuesta: Alargar el tiempo online del usuario

Código PHP:
Ver original
  1. <?php
  2. ################################################## ###############################
  3. ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
  4. ## --------------------------------------------------------------------------- ##
  5. ## Filename online.php ##
  6. ## Developed by: ##
  7. ## Edited by: ##
  8. ## License: ##
  9. ## Copyright: ##
  10. ## ##
  11. ################################################## ###############################
  12. @include("GameEngine/Database.php");
  13. @include("GameEngine/Admin/database.php");
  14. $active = $admin->getUserActive();
  15. ?>
  16. <style>
  17. .del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
  18. </style>
  19. <a href= dorf1.php>Return To The Game</a>
  20. <table id="member">
  21. <thead>
  22. <tr>
  23. <th colspan="6">Online Gamerz (<?php $online = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (36000*1000)")); echo $online; ?>)</th>
  24. </tr>
  25. </thead>
  26. <tr>
  27. <td>Name [access]</td>
  28. <td>Time</td>
  29. <td>Tribe</td>
  30. <td>Pop</td>
  31. <td>Villages</td>
  32. <td>Gold</td>
  33. </tr>
  34. <?php
  35. if($active){
  36. for ($i = 0; $i <= count($active)-1; $i++) {
  37. $uid = $database->getUserField($active[$i]['username'],'id',1);
  38. $varray = $database->getProfileVillages($uid);
  39. $totalpop = 0;
  40. foreach($varray as $vil) {
  41. $totalpop += $vil['pop'];
  42. }
  43. if($active[$i]['tribe'] == 1){
  44. $tribe = "Roman";
  45. } else if($active[$i]['tribe'] == 2){
  46. $tribe = "Teuton";
  47. } else if($active[$i]['tribe'] == 3){
  48. $tribe = "Gaul";
  49. }
  50. echo '
  51. <tr>
  52. <td><a href="?p=player&uid='.$uid.'">'.$active[$i]['username'].' ['.$active[$i]['access'].']</a></td>
  53. <td>'.date("d.m.y H:i:s",$active[$i]['timestamp']).'</td>
  54. <td>'.$tribe.'</td>
  55. <td>'.$totalpop.'</td>
  56. <td>'.count($varray).'</td>
  57. <td><img src="../img/admin/gold.gif" class="gold" alt="Gold" title="This user has: '.$active[$i]['gold'].' gold"/> '.$active[$i]['gold'].'</td>
  58. </tr>
  59. ';
  60. }
  61. }else{
  62. echo '<tr><td colspan="6" class="hab">Online Gamerz</td></tr>';
  63.  
  64. }
  65.  
  66. ?>