Changeset 170
- Timestamp:
- 01/12/08 19:27:57 (12 months ago)
- Location:
- hellaworld/trunk
- Files:
-
- 8 modified
-
CHANGELOG (modified) (1 diff)
-
classes/HellaController.php (modified) (2 diffs)
-
completed.xml (modified) (1 diff)
-
index.php (modified) (1 diff)
-
js/hellaworld.php (modified) (2 diffs)
-
style/main.css (modified) (4 diffs)
-
templates/default.php (modified) (5 diffs)
-
templates/json.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
hellaworld/trunk/CHANGELOG
r165 r170 1 1 1.10 2 2 3 * Applied David Kubicek's patch for HTTP-uploading of NZBs, see 4 http://trac.cheezyblog.net/ticket/21 for details. (drarok) 5 6 * Fixed a bug where descending sort wouldn't work (chris) 7 3 8 * Fixed a bug where queue items with an ETA over 24 but less than 48 4 hours long weren't showing the days in the ETA 5 6 * Updated the bookmarklet to support Newzbin v2 and Newzxxx 9 hours long weren't showing the days in the ETA (chris) 10 11 * Updated the bookmarklet to support Newzbin v2 and Newzxxx (chris) 7 12 8 13 1.9 -
hellaworld/trunk/classes/HellaController.php
r158 r170 244 244 245 245 //add the argument to the argument array as an XML-RPC value 246 $atmp[] = new xmlrpcval($argument, 'int'); 246 $type = (is_numeric($arguments) ? 'int' : 'string'); 247 $atmp[] = new xmlrpcval($argument, $type); 247 248 } 248 249 … … 254 255 255 256 // convert it to a one item array contianing an XML-RPC value 256 $arguments = array(new xmlrpcval($arguments, 'int')); 257 $type = (is_numeric($arguments) ? 'int' : 'string'); 258 $arguments = array(new xmlrpcval($arguments, $type)); 257 259 } 258 260 -
hellaworld/trunk/completed.xml
r93 r170 1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <queue> 3 < /queue>3 <item><type>ERROR</type><archiveName>Apocalyptica Sheet Music Flood - 2007-12-30 (15 Books)</archiveName><destDir>/Volumes/LaCie/usenet/Books/Apocalyptica Sheet Music Flood - 2007-12-30 (15 Books)</destDir><elapsedTime>1s</elapsedTime><finishedTime>1200164124</finishedTime><parMessage>A problem occurred: FatalError: Unable to par repair: archive requires 77 more recovery blocks for repair</parMessage></item><item><type>SUCCESS</type><archiveName>The Colbert Report - 2008-01-10 - Muhammad Yunus</archiveName><destDir>/Volumes/LaCie/usenet/The Colbert Report - 2008-01-10 - Muhammad Yunus</destDir><elapsedTime>18s</elapsedTime><finishedTime>1200164254</finishedTime><parMessage/></item><item><type>SUCCESS</type><archiveName>The Colbert Report - 2008-01-09 - Matt Taibbi, Gov. Mike Huckabee</archiveName><destDir>/Volumes/LaCie/usenet/The Colbert Report - 2008-01-09 - Matt Taibbi, Gov. Mike Huckabee</destDir><elapsedTime>27s</elapsedTime><finishedTime>1200164664</finishedTime><parMessage></parMessage></item></queue> -
hellaworld/trunk/index.php
r169 r170 275 275 } 276 276 277 if (array_key_exists('nzbupload', $_FILES)) { 278 $nzbfile = trim($_FILES['nzbupload']['tmp_name']); 279 chmod($nzbfile, 0644); 280 $nzbname = trim($_FILES['nzbupload']['name']); 281 if (preg_match('/\.nzb$/i', $nzbname)) { 282 $newfile = dirname($nzbfile)."/".$nzbname; 283 move_uploaded_file($nzbfile, $newfile); 284 $c->enqueue($newfile); 285 unlink($newfile); 286 } else { 287 throw new Exception("Invalid NZB upload!"); 288 } 289 header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . $self); 290 } 291 277 292 if (array_key_exists('bookmarklet', $_GET)) { 278 293 if (preg_match('/((https?):\/\/)?(([A-Z0-9][A-Z0-9_-]*)((\.[A-Z0-9][A-Z0-9_-]*)+)?)(:(\d+))?(\/([^ ]*)?| |$)/i', $_GET['bookmarklet']) < 1) { -
hellaworld/trunk/js/hellaworld.php
r157 r170 81 81 var info = "<h2><?php echo _('Currently Downloading'); ?></h2>"; 82 82 if (json.downloading != null) { 83 info += "<div>" + json.downloading + "</div>";83 info += '<div class="nzbname">' + json.downloading + '</div>'; 84 84 info += '<div class="queuestats"><img alt="progress bar" src="progress.php?percentage=' + json.completed + '"/> <?php printf(_('%s%% complete'), "' + json.completed + '"); ?></div>'; 85 85 info += '<div class="queuestats"><?php printf(_('%sMB of %sMB remaining'), "' + json.remaining + '", "' + json.size + '"); ?></div>'; … … 133 133 for (i = 0; i < json.finished.length; i++) { 134 134 finished += '<li class="queuebox ' + json.finished[i].type + '">'; 135 finished += '<div class="queuetitle">' + json.finished[i].archiveName + '</div>'; 135 if (json.finished[i].url != '') { 136 finished += '<div><a class="queuetitle" href="' + json.finished[i].url + '">' + json.finished[i].archiveName + '</a></div>'; 137 } else { 138 finished += '<div class="queuetitle">' + json.finished[i].archiveName + '</div>'; 139 } 136 140 finished += '<ul class="queuecontrols"><li class="control"><a href="index.php?removefinished=' + json.finished[i].index + '"><?php echo _('Remove'); ?></a></li></ul>'; 137 141 finished += '<div class="queuestats"><?php printf(_('Finished on: %s Processing Time: %s'), "' + json.finished[i].finishedTime + '", "' + json.finished[i].elapsedTime"); ?>; -
hellaworld/trunk/style/main.css
r152 r170 62 62 } 63 63 64 # modules div{64 #nzbinput { 65 65 background: #eaeaea; 66 66 padding: 3px; … … 68 68 border-top: 0px; 69 69 margin-bottom: 10px; 70 min-height: 36px; 71 height: 36px; 70 min-height: 30px; 71 height: 73px; 72 } 73 74 #downrate { 75 background: #eaeaea; 76 padding: 3px; 77 border: 1px solid #000; 78 border-top: 0px; 79 margin-bottom: 10px; 80 min-height: 30px; 81 height: 30px; 82 } 83 84 #modules div input { 85 left: 0px; 72 86 } 73 87 … … 150 164 border: 1px solid #000; 151 165 margin-bottom: 10px; 166 } 167 168 .queuebox.first { 169 margin-left: 310px; 152 170 } 153 171 … … 193 211 .queuetitle { 194 212 font-weight: bold; 213 color: black; 214 } 215 216 .queuetitle:visited { 217 font-weight: bold; 218 color: black; 195 219 } 196 220 -
hellaworld/trunk/templates/default.php
r165 r170 47 47 <link rel="stylesheet" type="text/css" href="style/thickbox.css" /> 48 48 <link rel="stylesheet" type="text/css" href="style/tabs.css" /> 49 <link rel="icon" href="images/trac.ico" type="image/x-icon" /> 50 <link rel="shortcut icon" href="images/trac.ico" type="image/x-icon" /> 49 51 <!--[if lte IE 7]> 50 52 <link rel="stylesheet" href="style/tabs-ie.css" type="text/css" /> … … 67 69 <div id="modules"> 68 70 <h2><?php echo _('Add NZB Via Newzbin ID Or URL'); ?></h2> 69 <div >71 <div id="nzbinput"> 70 72 <form method="get" action="<?php echo $self; ?>"> 71 73 <fieldset> 74 <label for="nzbdownload"><?php echo _('Article ID or URL:'); ?><br /> <input type="text" name="nzbdownload" id="nzbdownload" /></label> 72 75 <input type="submit" value="Go" style="float:right;" /> 73 <label for="nzbdownload"><?php echo _('Article ID or URL:'); ?> <input type="text" name="nzbdownload" id="nzbdownload" /></label>74 76 </fieldset> 75 77 </form> 78 <form method="post" enctype="multipart/form-data" action="<?php echo $self; ?>"> 79 <fieldset> 80 <label for="nzbupload" ><?php echo _('Upload NZB:'); ?><br/> <input size=27 type="file" name="nzbupload" id="nzbupload" /></label> 81 <input type="submit" value="Go" style="float:right;" /> 82 </fieldset> 83 </form> 76 84 </div> 77 85 <h2><?php echo _('Set Rate Limit'); ?></h2> 78 <div >86 <div id="downrate" > 79 87 <form method="get" action="<?php echo $self; ?>"> 80 88 <fieldset> … … 101 109 <h2><?php echo _('Currently Downloading'); ?></h2> 102 110 <?php if ($c->downloadCount > 0): foreach($c->downloads as $download): ?> 103 <div ><?php echo htmlspecialchars($download['nzbName']); ?></div>111 <div class="nzbname"><?php echo htmlspecialchars($download['nzbName']); ?></div> 104 112 <div class="queuestats"><img src="progress.php?percentage=<?php echo $c->completed; ?>" alt="progress bar" /> <?php printf(_('%s%% complete'), $c->completed); ?></div> 105 113 <div class="queuestats"><?php printf(_('%sMB of %sMB remaining'), $c->remaining, $download['total_mb']); ?></div> … … 154 162 <div id="log"><?php foreach ($c->log as $line): echo $line . "<br />"; endforeach; ?></div> 155 163 </div> 156 <?php if (isset($config['showfinished']) && $config['showfinished']): $finishedcount = count($x->item); ?> 164 <?php if (isset($config['showfinished']) && $config['showfinished']): $finishedcount = count($x->item); 165 $baseurl = (!strstr($config['basepath'], '://') ? $protocol . '://' . htmlentities($_SERVER['HTTP_HOST']) : '').$config['basepath'].'/'; 166 ?> 157 167 <div id="fragment-2"> 158 168 <div id="finishedbox"> … … 169 179 <li class="queuebox" style="text-align: center; font-weight: bold;"><?php echo _('No Finished Items'); ?></li> 170 180 <?php else: ?> 171 <?php $i = 0; foreach($x->item as $item): $i++; ?> 181 <?php $i = 0; foreach($x->item as $item): 182 $i++; $durl = ''; 183 if (!strncmp($config['destpath'], (string)$item->destDir, strlen($config['destpath'])) && is_dir((string)$item->destDir)): 184 $durl = $baseurl.substr((string)$item->destDir, strlen($config['destpath'])+1); 185 endif 186 ?> 172 187 <li class="queuebox <?php echo (((string)$item->type == 'SUCCESS') ? 'good' : 'bad'); ?>"> 173 <div class="queuetitle"> 174 <?php echo (string)$item->archiveName; ?> 188 <div> 189 <?php if ($config['showlinks'] && !empty($durl)): ?> 190 <div><a class="queuetitle" href="<?php echo $durl; ?>"><?php echo (string)$item->archiveName; ?></a></div> 191 <?php else: ?> 192 <div class="queuetitle"><?php echo (string)$item->archiveName; ?></div> 193 <?php endif ?> 175 194 </div> 176 195 <ul class="queuecontrols"> -
hellaworld/trunk/templates/json.php
r157 r170 77 77 $hellainfo['showfinished'] = true; 78 78 $hellainfo['finished'] = array(); 79 $baseurl = (!strstr($config['basepath'], '://') ? $protocol . '://' . htmlentities($_SERVER['HTTP_HOST']) : '').$config['basepath'].'/'; 79 80 $i = 0; 80 81 foreach($x->item as $item) { 81 82 $tmp = array(); 83 $durl = ''; 84 if (!strncmp($config['destpath'], (string)$item->destDir, strlen($config['destpath']))) { 85 $durl = $baseurl.substr((string)$item->destDir, strlen($config['destpath'])+1); 86 } 82 87 $tmp['index'] = ++$i; 83 88 $tmp['type'] = (((string)$item->type == 'SUCCESS') ? 'good' : 'bad' ); 84 89 $tmp['archiveName'] = (string)$item->archiveName; 85 90 $tmp['destDir'] = (string)$item->destDir; 91 $tmp['url'] = $durl; 86 92 $tmp['elapsedTime'] = (string)$item->elapsedTime; 87 93 $tmp['finishedTime'] = date('M dS - H:i:s', (int)$item->finishedTime);
