Witam,
Mam problem ze statystykami i już nie mam pojęcia gdzie jest błąd... Problem jest taki, że download jak i upload wyświetla mi w jednej kolumnie -> SKRYPT
Poniżej wklejam kod php:

  1. <?php
  2. #main_text_open();
  3.  
  4. $chunksize = 1*(1024*1024); // how many bytes per chunk
  5. $handle = fopen("/var/www/stats/nsstats.txt", 'rb');
  6. if ($handle === false) {
  7. return false;
  8. }
  9.  
  10. echo '<table align="center" width="80%" border="0" cellspacing="2" cellpadding="2">
  11. <tr align="center" style="padding-bottom: 10px;"><td class="title"> </td>
  12. <td class="title"><strong>Komputer</strong></td>
  13. <td class="title" align="center"><strong>Download</strong></td>
  14. <td class="title" align="center"><strong>Upload</strong></td></tr>';
  15.  
  16. while (!feof($handle)) {
  17. $buffer = fread($handle, $chunksize);
  18. $buffer3=explode("n", $buffer);
  19. $zlicz=1;
  20. $down=0;
  21. $up=0;
  22. for ($i=1;$i<count($buffer3);$i++) {
  23.  $buffer3[$i] = preg_replace('/s+/', ' ', $buffer3[$i]);
  24.  $buffer2=explode(" ", $buffer3[$i]);
  25.  if ($buffer2[0] !='') {
  26. echo '<tr><td align="right">'.($zlicz).'.</td>
  27.  <td style="padding-left: 10px;">'.$buffer2[0].'</td>
  28. <td align="right" style="padding-right: 30px;">'.substr($buffer2[4],0,-4).' kB/s</td>
  29.  <td align="right" style="padding-right: 30px;">'.substr($buffer2[9],0,-4).' kB/s</td>
  30. </tr>';
  31. $down=$down+substr($buffer2[4],0,-4);
  32. $up=$up+substr($buffer2[9],0,-4);
  33. $zlicz=$zlicz+1;
  34.  }
  35. }
  36.  
  37. echo '<tr style="padding-top: 10px;"><td> </td>
  38. <td align="center"><strong>razem</strong></td><td align="right" style="padding-right: 30px;"><strong>'.$down;
  39.  
  40. if (substr($down,-2,1)!='.') echo '.0';
  41. echo '</strong> kB/s</td><td align="right" style="padding-right: 30px;"><strong>'.$up;
  42.  
  43. if (substr($up,-2,1)!='.') echo '.0';
  44. echo '</strong> kB/s</td></tr></table>';
  45. }
  46.  
  47. fclose($handle);
  48.  
  49. #main_text_close();
  50. ?>


A to jest plik nsstats.txt...
  1. <?php
  2. download rate - ( utilize )
  3. Piekarnia_1 256kB/- ( 0kB/)
  4. Piekarnia_2 216kB/- ( 0kB/)
  5. Bezimienny  256kB/- (  30kB/)
  6. Master  232kB/- ( 0kB/)
  7. Sklep 174kB/- ( 0kB/)
  8. Zorro7  256kB/- ( 0kB/)
  9. Aga 256kB/- ( 0kB/)
  10. Damian  256kB/- (  83kB/)
  11.  
  12. upload rate - ( utilize )
  13. Piekarnia_1  52kB/- ( 0kB/)
  14. Piekarnia_2  52kB/- ( 0kB/)
  15. Bezimienny 34kB/- (  34kB/)
  16. Master 40kB/- ( 0kB/)
  17. Sklep  36kB/- ( 0kB/)
  18. Zorro7 52kB/- ( 0kB/)
  19. Aga  52kB/- ( 0kB/)
  20. Damian 52kB/- ( 3kB/)
  21.  
  22. Powered by NiceShaper
  23.  <a href="http://niceshaper.jedwabny.net" target="_blank">http://niceshaper.jedwabny.net</a>
  24. ?>



Z góry dziękuję za pomoc!
pozdr