Forum Pomoc w Silniku Vallheru Strona Główna Pomoc w Silniku Vallheru
Skarbnica wiedzy o Vallheru
 
 FAQFAQ   SzukajSzukaj   UżytkownicyUżytkownicy   GrupyGrupy   GalerieGalerie   RejestracjaRejestracja 
 ProfilProfil   Zaloguj się, by sprawdzić wiadomościZaloguj się, by sprawdzić wiadomości   ZalogujZaloguj 

Bug w karczmie

 
Napisz nowy temat   Odpowiedz do tematu    Forum Pomoc w Silniku Vallheru Strona Główna -> FAQ
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Gala
Administrator



Dołączył: 11 Lis 2006
Posty: 28
Przeczytał: 0 tematów

Ostrzeżeń: 0/5

PostWysłany: Nie 18:26, 12 Lis 2006    Temat postu: Bug w karczmie

Jeśli masz silnik 0.8+ to aby rozwiązać problem z karczmą otwórz plik chatmsg.php usun wszystko i wloż poniższy kod:

Kod:
<?php
/**
* File functions:
* Show text in chat
*
* @name : chatmsg.php
* @copyright : (C) 2004-2005 Vallheru Team based on Gamers-Fusion ver 2.5
* @author : thindil <thindil@users.sourceforge.net>
* @version : 0.8 beta
* @since : 23.06.2005
*
*/

//
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//
require_once('includes/config.php');
require_once('includes/sessions.php');
require_once('libs/Smarty.class.php');

$smarty = new Smarty;
$smarty -> compile_check = true;

$stat = $db -> Execute("SELECT id, rank, lang, seclang, style, graphic FROM players WHERE email='".$_SESSION['email']."'");

/**
* 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 rank, id, lpv, user FROM players WHERE page='Chat'");
$arrtext = array();
$arrauthor = array();
$arrsenderid = array();
$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();


$ctime = time();
$on = '';
$numon = 0;
while (!$pl -> EOF)
{
$span = ($ctime - $pl -> fields['lpv']);
if ($span <= 180)
{
$on = $on." [<A href=view.php?view=".$pl -> fields['id']." target=_parent>".$pl -> fields['user']."</a> (".$pl -> fields['id'].")] ";
$numon = ($numon + 1);
}
$pl -> MoveNext();
}
$pl -> Close();
$query = $db -> Execute("SELECT id FROM chat");
$numchat = $query -> RecordCount();
$query -> Close();

$smarty -> assign ( array("Player" => $on,
"Text1" => $numchat,
"Online" => $numon,
"Author" => $arrauthor,
"Text" => $arrtext,
"Senderid" => $arrsenderid,
"Charset" => CHARSET,
"Thereis" => Jest,
"Texts" => wypowiedzi,
"Cplayers" => graczy,
"Cid" => id,
"CSS" => $strCss));
$smarty -> display ('chatmsgs.tpl');

?>



Teraz wszystko powinno działać!


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Wyświetl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu    Forum Pomoc w Silniku Vallheru Strona Główna -> FAQ Wszystkie czasy w strefie EET (Europa)
Strona 1 z 1

 
Skocz do:  
Możesz pisać nowe tematy
Możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach

fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2005 phpBB Group
Regulamin