function show() { if ($this->name == "") { die("No name provided. <a href=/>Return to Home</a>"); } $data = MySQLAdmin::read("select * from timelapse where name='" . $this->name . "' limit 1", 1); if ($data == false) { return false; } $this->data = $data; $str = ""; /* public members */ //$selectedtype = @$_GET['type']; $this->settings['frames'] = 0; $this->settings['speed'] = 0; $this->settings['date'] = 0; if (strlen($_REQUEST['permalinks'][2])) { $p = explode(",", $_REQUEST['permalinks'][2]); foreach ($p as $params) { $row = explode(":", $params); switch (strtolower($row[0])) { case "frames": $this->settings['frames'] = (int) $row[1]; break; case "speed": $this->settings['speed'] = (int) $row[1]; break; case "date": $this->settings['date'] = $row[1]; break; case "navi": $this->settings['navi'] = (int) $row[1]; break; case "play": $this->settings['play'] = $row[1]; break; case "x": $this->settings['x'] = (int) $row[1]; break; case "y": $this->settings['y'] = (int) $row[1]; break; case "w": $this->settings['w'] = (int) $row[1]; break; case "h": $this->settings['h'] = (int) $row[1]; break; } } } $this->range = $this->settings['frames'] ? $this->settings['frames'] : $this->defaultframes; $this->viewspeed = $this->settings['speed'] ? $this->settings['speed'] : $this->defaultspeed; $this->viewdate = $this->settings['date'] ? $this->settings['date'] : ''; $custompan = $this->settings['w'] && $this->settings['h']; /* private members */ $this->dirpath = "./data/{$this->name}/files/"; if (!is_dir($this->dirpath)) { die("No se encontraron registros para esta linea de tiempo."); } // $filez = Utils::dirList($this->dirpath); $files = $filez[1]; rsort($files); $this->filestotal = count($files); $this->startdate = $files[0][0]; $this->enddate = $files[$this->filestotal - 1][0]; $temp = array(); if ($this->range > count($files)) { $this->range = count($files); } if ($this->settings['date'] != "") { sort($files); $dt = ts2date($this->settings['date']); for ($i = 0; $i < count($files); $i++) { $fn = @explode(".", $files[$i][0]); $ts = $fn[0]; if ($ts) { $dtc = ts2date($ts); if ($dtc > $dt) { if ($this->range > count($temp)) { $temp[] = $files[$i]; } } } } rsort($temp); $this->settings['historic'] = true; } else { //rsort($files); for ($i = 0; $i < $this->range; $i++) { $temp[] = $files[$i]; } } $this->files = $temp; $imagesize = getimagesize($this->dirpath . '/' . $files[0][0]); $this->dw = $custompan ? $this->settings['w'] ? $this->settings['w'] : $this->dsize : $imagesize[0]; $this->dh = $custompan ? $this->settings['h'] ? $this->settings['h'] : $this->dsize : $imagesize[1]; if (is_numeric($this->settings['w']) && is_numeric($this->settings['h'])) { $resimage = array($this->settings['w'], $this->settings['h']); } else { $resimage = $imagesize; } if ($resimage) { $this->setSize($resimage[0], $resimage[1]); } else { $this->setSize(480, 340); } $this->imagesize = $imagesize; $str .= $this->printHeader(); if ($this->settings['navi'] == 1) { $str .= '<span class="legend"> <strong>w,h,x,y</strong> : <i>int (px)</i> <strong>frames</strong> : <i>int</i> <strong>date</strong> : <i>ymdHi (' . date('ymdHi') . ')</i> <strong>speed</strong> : <i>int (millisec)</i> <strong>navi</strong> : <i>bool</i> <strong>play</strong> : <i>bool</i> </span> <div class="panel-map-latest"><div class="panel-map-overlay"><div class="panel-map-rect"><div class="panel-map-legend"><span>' . $imagesize[0] . 'x' . $imagesize[1] . '</span></div></div></div></div> '; } if ($this->files) { $str .= $this->printFiles(); } $str .= ' </body> </html> '; return $str; }