WordPress.org

Ready to get started?Download WordPress

Forums

Refresh Widgets (1 post)

  1. x86cam
    Member
    Posted 1 year ago #

    Hello, I am currently designing a radio blog, and I found a plugin called IceStats.

    I modified the icestats-display.php file to be this:

    <?php
    //Display IceCast Server Stats
    
    	$server = get_option('icestats_server');
         	$iceport = get_option('icestats_port');
    	$iceurl = get_option('icestats_url');
            $online = "<font color=green><b>ONLINE</b> </font><br />";
            $offline = "<font color=red><b>OFFLINE</b></font><br />";
    
            if($fp = @fsockopen($server, $iceport, $errno, $errstr, '1')) {
                    fclose($fp);
                    $ice_status=$online;
                    echo "<br /><p><b>&nbsp&nbsp Stream Status:</b> $ice_status";
                    $stats = file("http://" . $server . ":" . $iceport . "/status2.xsl");
                    $status = explode(",", $stats[5]);
                    $artist = explode("-", $status[5]);
                    echo "<p>";
                    echo "<b>&nbsp&nbsp Artist:</b> " . $artist[0];
                    echo "<br />";
                    echo "<b>&nbsp&nbsp Song:</b> " . $artist[1];
                    echo "</p>";
    		echo "<hr />";
    		echo "<p>&nbsp&nbsp&nbsp <a href=http://" . $server . ":" . $iceport . "/" . $iceurl . " target=new><b>Listen!</b></a></p>";
    
             } else {
    
                    $ice_status=$offline;
                    echo "<p><b>Stream Status:</b> $ice_status";
            }
    
    ?>

    I want it to refresh the radio stats INSIDE the Widget, so that it doesn't bother the user.

    I did some searches on google, and the only thing I could find was

    <?php header('Refresh: 20');
    ?>

    I tried, but it kept refreshing the PAGE. I want it to refresh the widget.

    Here is my website for you to see: http://www.x86cam.com/

Topic Closed

This topic has been closed to new replies.

About this Topic