function items($url) { $data = cget($url); $xml = simplexml_load_string($data); $xml->registerXPathNamespace('dc', 'http://purl.org/dc/elements/1.1/'); return $xml->channel->item; }
function RefreshZwave($node, $name = 'auto', $device = '') { cset('timerefresh-' . $device, time); $devices = json_decode(file_get_contents(api . 'json.htm?type=openzwavenodes&idx=4'), true); for ($k = 1; $k <= 5; $k++) { ControllerBusy(20); $result = file_get_contents(api . 'ozwcp/refreshpost.html', false, stream_context_create(array('http' => array('header' => 'Content-Type: application/x-www-form-urlencoded\\r\\n', 'method' => 'POST', 'content' => http_build_query(array('fun' => 'racp', 'node' => $node)))))); if ($result === 'OK') { cset('timerefresh-' . $device, time); break; } sleep(1); } if (cget('timedeadnodes') < vijfmin) { cset('timedeadnodes', time); foreach ($devices as $node => $data) { if ($node == "result") { foreach ($data as $index => $eltsNode) { if ($eltsNode["State"] == "Dead" && !in_array($eltsNode['NodeID'], array(31, 50, 53, 55, 60))) { telegram('Node ' . $eltsNode['NodeID'] . ' ' . $eltsNode['Description'] . ' (' . $eltsNode['Name'] . ') marked as dead, reviving ' . ZwaveCommand($eltsNode['NodeID'], 'HasNodeFailed')); ControllerBusy(5); ZwaveCommand(1, 'Cancel'); } } } } } }
if (isset($_POST['Schakel'])) { if ($_POST['Schakel'] == 6 || $_POST['Schakel'] == 48) { if ($Sraamliving == 'Open') { echo '<script language="javascript">alert("WARNING:Raam living open!")</script>'; } if ($Sachterdeur == 'Open') { echo '<script language="javascript">alert("WARNING:Achterdeur open!")</script>'; } if ($Spoort == 'Open') { echo '<script language="javascript">alert("WARNING:Poort open!")</script>'; } } } echo '<div style="position:absolute;top:5px;left:260px;width:150px;text-align:right;"><a href=\'javascript:navigator_Go("floorplan.php");\' style="padding:35px 13px 6px 8px;font-size:33px;font-weight:500;color:#CCC;" title="refresh">' . strftime("%k:%M:%S", $time) . '</a></div> <div class="box" style="top:0px;height:248px;width:80px;z-index:100;">'; $weer = unserialize(cget('weer')); //$temp=cget('buiten_temp'); $temp = $weer['buiten_temp']; $hoogte = $temp * 3; if ($hoogte > 88) { $hoogte = 88; } else { if ($hoogte < 20) { $hoogte = 20; } } $top = 88 - $hoogte; if ($top < 0) { $top = 0; } $top = $top + 5;
<?php error_reporting(E_ALL); ini_set("display_errors", "on"); echo '<b><big><a href="">Cache view</a> <a href="memcache.php">MemCache</a> <a href="opcache.php">OpCache</a> <a href="opcache1.php">OpCache</a></big></b><br/><br/>'; if (isset($_POST)) { if (isset($_POST['reset']) && isset($_POST['value'])) { cset($_POST['reset'], $_POST['value']); } } $keys = getMemcachedKeys(); sort($keys); echo '<table cellpadding="0px" cellspacing="0px">'; foreach ($keys as $key) { $content = cget($key); echo '<tr><td valign="middle" align="right"><form method="POST"><input type="submit" name="reset" value="' . $key . '" style="height:23px;padding:0;margin:0 5px -15px 0"/></td><td valign="top"><input type="text" size="15" style="text-align:right;" name="value" value="' . htmlspecialchars($content) . '"/></form></td>'; if (startsWith($key, 'time') !== false) { if ($content != 0) { echo '<td valign="top"> ' . strftime("%a %e %b %k:%M:%S", $content) . '</td>'; } } elseif (startsWith($key, 'dimmer') !== false) { echo '<td valign="top"> '; switch ($content) { case 0: echo 'Normal'; break; case 1: echo 'Sleep'; break; case 2: echo 'Wake';
$key = md5($str); $index = $index + 1; if (isset($charCode[$key])) { return $charCode[$key][$index]; } $charCode[$key] = unpack('C*', $str); return $charCode[$key][$index]; } function charAt($str, $index = 0) { return substr($str, $index, 1); } if (!empty($_GET['vid'])) { $vid = $_GET['vid']; $link = 'http://play.youku.com/play/get.json?ct=12&vid=' . $vid; $retval = cget($link); if (!empty($retval)) { $rs = json_decode($retval, true); $ep = $rs['data']['security']['encrypt_string']; if (!empty($ep)) { $ip = $rs['data']['security']['ip']; $videoid = $rs['data']['id']; list($sid, $token) = explode('_', yk_e('becaf9be', base64_decode($ep))); $ep = urlencode(base64_encode(yk_e('bf7e5f01', $sid . '_' . $videoid . '_' . $token))); $final_url = 'http://pl.youku.com/playlist/m3u8?ctype=12&ep=' . $ep . '&ev=1&keyframe=1&oip=' . $ip . '&sid=' . $sid . '&token=' . $token . '&vid=' . $videoid . '&type=mp4'; echo $final_url; } else { echo 'Invalid vid.'; } } else { echo 'Error fetching.';
function RefreshZwave($node, $name = 'auto', $device = '') { global $domoticzurl, $time, $zwaveidx, $vijfmin, $actions; $devices = json_decode(curl($domoticzurl . 'json.htm?type=openzwavenodes&idx=' . $zwaveidx), true); //logwrite('Refreshing node '.$node.' '.$device.' '.$name); $zwaveurl = $domoticzurl . 'ozwcp/refreshpost.html'; $zwavedata = array('fun' => 'racp', 'node' => $node); $zwaveoptions = array('http' => array('header' => 'Content-Type: application/x-www-form-urlencoded\\r\\n', 'method' => 'POST', 'content' => http_build_query($zwavedata))); $zwavecontext = stream_context_create($zwaveoptions); for ($k = 1; $k <= 5; $k++) { $result = file_get_contents($zwaveurl, false, $zwavecontext); $actions = $actions + 1; if ($result === 'OK') { cset('timerefresh-' . $device, $time); break; } sleep(1); } if (cget('timedeadnodes') < $vijfmin) { cset('timedeadnodes', $time); foreach ($devices as $node => $data) { if ($node == "result") { foreach ($data as $index => $eltsNode) { if ($eltsNode["State"] == "Dead" && !in_array($eltsNode['NodeID'], array(50))) { $actions = $actions + 1; telegram('Node ' . $eltsNode['NodeID'] . ' ' . $eltsNode['Description'] . ' (' . $eltsNode['Name'] . ') marked as dead, reviving ' . ZwaveHasnodefailed($eltsNode['NodeID'])); sleep(2); Zwavecancelaction(); } } } } } return $result; }