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 :
<?php
require_once('includes/config.php');
require_once('libs/Smarty.class.php');
$smarty = new Smarty;
$smarty -> compile_check = true;
$pass = md5($_SESSION['pass']); $stat = $db -> Execute("SELECT id, rank, lang, seclang, style, graphic FROM players WHERE email='".$_SESSION['email']."' AND pass='".$pass."'");
/**
* Get the localization for game
*/
require_once("languages/pl/chatmsg.php");
/**
* Select style for chat
*/
if ($stat -> fields['graphic'])
{
$smarty -> template_dir = "./templates/".$player -> graphic;
$smarty -> compile_dir = "./templates_c/".$player -> graphic;
$strCss = '';
}
else
{
$smarty -> template_dir = './templates';
$smarty -> compile_dir = './templates_c';
$strCss = $stat -> fields['style'];
}
$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);
$pl = $db -> Execute("SELECT id, rank, user FROM players WHERE lpv>=".$span." AND page = 'Chat'");
$numon = $pl -> RecordCount();
$pl -> Close();
$i = 0;
if ($stat -> fields['rank'] == 'Admin' || $stat -> fields['rank'] == 'Staff')
{
$smarty -> assign ("Showid", 1);
}
while (!$chat -> EOF)
{
$text = wordwrap($chat -> fields
['chat'],30,"\n",1
); $arrtext[$i] = $text;
$arrauthor[$i] = $chat -> fields['user'];
$arrsenderid[$i] = $chat -> fields['senderid'];
$chat -> MoveNext();
$i = $i + 1;
}
$chat -> Close();
$smarty -> assign
( array( "Text1" => $i,
"Online" => $numon,
"Author" => $arrauthor,
"Text" => $arrtext,
"Senderid" => $arrsenderid,
"Charset" => CHARSET,
"Thereis" => THERE_IS,
"Texts" => TEXTS,
"Cplayers" => C_PLAYERS,
"Cid" => C_ID,
"CSS" => $strCss));
$smarty -> display ('chatmsgs.tpl');
?>
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
Ten post edytował dr_bonzo 3.05.2006, 18:12:40