Nie działa PHP w MyBB - plugin php in templates

Błąd   Założony przez  Kacper Wojciechowski.

Witam, mam problem:
[b]Parse error[/b]: syntax error, unexpected end of file in [b]/home/pszserv/public_html/graczeo.php(7) : eval()'d code(24) : eval()'d code[/b] on line [b]9[/b]

[b]Parse error[/b]: syntax error, unexpected end of file in [b]/home/pszserv/public_html/graczeo.php(7) : eval()'d code(69) : eval()'d code[/b] on line [b]11[/b]

[b]Parse error[/b]: syntax error, unexpected end of file in [b]/home/pszserv/public_html/graczeo.php(7) : eval()'d code(80) : eval()'d code[/b] on line [b]4[/b]

[b]Parse error[/b]: syntax error, unexpected '}' in [b]/home/pszserv/public_html/graczeo.php(7) : eval()'d code(93) : eval()'d code[/b] on line [b]2


kod PHP:
<?php
require "SampQueryAPI.php";
$query = new SampQueryAPI('188.68.250.207', '7799');
if($query->isOnline())
{
    $aInformation = $query->getInfo();
    $aServerRules = $query->getRules();
    
    ?>
    <b>General Information</b>
    <table width="400">
        <tr>
            <td>Hostname</td>
            <td><?= htmlentities($aInformation['hostname']) ?></td>
        </tr>
        <tr>
            <td>Gamemode</td>
            <td><?= htmlentities($aInformation['gamemode']) ?></td>
        </tr>
        <tr>
            <td>Players</td>
            <td><?= $aInformation['players'] ?> / <?= $aInformation['maxplayers'] ?></td>
        </tr>
        <tr>
            <td>Weather</td>
            <td><?= $aServerRules['weather'] ?></td>
        </tr>
        <tr>
            <td>Time</td>
            <td><?= $aServerRules['worldtime'] ?></td>
        </tr>
        <tr>
            <td>Version</td>
            <td><?= $aServerRules['version'] ?></td>
        </tr>
        <tr>
            <td>Password</td>
            <td><?= $aInformation['password'] ? 'Yes' : 'No' ?></td>
        </tr>
    </table>

    <br />
    <b>Online Players</b>
    <?php
    
    $aPlayers = $query->getDetailedPlayers();
    
    if(!is_array($aPlayers) || count($aPlayers) == 0)
    {
        echo '<br /><i>None</i>';
    }
    else
    {
        ?>
        <table width="400">
            <tr>
                <td><b>Player ID</b></td>
                <td><b>Nickname</b></td>
                <td><b>Score</b></td>
                <td><b>Ping</b></td>
            </tr>
        <?php
        foreach($aPlayers as $sValue)
        {
            ?>
            <tr>
                <td><?= $sValue['playerid'] ?></td>
                <td><?= htmlentities($sValue['nickname']) ?></td>
                <td><?= $sValue['score'] ?></td>
                <td><?= $sValue['ping'] ?></td>
            </tr>
            <?php
        }
    
        echo '</table>';
    }
}
?>

Używam pluginu PHP in Template.

Tu działa: http://psz-serv.xaa.pl/sss.php

Tu nie: http://psz-serv.xaa.pl/graczeo.php
php dziala
widac bo zwraca bledy

zamknij if
<?php
require "SampQueryAPI.php";
$query = new SampQueryAPI('188.68.250.207', '7799');
if($query->isOnline())
{
    $aInformation = $query->getInfo();
    $aServerRules = $query->getRules();
    }
    ?>
Zamknąłem ale:
Wewnętrzny błąd MyBB

MyBB napotkało błąd wewnętrzny i nie może kontynuować.

Typ błędu:
    Ostrzeżenie (2)
Treść błędu:
    fread() [function.fread]: Length parameter must be greater than 0
Lokalizacja:
    File: SampQueryAPI.php
    Line: 138
Kod:
    135.         $aDetails['gamemode'] = (string) fread($this->rSocket, $iStrlen);
    136.        
    137.         $iStrlen = ord(fread($this->rSocket, 4));
    138.         $aDetails['mapname'] = (string) fread($this->rSocket, $iStrlen);
    139.        
    140.         return $aDetails;
    141.     }
Fragment kodu:
    Plik     Linia     Funkcja
    /inc/class_error.php     207     errorHandler->output_error
    [PHP]           errorHandler->error
    /SampQueryAPI.php     138     fread
    /graczeo.php(7) : eval()'d code(24) : eval()'d code     6     SampQueryAPI->getInfo
    /graczeo.php(7) : eval()'d code     24     eval
    /graczeo.php     7     eval

Odwiedź Polski Support MyBB aby uzyskać pomoc.
nie może połączyć się z serwerem - tak tylko przypuszczam, w każdym bądź razie, klasa ma jakiś problem
A mam pytanie, jak zrobiłeś w pluginie "Servers Board" podstronę z listą graczy online (SAMP)?
zobacz, kod pluginu jest otwarty
Hmm, plugin mi w ogóle nie działa:
http://psz-serv.xaa.pl/serversboard.php?...tion&sid=1
Pobierz plugin jeszcze raz

Swoją drogą jesteś tu jakiś czas a jak dla mnie to zly dzial na ten temat.
Tak wiem ale chodzi o problem PHP, potrzebuje tylko listę graczy online, Wgrałem od nowa, odinstalowałem i zainstalowałem ponownie i nie działa.
http://psz-serv.xaa.pl/serversboard.php?...tion&sid=1

Tu widać że nie nadpisales tego pliku nowym, tam wrzucilem przypadkiem inną zawartośc
Nadpisałem wszystkie pliki. W konsoli jest taki błąd z jquery.js:
Error: Syntax error, unrecognized expression: Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.
czyli nie jest nadpisany, pewnie go nadpisujesz tym co masz na dysku, Pobierz od nowa plugin.
Okej, plugin z MyBB PL działa, z MyBB.com nie działał.
build 44 to to samo co w tej chwili u nas
wiec nie wiem o czym mowisz



Użytkownicy przeglądający ten wątek:

1 gości