problem mit einem Code

  • Hallo ihr lieben

    Ich habe eine Website indem ich ein Widget erstellt habe. Da man mir sagte das der Code den ich habe php ist habe ich mir erstmal ein php widget plgin runter geladen und installiert.

    dann habe ich das widget erstellt ,ihm einen Namen gegeben und dann den code rein kopiert.


    <div style="position: relative; top: -17px">
    <center><a href=http://steamcommunity.com/groups/schlachtfestchen target="_blank"><img src=http://schlachtfestchen.de/wordpress/wp-c…amcommunity.png></center></a>
    <?php
    $path = "cache/steamgroup.txt";


    if (!function_exists("CallAPI"))
    {
    function CallAPI($url)
    {
    $curl = curl_init();

    curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
    curl_setopt($curl, CURLOPT_TIMEOUT, 3);
    curl_setopt($curl, CURLOPT_HEADER, 0);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_USERAGENT, "SmacStats");

    $data = curl_exec($curl);
    curl_close($curl);

    return $data;
    }
    }

    if (!file_exists($path) || (time() - filemtime($path)) > 600)
    {
    try
    {
    $xml = simplexml_load_string(CallAPI("http://steamcommunity.com/groups/schlach…slistxml/?xml=1"));

    if ($xml)
    {
    $string = $string.'
    <div class="membercounts">
    <div class="membercount members">
    <a href="http://steamcommunity.com/groups/schlachtfestchen#members">
    <span class="count " style="color: #333333">'.$xml->groupDetails->memberCount.'</span>
    <br>
    <span class="label" style="color: #333333">MITGLIEDER</span>
    </a>
    </div>
    <div>
    <center>
    <strong>
    <span style="color: #333333">'.$xml->groupDetails->memberCount.'</span>
    <br>
    <span style="color: #333333">Members</span>
    </strong>
    <br>
    ';


    <div class="membercount ingame">
    <div class="count ">258</div>
    <div class="label">IM SPIEL</div>
    </div>


    <div style="clear: left;"></div>
    </div>


    ';
    $string = $string.'
    <div class="membercount online">
    <div class="count ">'.$xml->groupDetails->membersOnline.'</div>
    <div class="label">Online</div>
    </div>(<font color="royalblue">'.$xml->groupDetails->membersOnline.' Online </font><font color="green">'.$xml->groupDetails->membersInGame.' In-Game</font>)</center></strong></div>';

    $file = fopen($path, 'wb');
    fwrite($file, $string);
    fclose($file);
    }
    }
    catch (Exception $e) {}
    }

    if (file_exists($path))
    echo file_get_contents($path);
    else
    echo '<br><b><span>Couldn\'t load Steam Group</span></b>';
    ?>
    </div>


    was mache ich falsch....

    • Anzeige

    Hallo!

    Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.

    • ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
    • ✔️ Deutsche Server & DSGVO-konform
    • ✔️ Persönlicher Support (kein 0815-Ticket-System)

    Mehr erfahren

  • Da man den Beitrag nicht editieren kann, muss ich einen neuen eröffnen.

    Wollte nur noch hinzufügen das das erstellte plugin nichts ausgibt...

    vielen dank für eure hilfe

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!