PHPNuke Block

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • PHPNuke Block

    hallo

    kann mir wer sagen warum dieser phpnuke block nicht funtzt danke.

    PHP-Code:
    <?php
    if (eregi("block-Server_Status.php",$PHP_SELF)) {
        
    Header("Location: index.php");
        die();
    }
    function 
    checkserverstatus($ip$port) {

            
    $up = @fsockopen($ip$port, &$errno, &$errstr"30");
            
        if(
    $up) {    
                    return 
    "<td><font color='#00ff33' size='2'>Online</td></font>";
                    
    $ipup 1;
                    return 
    $ipup;                
            }
                
        else    {
                    return 
    "<td><font color='#ff3300' size='2'>Offline</td></font>";

            }
    }
    $global_login checkserverstatus("localhost""6900");
    $global_char checkserverstatus("localhost""6121");
    $global_map checkserverstatus("localhost""5121");

    function 
    getip($hostname) {
        if(
    $ipup == 1) {
            
            
    $currentip gethostbyname($hostname);
            return 
    "<td align=\"center\"><font color='#00ff33' size='2'>$currentip</td></font>";
            
            }
            
        else    {
            
            return 
    "<td align=\"center\"><font color='#ff3300' size='2'>N/A</td></font>";
            
            }
    }
            
    $displayip getip("bla.com");

    $content  .= "<html>";
    $content  .= "<head>";
    $content  .= "</head>";
    $content  .= "<body>";
    $content  .= "<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" align=\"center\">";
    $content  .= "<tr>";
    $content  .= "<td>Login-Server</td>";
    $content  .= $global_login;
    $content  .= "</tr>";
    $content  .= "<tr>";
    $content  .= "<td>Char-Server</td>";
    $content  .= $global_char;
    $content  .= "</tr>";
    $content  .= "<tr>";
    $content  .= "<td>Map-Server</td>";
    $content  .= $global_map;
    $content  .= "</tr>";
    $content  .= "</table>";
    $content  .= "<p>";
    $content  .= "<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" align=\"center\">";
    $content  .= "<tr>";
    $content  .= "<td align=\"center\">Current IP:</td>";
    $content  .= "</tr>";
    $content  .= "<tr>";
    $content  .= $displayip;
    $content  .= "</tr>";
    $content  .= "</table>";
    $content  .= "</body>";
    $content  .= "</html>";
    ?>
    Zuletzt geändert von Nexus; 12.01.2004, 15:31.

  • #2
    sehr präzise frage .... was genau funktioniert nicht? was passiert / passiert nicht?
    h.a.n.d.
    Schmalle

    http://impressed.by
    http://blog.schmalenberger.it



    Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
    ... nur ohne :-)

    Kommentar


    • #3
      Genau gesagt diese function
      PHP-Code:
      function getip($hostname) {
          if(
      $ipup == 1) {
              
              
      $currentip gethostbyname($hostname);
              return 
      "<td align=\"center\"><font color='#00ff33' size='2'>$currentip</td></font>";
              
              }
              
          else    {
              
              return 
      "<td align=\"center\"><font color='#ff3300' size='2'>N/A</td></font>";
              
              }

      gibt immer else aus

      und das $ipup kommt von hier

      PHP-Code:
      function checkserverstatus($ip$port) {

              
      $up = @fsockopen($ip$port, &$errno, &$errstr"30");
              
          if(
      $up) {    
                      return 
      "<td><font color='#00ff33' size='2'>Online</td></font>";
                      
      $ipup 1;
                      return 
      $ipup;               
              }
                  
          else    {
                      return 
      "<td><font color='#ff3300' size='2'>Offline</td></font>";

              }

      Kommentar


      • #4
        in deiner function getip ist $ipup nicht verfügbar! setzte dich mal mit den geltungsbereichen von variablen auseinander!
        h.a.n.d.
        Schmalle

        http://impressed.by
        http://blog.schmalenberger.it



        Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
        ... nur ohne :-)

        Kommentar


        • #5
          hm nach dem } ist return $ipup; nicht mehr gültig oder wie ?

          hm irgendwie so ?
          PHP-Code:
          function checkserverstatus($ip$port) {
          global 
          $globalip;
          $globalip $ipup;

                  
          $up = @fsockopen($ip$port, &$errno, &$errstr"30");
                  
              if(
          $up) {    
                          return 
          "<td><font color='#00ff33' size='2'>Online</td></font>";
                          
          $ipup 1;          
                  }
                      
              else    {
                          return 
          "<td><font color='#ff3300' size='2'>Offline</td></font>";

                  }

          Zuletzt geändert von Nexus; 12.01.2004, 15:32.

          Kommentar

          Lädt...
          X