function widgetHardDrives() { global $drive; $warningthreshold = 90; if (!empty($drive)) { echo "<table border=\"0\" id=\"harddrives\">\n"; echo "\t<col id=\"col-disk\" />\n"; echo "\t<col id=\"col-capacity\" />\n"; echo "\t<col id=\"col-remaining\" />\n"; echo "\t<col id=\"col-progress\" />\n"; echo "\t<tr>\n"; echo "\t\t<th>Disk</th>\n"; echo "\t\t<th>Size</th>\n"; echo "\t\t<th>Free</th>\n"; echo "\t\t<th>Usage</th>\n"; echo "\t</tr>\n"; foreach ($drive as $drivelabel => $drivepath) { echo "\t<tr>\n"; echo "\t\t<td>" . $drivelabel . "</td>\n"; echo "\t\t<td>" . to_readable_size(disk_total_space($drivepath)) . "</td>\n"; echo "\t\t<td>" . to_readable_size(disk_free_space($drivepath)) . "</td>\n"; echo "\t\t<td><div class=\"progressbar\"><div class=\"progress" . (disk_used_percentage($drivepath) > $warningthreshold ? " warning" : "") . "\" style=\"width:" . disk_used_percentage($drivepath) . "%\"></div><div class=\"progresslabel\">" . sprintf("%u", disk_used_percentage($drivepath)) . "%</div></div></td>\n"; echo "\t</tr>\n"; } echo "</table>\n"; } }
function widgetHardDrives() { global $drive; $warningthreshold = 90; if(empty($drive)) { echo "<table border=\"0\" id=\"harddrives\">\n"; echo "\t<col id=\"col-disk\" />\n"; echo "\t<col id=\"col-capacity\" />\n"; echo "\t<col id=\"col-remaining\" />\n"; echo "\t<col id=\"col-progress\" />\n"; echo "\t<tr>\n"; echo "\t\t<th>Disk</th>\n"; echo "\t\t<th>Capacity</th>\n"; echo "\t\t<th>Remaining</th>\n"; echo "\t\t<th>%</th>\n"; echo "\t</tr>\n"; foreach( $drive as $drivelabel => $drivepath) { echo "\t<tr>\n"; echo "\t\t<td>".$drivelabel."</td>\n"; echo "\t\t<td>".to_readable_size(disk_total_space($drivepath))."</td>\n"; echo "\t\t<td>".to_readable_size(disk_free_space($drivepath))."</td>\n"; echo "\t\t<td><div class=\"progressbar\"><div class=\"progress".((disk_used_percentage($drivepath) > $warningthreshold) ? " warning" : "")."\" style=\"width:".(disk_used_percentage($drivepath))."%\"></div><div class=\"progresslabel\">".sprintf("%u", disk_used_percentage($drivepath))."%</div></div></td>\n"; echo "\t</tr>\n"; } echo "</table>\n"; } else{ echo 'You have not configured this feature in the config file yet.'; } }
function widgetSearch() { global $nzbusername, $nzbapi, $saburl, $sabapikey; if (empty($_POST['search'])) { echo "<form method=\"post\"><input type=\"text\" name=\"search\" />\n\t\t<select name=\"type\">\n\t\t<option value=\"\">ALL</option>\n\t\t<option value=\"1\">Movies: DVD</option>\n\t\t<option value=\"2\">Movies: DIVX</option>\n\t\t<option value=\"54\">Movies: BrRip</option>\n\t\t<option value=\"42\">Movies: HD x264</option>\n\t\t<option value=\"5\">TV: DVD</option>\n\t\t<option value=\"6\">TV: DivX</option>\n\t\t<option value=\"41\">TV: HD</option>\n\t\t<option value=\"7\">TV: Sports</option>\n\t\t<option value=\"9\">Documentaries</option>\n\t\t<option value=\"53\">Documentaries: HD</option>\n\t\t<option value=\"22\">MP3 Albums</option>\n\t\t<option value=\"47\">MP3 Singles</option>\n\t\t</select>\t\n\t\t<input type=\"submit\" name=\"submit\" value=\"Search\" />\n\t\t</form>"; } else { $item = $_POST['search']; echo "<form method=\"post\"><input type=\"text\" name=\"search\" value=\"{$item}\" />\n\t\t<select name=\"type\">\n\t\t<option value=\"\">ALL</option>\n\t\t<option value=\"1\">Movies: DVD</option>\n\t\t<option value=\"2\">Movies: DIVX</option>\n\t\t<option value=\"54\">Movies: BrRip</option>\n\t\t<option value=\"42\">Movies: HD x264</option>\n\t\t<option value=\"5\">TV: DVD</option>\n\t\t<option value=\"6\">TV: DivX</option>\n\t\t<option value=\"41\">TV: HD</option>\n\t\t<option value=\"7\">TV: Sports</option>\n\t\t<option value=\"9\">Documentaries</option>\n\t\t<option value=\"53\">Documentaries: HD</option>\n\t\t<option value=\"22\">MP3 Albums</option>\n\t\t<option value=\"47\">MP3 Singles</option>\n\t\t</select>\t\n\t <input type=\"submit\" name=\"submit\" value=\"Search\" />\n\t\t</form>"; $type = ""; if (!empty($_POST['type'])) { $type = "&catid=" . $_POST['type']; } $search = "http://api.nzbmatrix.com/v1.1/search.php?search=" . urlencode($item) . $type . "&username="******"&apikey=" . $nzbapi; $content = file_get_contents($search); $itemArray = explode('|', $content); foreach ($itemArray as &$item) { $item = explode(';', $item); /* foreach($item as &$value){ echo $value; echo "</br>"; } */ $id = (string) $item[0]; $name = (string) $item[1]; $link = (string) $item[2]; $size = 0 + substr($item[3], 6); $size = to_readable_size($size); $cat = $item[6]; $url = $saburl . "api?mode=addurl&name=http://www." . substr($link, 6) . "&nzbname=" . urlencode(substr($name, 9)) . "&apikey=" . $sabapikey; // Movies --> $_POST['type']==1||$_POST['type']==2||$_POST['type']==54||$_POST['type']==42||$_POST['type']==9||$_POST['type']==53|| // TV --> $_POST['type']==5||$_POST['type']==41||$_POST['type']==7||$_POST['type']==6|| // Music --> $_POST['type']==22||$_POST['type']==47|| if (strpos($cat, "Movies") != false || strpos($cat, "Documentaries") != false) { $sabcat = "movies"; } elseif (strpos($cat, "TV") != false) { $sabcat = "tv"; } elseif (strpos($cat, "Music") != false) { $sabcat = "music"; } else { $sabcat = ""; } if (!empty($sabcat)) { $url .= "&cat=" . $sabcat; } $popup = print_r($id, true) . "<br>" . print_r($name, true); $nzblink = "http://www." . substr($link, 6); if (strlen($name) != 0) { echo "<a href={$url}; target='nothing';><img class=\"sablink\" src=\"../media/sab2_16.png\" alt=\"Download with SABnzdd+\"/></a><a href=\"{$nzblink}\"; onMouseOver=\"ShowPopupBox('" . $popup . "');\" onMouseOut=\"HidePopupBox();\">" . substr($name, 9) . "</a><br>{$size}<br>{$cat}<br><br>"; } } } }