function dateSec($sec, $mode = 'simple') { $result = array(); $result = sectotime($sec); switch ($mode) { case 'simple': foreach ($result as $key => $val) { if ($val) { break; } } return $val . datename($key); break; case 'full': $output = ''; foreach ($result as $key => $val) { if (!$val) { continue; } $output .= " " . $val . datename($key); } return trim($output); break; } }
$finalsegtitle; for ($i = 0; $i < $n; $i++) { $title[$i] = $data[$i][0]; if (count($data[$i]) == 1) { $finalsegtitle = $data[$i][0]; $n--; } else { $endtime[$i] = sectotime($data[$i][1]); } if (count($data[$i]) > 2) { //is a question segment $qn[$i] = $data[$i][2]; if (count($data[$i]) > 3) { //has followup $followuptitle[$i] = $data[$i][5]; $followupendtime[$i] = sectotime($data[$i][3]); $showlink[$i] = $data[$i][4]; $hasfollowup[$i] = true; } else { $hasfollowup[$i] = false; $followuptitle[$i] = ''; $followupendtime[$i] = ''; $showlink[$i] = true; } } } } else { //new video stuff $n = count($qorder); $title = array_fill(0, $n, ''); $endtime = array_fill(0, $n, '');
if ($progress > 0 && $progress != $length) { echo "<br>(" . showperc($progress, $length) . "%)"; } echo "</td><td class=\"num\">" . showperc($erej["rprogress"], 10000) . "%</td><td>"; if ($agid == "") { echo "N/A"; } else { echo "<a href=\"{$myself}?a=agentdetail&agent={$agid}\">" . $erej["name"] . "</a>"; } echo "</td><td>" . date($config["timefmt"], $dispatchtime) . "</td><td>"; if ($solvetime == 0) { echo "(no activity)</td><td>"; } else { echo date($config["timefmt"], $solvetime); echo "</td><td class=\"num\">"; echo sectotime($erej["spent"]); } echo "</td><td>"; echo $states[$erej["state"]]; echo "</td><td class=\"num\">"; if ($erej["cracked"] > 0) { echo "<a href=\"{$myself}?a=hashes&chunk={$id}\">" . $erej["cracked"] . "</a>"; } echo "</td><td>"; if (!$active) { echo "<form action=\"{$myself}?a=chunkreset\" method=\"POST\" onSubmit=\"if (!confirm('Really reset chunk {$id}?')) return false;\">"; echo "<input type=\"hidden\" name=\"return\" value=\"a=taskdetail&task={$task}\">"; echo "<input type=\"hidden\" name=\"chunk\" value=\"{$id}\">"; echo "<input type=\"submit\" value=\"Reset\"></form>"; } else { echo "<form action=\"{$myself}?a=chunkabort\" method=\"POST\" onSubmit=\"if (!confirm('Really abort cracking chunk {$id}?')) return false;\">";