예제 #1
0
파일: read.php 프로젝트: gepuro/smt2
<?php

if (empty($_GET['id'])) {
    die("No data.");
}
require '../../../../config.php';
$hn = new Hypernote($_GET['id'], $_GET['login'], $_GET['time']);
$notes = $hn->getData();
// when login and time are both passed, there's only one hypernote
if ($notes) {
    echo utf8_decode($notes[0]['txt']);
    // page has no encoding
} else {
    echo "It seems that " . $_GET['login'] . " did not leave a hypernote for this movie at that time.";
}
?>

<hr/>
<a href="#" onclick="history.go(-1);return false">Back</a> 
예제 #2
0
파일: sql.php 프로젝트: gepuro/smt2
     $cX = array_map('intval', explode(",", $log['coords_x']));
     $cY = array_map('intval', explode(",", $log['coords_y']));
     $cl = array_map('intval', explode(",", $log['clicks']));
     $weights[] = count($cX);
     $coordsX[] = $cX;
     // we'll need'em later
     $coordsY[] = $cY;
     //
     $clicks[] = $cl;
     //
     $fps[] = (int) $log['fps'];
     $hovered .= $log['hovered'];
     $clicked .= $log['clicked'];
     $timestamp = mask_client($log['client_id']) . '\\n' . date("h:i A", strtotime($log['sess_date']));
     $hn = new Hypernote($_GET['pid'], $_SESSION['login']);
     $hypernotes = $hn->getData(false);
     // build JavaScript object
     $JSON[] = '{' . '"id": ' . $log['id'] . ', ' . '"xcoords": [' . $log['coords_x'] . '], ' . '"ycoords": [' . $log['coords_y'] . '], ' . '"clicks":  [' . $log['clicks'] . '], ' . '"timestamp": "' . $timestamp . '", ' . '"hypernotes": ' . json_encode($hypernotes) . ', ' . '"wprev": ' . $vpw . ', ' . '"hprev": ' . $vph . ', ' . '"time": ' . $log['sess_time'] . '' . '}';
 }
 // set a common frame rate for all tracks
 $fps = ceil(array_avg($fps));
 $viewportWidth = ceil(array_avg($viewportWidth));
 $viewportHeight = ceil(array_avg($viewportHeight));
 // compute the average user path, if need be ---------------------------------
 if (db_option(TBL_PREFIX . TBL_CMS, "displayAvgTrack")) {
     // preprocess: pad all mouse vectors
     $maxWeight = max($weights);
     foreach ($weights as $i => $w) {
         $items = count($coordsX[$i]);
         $diff = $maxWeight - $items;
         if ($diff > 0) {