URL = $array['NEWZDASH_URL']; $this->SHARED_SECRET = $array['NEWZDASH_SHARED_SECRET']; if ( $this->URL == "" ) { return false; }else{ return true; } } public function broadcast ( $arguments ) { if ( count($arguments) < 2 ) die ( "Invalid arguments count given in newzdash comms class\n" ); $pane = $arguments[1]; $state = $arguments[2]; //pname, pstate, ndsharedsecret $URL = $this->URL . "/tmuxapi.php?pname=" . urlencode($pane) . "&pstate=" . urlencode($state) . "&ndsharedsecret=" . urlencode($this->SHARED_SECRET); $handle=fopen($URL, "r"); $ret = fread($handle, 8192); fclose($handle); switch ( $ret ) { case "ok": printf ( "\n[NewzDash] " . $pane . " has been " . $state . "!\n" ); break; case "ss": printf( "NewzDash could not accept our communcation:\nShared Secret Incorrect!\n"); break; default: printf("NewzDash could not accept our communication:\nSomething went wrong!\n"); } } } ?>