Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Błąd strony biała strona z napisami ? oO
Forum PHP.pl > Forum > Przedszkole
Steel
Witam, mam grę przeglądarkową, którą sobie edytuję ze starego silnika ikariam.

pod każdym błędem zamieszczam linijkę wyznaczoną przez błąd, jeżeli coś więcej potrzebujecie, napiszcie.

napotkałem pare błędów, min.

  1. A PHP Error was encountered
  2.  
  3. Severity: Warning
  4.  
  5. Message: Division by zero
  6.  
  7. Filename: sidebox/city.php
  8.  
  9. Line Number: 92


Linijka 92:
  1. $percent = 100 - floor($ostalos/$one_percent);

  1. A PHP Error was encountered
  2.  
  3. Severity: Warning
  4.  
  5. Message: Illegal string offset 'count'
  6.  
  7. Filename: models/update_model.php
  8.  
  9. Line Number: 354

  1. $army_start = $army_start + ($army[0]['count']*$cost['time']);

  1. A PHP Error was encountered
  2.  
  3. Severity: Notice
  4.  
  5. Message: Uninitialized string offset: 0
  6.  
  7. Filename: models/update_model.php
  8.  
  9. Line Number: 354

  1. $army_start = $army_start + ($army[0]['count']*$cost['time']);

  1. A PHP Error was encountered
  2.  
  3. Severity: Warning
  4.  
  5. Message: Illegal string offset 'type'
  6.  
  7. Filename: models/update_model.php
  8.  
  9. Line Number: 336

  1. $cost = $this->Data_Model->army_cost_by_type($army[0]['type'], $this->CI->$model->research, $this->CI->$model->levels[$i]);

  1. A PHP Error was encountered
  2.  
  3. Severity: Notice
  4.  
  5. Message: Uninitialized string offset: 0
  6.  
  7. Filename: models/update_model.php
  8.  
  9. Line Number: 336

  1. $cost = $this->Data_Model->army_cost_by_type($army[0]['type'], $this->CI->$model->research, $this->CI->$model->levels[$i]);

  1. A PHP Error was encountered
  2.  
  3. Severity: Warning
  4.  
  5. Message: Illegal string offset 'type'
  6.  
  7. Filename: models/update_model.php
  8.  
  9. Line Number: 339

  1. $class = $this->Data_Model->army_class_by_type($army[0]['type']);

  1. A PHP Error was encountered
  2.  
  3. Severity: Notice
  4.  
  5. Message: Uninitialized string offset: 0
  6.  
  7. Filename: models/update_model.php
  8.  
  9. Line Number: 339

  1. $class = $this->Data_Model->army_class_by_type($army[0]['type']);

  1. A PHP Error was encountered
  2.  
  3. Severity: Warning
  4.  
  5. Message: Illegal string offset 'count'
  6.  
  7. Filename: models/update_model.php
  8.  
  9. Line Number: 341

  1. if ($count >= $army[0]['count'])

  1. A PHP Error was encountered
  2.  
  3. Severity: Notice
  4.  
  5. Message: Uninitialized string offset: 0
  6.  
  7. Filename: models/update_model.php
  8.  
  9. Line Number: 341

  1. if ($count >= $army[0]['count'])

  1. Fatal error: Cannot access empty property in /home/steelq/domains/ikaris.pl/public_html/izariam/models/update_model.php on line 344

  1. $this->CI->$model->armys[$i]->$class = $this->CI->$model->armys[$i]->$class + $army[0]['count'];
Kshyhoo
I my wróżki mamy znać wszystkie funkcje, do których odwołują się te linie kodu?

Przenoszę...
Steel
Dlatego panie Wróżko napisałem, żeby ktoś napisał co mam podać?

city.php
http://wklej.org/id/3286618/


update_models.php
http://wklej.org/id/3286619/
viking
Wszystkie komunikaty są czytelne. Albo robisz dzielenie przez 0, albo odwołujesz się do nieistniejących elementów tablicy. Zrób sobie np. var_dump($army) i zobacz co zawiera.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.