Example #1
0
                     }
                     if ($current_challenge == 9) {
                         $done = true;
                     }
                     if (isset($done) && $done) {
                         $queryupdate = "UPDATE " . USER_TABLE . " SET " . "user_totalchallenges=" . $current_challenge . ", " . "user_totalpoints=" . $current_points . ", " . "user_cluestaken=" . $user_cluestaken . ", " . "user_endtime=" . time() . ", " . "user_alldone=1 WHERE " . "user_id=" . $user_id . " AND " . "user_name='" . $_SESSION['hs_uname'] . "' " . "LIMIT 1";
                     } else {
                         $queryupdate = "UPDATE " . USER_TABLE . " SET " . "user_totalchallenges=" . $current_challenge . ", " . "user_totalpoints=" . $current_points . ", " . "user_cluestaken=" . $user_cluestaken . " WHERE " . "user_id=" . $user_id . " AND " . "user_name='" . $_SESSION['hs_uname'] . "' " . "LIMIT 1";
                     }
                     $result = $conn->query($queryupdate) or msg_die($conn->error, 'D');
                 }
             }
         }
     }
 }
 $redtime = sec2min($user_endtime - time());
 $timeleft = sec2arr($user_endtime - time());
 // This function removes all newlines from the generated page.. nice way to obscure stuff?
 function stupid_hack_newlines($str)
 {
     return str_replace(array("\r\n", "\r", "\n"), '', $str);
 }
 ob_start('stupid_hack_newlines');
 if (!isset($_SESSION['hs_challocatedpts'])) {
     $_SESSION['hs_challocatedpts'] = 5 * $current_challenge;
 }
 if (!isset($_SESSION['hs_ch_complete'])) {
     $_SESSION['hs_ch_complete'] = false;
 }
 if ($_SESSION['hs_ch_complete']) {
     render_page('Challenge ' . $current_challenge, phtml('challenge-success', ['session' => $_SESSION, 'ext' => $_ext, 'script_path' => $script_path], false), $script_path);
 function GetEncodedTime($pkey)
 {
     if (!file_exists(dirname(__FILE__) . '/../log/' . $pkey . '.ffmpeg')) {
         $this->logError('ffmpeg-progressbar: can\'t open FFMPEG-Log \'./log/' . $pkey . '.ffmpeg\'', date("d-m-y") . '.error.log');
         exit('ffmpeg-progressbar: can\'t open FFMPEG-Log \'./log/' . $pkey . '.ffmpeg\'');
     } else {
         $FFMPEGLog = @file_get_contents(dirname(__FILE__) . '/../log/' . $pkey . '.ffmpeg');
         if (preg_match("/Lsize=/i", $FFMPEGLog)) {
             return sec2min($this->total_time);
         } else {
             $times = explode('time=', $FFMPEGLog);
             $ctime = count($times) - 1;
             $timed = explode(' bitrate=', $times[$ctime]);
             $tt = $timed[0];
             $final = explode('.', $tt);
             return $final[0];
         }
     }
 }
Example #3
0
<?php

require_once '../isnd/db_config.php';
require_once '../isnd/functions.php';
db_connect();
$query = "SELECT * FROM hs_users ORDER BY user_totalpoints DESC";
$result = $conn->query($query);
echo "<table cellspacing=\"1\" cellpadding=\"1\">\n\t<tr><th>Name</th><th>Pseudo Name</th><th>Username</th><th>Challenges<br>Completed</th><th>Total Points</th><th>Time Taken</th><th>Clues Used</th><th>Full Complete</th></tr>\n";
while ($row = $result->fetch_assoc()) {
    if ($row['user_alldone'] == 1) {
        $timetaken = sec2min($row['user_endtime'] - $row['user_starttime']);
    } else {
        if ($row['user_hasstarted'] == 1) {
            $timetaken = sec2min(time() - $row['user_starttime']);
            if ($timetaken > 40) {
                $timetaken = "40:00";
            }
        } else {
            $timetaken = "0:00";
        }
    }
    echo "\t<tr>\n";
    echo "\t\t<td>" . $row['user_fullname'] . "</td>\n";
    echo "\t\t<td>" . $row['user_pseudoname'] . "</td>\n";
    echo "\t\t<td>" . $row['user_name'] . "</td>\n";
    echo "\t\t<td>" . $row['user_totalchallenges'] . "</td>\n";
    echo "\t\t<td>" . $row['user_totalpoints'] . "</td>\n";
    echo "\t\t<td>" . $timetaken . "</td>\n";
    echo "\t\t<td>" . $row['user_cluestaken'] . "</td>\n";
    echo "\t\t<td>" . ($row['user_alldone'] == 1 && $row['user_totalchallenges'] == 10 ? "Yes" : "No") . "</td>\n";
    echo "\t</tr>\n";