Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Błąd strony biała strona z napisami ? oO
Steel
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 4.11.2017

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


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'];
Go to the top of the page
+Quote Post
Kshyhoo
post
Post #2





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




I my wróżki mamy znać wszystkie funkcje, do których odwołują się te linie kodu?

Przenoszę...
Go to the top of the page
+Quote Post
Steel
post
Post #3





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 4.11.2017

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


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/
Go to the top of the page
+Quote Post
viking
post
Post #4





Grupa: Zarejestrowani
Postów: 6 380
Pomógł: 1116
Dołączył: 30.08.2006

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


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.
Go to the top of the page
+Quote Post

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: 23.08.2025 - 05:07