Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> MyBB
Inaro
post
Post #1





Grupa: Zarejestrowani
Postów: 132
Pomógł: 0
Dołączył: 4.03.2010

Ostrzeżenie: (0%)
-----


Cześć, mam forum www.EQ-RP.pl silnik forum to MyBB, chcę w niego wbudować taki kod, który będzie pokazywał graczy online na serwerze...

Kod 1.
  1. <?php
  2. // ServerOnlineList v1.1 bY MultiGamer... PHP-script!
  3. $ip = "193.218.153.106:7777"; // Adres IP serwera
  4. $host = "193.218.153.106"; // Host FTP serwera
  5. $user = "s910"; // Użytkownik FTP serwera
  6. $pass = "ori09u5nv039PSRPa"; // Haslo do FTP serwera
  7. $file = "samp/scriptfiles/online.txt"; // modify only if your host's FTP doesn't go to the server's dir on connect
  8. $lang = "en"; // choose your preferred language here; supported: en, hu, sr
  9. // DON'T CHANGE ANYTHING AFTER THIS LINE!!!
  10. $conn = ftp_connect($host);
  11. ftp_login($conn, $user, $pass);
  12. ftp_get($conn, "online.txt", $file, FTP_ASCII);
  13. switch ($lang)
  14. {
  15. case "en":
  16. echo ("<b>Adres IP: $ip</b><br>Online players:<br>");
  17. break;
  18. case "hu":
  19. echo ("<b>IP-cím: $ip</b><br>Online játékosok:<br>");
  20. break;
  21. case "sr":
  22. echo ("<b>IP-адреса: $ip</b><br>Онлајн играчи:<br>");
  23. break;
  24. }
  25. $temp = file_get_contents("online.txt");
  26. if (strlen($temp) < 1)
  27. {
  28. switch ($lang)
  29. {
  30. case "en":
  31. echo ("Nie ma nikogo, grając na serwerze.");
  32. break;
  33. case "hu":
  34. echo ("Senki se játszik a szerveren.");
  35. break;
  36. case "sr":
  37. echo ("Нико не игра на сервер.");
  38. break;
  39. }
  40. }
  41. else
  42. {
  43. echo ("<table width='100%' cols='3' border='0'>");
  44. switch ($lang)
  45. {
  46. case "en":
  47. echo ("<tr><td>Postać</td><td>Level</td><td>Ping</td>");
  48. break;
  49. case "hu":
  50. echo ("<tr><td>Név</td><td>Pont</td><td>Ping</td>");
  51. break;
  52. case "se":
  53. echo ("<tr><td>Име</td><td>Бода</td><td>Ping</td>");
  54. break;
  55. }
  56. echo $temp;
  57. echo "</table>";
  58. }
  59. ftp_close($conn);
  60. ?>


Kod 2. - Tutaj gdzie piszę "Wbuduj tutaj kod nr 1." proszę o poprawne wgranie kodu nr 1
  1. <?php
  2.  
  3. global $headerinclude, $header, $theme, $footer;
  4.  
  5. $template='<html>
  6. <head>
  7. <title>'.$pages['name'].'</title>
  8. {$headerinclude}
  9. </head>
  10. <body>
  11. {$header}
  12. <table border="0" cellspacing="'.$theme['borderwidth'].'" cellpadding="'.$theme['tablespace'].'" class="tborder">
  13. <thead>
  14. <tr>
  15. <td class="thead">
  16. <strong>'.$pages['name'].'</strong>
  17. </td>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. <tr>
  22. <td class="trow1">Wbuduj tutaj kod nr 1.</td>
  23. </tr>
  24. </tbody>
  25. </table>
  26. <br />
  27. {$footer}
  28. </body>
  29. </html>';
  30.  
  31. $template=str_replace("\'", "'", addslashes($template));
  32.  
  33. add_breadcrumb($pages['name']);
  34.  
  35. eval("\$page=\"".$template."\";");
  36.  
  37. output_page($page);
  38.  
  39. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 18:04