Dokuwiki

Code for Test Vote

Code for Test Vote

<doodle
  title="What do you like best?"
  auth="none|ip|user"
  adminUsers="user1|user2"
  adminGroups="group1|group2"
  voteType="single|multi"
  closed="true|false" 
>
   * Option 1 
   * Option 2 **some wikimarkup** \\ is __allowed__!
   * Option 3
</doodle>

Table Code

Table Code

^ Heading 1      ^ Heading 2       ^ Heading 3          ^
| Row 1 Col 1    | Row 1 Col 2     | Row 1 Col 3        |
| Row 2 Col 1    | some colspan (note the double pipe) ||
| Row 3 Col 1    | Row 3 Col 2     | Row 3 Col 3        |


PHP & HTML

Read Shoutcast Server and show infos

Read Shoutcast Server and show infos

$server = "0.0.0.0";                                 // enter Domain or IP Address here
$port = 8000;                                        // Enter Port of Shoutcast Server here
$fp = @fsockopen($server, $port, $errno, $errstr, 30);

    if ($fp) {
        fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
        while(!feof($fp))
            $page .= fgets($fp, 1000);
        fclose($fp);
        $page = ereg_replace(".*<body>", "", $page);
        $page = ereg_replace("</body>.*", ",", $page);
        $numbers = explode(",", $page);
        $shoutcast_currentlisteners = $numbers[0];
        $connected = $numbers[1];
        if($connected == 1) {
            $radio_status = 1;
            $wordconnected = "yes";
        }
        else
            $wordconnected = "no";
        $shoutcast_peaklisteners = $numbers[2];
        $shoutcast_maxlisteners = $numbers[3];
        $shoutcast_reportedlisteners = $numbers[4];
        $shoutcast_bitrate = $numbers[5];
        $shoutcast_cursong = $numbers[6];
        $shoutcast_curbwidth = $shoutcast_bitrate * $shoutcast_currentlisteners;
        $shoutcast_peakbwidth = $shoutcast_bitrate * $shoutcast_peaklisteners;
    }
$hoerer1 = $shoutcast_currentlisteners;           //Current Listeners in $hoerer1
$peak1 = $shoutcast_peaklisteners;                //Peak Listeners in $peak1
$maxhoerer1 = $numbers[3];                        //Hax allowed Listeners in $maxhoerer1
$bitrate1 = $shoutcast_bitrate;                   //bitrate of Server in $bitrate1

<table border="0">
  <colgroup width="150" span="4"></colgroup>
   <td>Summary:</td>
   <td>Max. listeners allowed:/<?php echo $maxhoerer1; ?></td>
   <td>Peak: <?php echo $peak1; ?></td>
   <td>Bitrate: <?php echo $bitrate1; ?> kbit/s</td>
  </tr>
</table>

Read Shoutcast2 XML and show infos

Read Shoutcast2 XML and show infos

$aData = json_decode(json_encode(simplexml_load_string(file_get_contents('http://DOMAIN:PORT/stats?sid=STREAMID'))), true);  //Enter StreamData here

$shoutcast_currentlisteners = $aData['CURRENTLISTENERS'];
$hoerer1 = $aData['CURRENTLISTENERS'];
$peak1 = $aData['PEAKLISTENERS'];
$maxhoerer1 = $aData['MAXLISTENERS'];
$bitrate1 = $aData['BITRATE'];
$songtitle = $aData['SONGTITLE'];

<table border="0">
  <colgroup width="150" span="4"></colgroup>
   <td>Summary:</td>
   <td>Max. listeners allowed:/<?php echo $maxhoerer1; ?></td>
   <td>Current Listeners: <?php echo $hoerer1; ?></td>
   <td>Peak: <?php echo $peak1; ?></td>
   <td>Bitrate: <?php echo $bitrate1; ?> kbit/s</td>
   <td>Current Song: <?php echo $songtitle; ?> kbit/s</td>
  </tr>
</table>
/home/www/wiki/data/pages/test/reference.txt · Last modified: 2017/01/21 02:03 (external edit)
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0