Beispiel #1
0
             } elseif (!($size = filesize($filePath))) {
                 $error = $DLFILE_ERROR['ERROR_FILE_SIZE_IS_NULL'];
             } elseif ($fileSize && $fileSize != $size) {
                 $error = $DLFILE_ERROR['ERROR_FILE_SIZE_IS_WRONG'];
             }
             if ($size) {
                 trafficUpdate($file->getDbh(), date('Y-m-d'), $size);
                 if ($fileSize && $fileSize == $size) {
                     $file->set('sizeVerified', 1);
                 }
             }
             if ($error) {
                 if (file_exists($filePath) && $filePath != '') {
                     unlink($filePath);
                 }
                 printd("file failed: " . getDlFileErrorMsg($error) . "\n");
             } else {
                 printd("file ok: {$size} byte\n");
             }
             $file->set('error', $error);
             $file->set('size', $size);
         }
     } else {
         printd("ERROR: hoster plugin: no hosterExec() function\n");
     }
 } else {
     printd("ERROR: plugin not found: {$libThisHosterPath}\n");
 }
 if (!$file->get('stime')) {
     $file->set('stime', mktime());
 }
Beispiel #2
0
                        }
                        $trClass = '';
                        $status = array();
                        if (!$packet->get('stime')) {
                            $status[] = 'not started';
                        } elseif ($packet->get('stime') && !$packet->get('ftime')) {
                            $status[] = 'not finished';
                        } elseif ($packet->get('stime') && $packet->get('ftime')) {
                            $trClass = 'packetHasFinished';
                            $status[] = 'finished';
                        }
                        if ($packetFilesErrorsTypes) {
                            $trClass = 'packetHasError';
                            $packetFilesErrors = array();
                            foreach ($packetFilesErrorsTypes as $errorNo => $errorNum) {
                                $packetFilesErrors[] = getDlFileErrorMsg($errorNo);
                            }
                            $status[] = '<a href="#" onMouseOver="onMouseOverTip(this, \'This packet has the following errors: ' . join(', ', $packetFilesErrors) . '\')">errors</a>';
                        }
                        if ($packet->get('md5Verified')) {
                            $status[] = 'verified';
                        }
                        $progressBarId = 'progressBar' . $packet->get('id');
                        $stack .= '
							<tr id="packetTr' . $packet->get('id') . '">
								<td class="' . $trClass . '">' . $packet->get('id') . '</td>
								<td class="' . $trClass . '">' . $users[$packet->get('_user')]['login'] . '</td>
								<td class="' . $trClass . '"><a href="?a=packetEdit&amp;id=' . $packet->get('id') . '">' . $packet->get('name') . '</a></td>
								<td class="' . $trClass . '">' . date($CONFIG['DATE_FORMAT'], $packet->get('ctime')) . '</td>
								<td class="' . $trClass . '">' . ($packet->get('stime') ? date($CONFIG['DATE_FORMAT'], $packet->get('stime')) : '&nbsp;') . '</td>
								<td class="' . $trClass . '">' . ($packet->get('ftime') ? date($CONFIG['DATE_FORMAT'], $packet->get('ftime')) : '&nbsp;') . '</td>