Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Błąd ze Skryptem..
Forum PHP.pl > Forum > Przedszkole
Jankes
Kod
Fatal error: Call to a member function on a non-object in /home/accounts_j/jankes/public_html/var/chatmsgs.php on line 60

Tak wygląda błąd.. a znajduje się on w tej części Kodu :

  1. <?php
  2. require_once('includes/config.php');
  3. require_once('libs/Smarty.class.php');
  4.  
  5. $smarty = new Smarty;
  6. $smarty -> compile_check = true;
  7.  
  8. $pass = md5($_SESSION['pass']);
  9. $stat = $db -> Execute("SELECT id, rank, lang, seclang, style, graphic FROM players WHERE email='".$_SESSION['email']."' AND pass='".$pass."'");
  10.  
  11. /**
  12. * Get the localization for game
  13. */
  14. require_once("languages/pl/chatmsg.php");
  15.  
  16. /**
  17. * Select style for chat
  18. */
  19. if ($stat -> fields['graphic'])
  20. {
  21.     $smarty -> template_dir = "./templates/".$player -> graphic;
  22.     $smarty -> compile_dir = "./templates_c/".$player -> graphic;
  23.     $strCss = '';
  24. }
  25.     else
  26. {
  27.     $smarty -> template_dir = './templates';
  28.     $smarty -> compile_dir = './templates_c';
  29.     $strCss = $stat -> fields['style'];
  30. }
  31.  
  32. $chat = $db -> SelectLimit("SELECT * FROM chat WHERE lang='".$stat -> fields['lang']."' OR lang='".$stat -> fields['seclang']."' AND ownerid=0 OR ownerid=".$stat -> fields['id']." OR senderid=".$stat -> fields['id']." ORDER BY id DESC", 15);
  33. $span = (time() - 180);
  34. $pl = $db -> Execute("SELECT id, rank, user FROM players WHERE lpv>=".$span." AND page = 'Chat'");
  35. $numon = $pl -> RecordCount();
  36. $pl -> Close();
  37. $arrtext = array();
  38. $arrauthor = array();
  39. $arrsenderid = array();
  40. $i = 0;
  41. if ($stat -> fields['rank'] == 'Admin' || $stat -> fields['rank'] == 'Staff') 
  42. {
  43.     $smarty -> assign ("Showid", 1);
  44. }
  45. while (!$chat -> EOF) 
  46. {
  47.     $text = wordwrap($chat -> fields['chat'],30,"\n",1);
  48.     $arrtext[$i] = $text;
  49.     $arrauthor[$i] = $chat -> fields['user'];
  50.     $arrsenderid[$i] = $chat -> fields['senderid'];
  51.     $chat -> MoveNext();
  52.     $i = $i + 1;
  53. }
  54. $chat -> Close();
  55.  
  56. $smarty -> assign ( array(
  57.     "Text1" => $i,
  58.     "Online" => $numon, 
  59.     "Author" => $arrauthor, 
  60.     "Text" => $arrtext, 
  61.     "Senderid" => $arrsenderid,
  62.     "Charset" => CHARSET,
  63.     "Thereis" => THERE_IS,
  64.     "Texts" => TEXTS,
  65.     "Cplayers" => C_PLAYERS,
  66.     "Cid" => C_ID,
  67.     "CSS" => $strCss));
  68.     
  69. $smarty -> display ('chatmsgs.tpl');
  70. ?>


I nie wiem czemu.. czytałem dużo o tym błędzie.. ale i tak nei wiem co mam Tu zmienić aby działało.. dodam tez że jest to skrypt czatu znajdującego się w Silniku Gry php ,,Vermilion Engine" Prosze o Pomoc sad.gif
Hacker
Po pierwsze [ php ]
Po drugie podaj cały kod albo przynajmniej linię 60 w twoim pliku
Po trzecie nie wiem czy czasem tytuł nie jest niepoprawny
Guest
A Pomyłka.. ,,to jest cały Kod". Sory za tego posta ale naprawde nei wiem gdzie mam szukać pomocy sad.gif a mi to jest pilnie potrzebne
Hacker
jeżeli to jest cały poprawny kod to linia 60 to
Kod
    "Text" => $arrtext,

a tu nie ma błędu
envp
Nie wiem tak patrze na ten kod i nie zgadza mi sie zmienna

$stat, która pewnie otzymuje jakas tablice asocjacyjna od obiektu $db a potem jest traktowana jako obiekt ? ale moze sie myle. pozdrawiam
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.