Compare commits
4 Commits
20a23e9957
...
68cb62a3fb
| Author | SHA1 | Date | |
|---|---|---|---|
| 68cb62a3fb | |||
| 56deda45fe | |||
| 43ad3c4193 | |||
| 00cf52ead7 |
@@ -180,9 +180,9 @@ class Media extends PhpObject {
|
|||||||
{
|
{
|
||||||
$sMediaPath = self::getMediaPath($sMediaName);
|
$sMediaPath = self::getMediaPath($sMediaName);
|
||||||
$sThumbPath = self::getMediaPath($sMediaName, 'thumbnail');
|
$sThumbPath = self::getMediaPath($sMediaName, 'thumbnail');
|
||||||
$sType = self::getMediaType($sMediaName);
|
|
||||||
|
|
||||||
if(!file_exists($sThumbPath)) {
|
if(!file_exists($sThumbPath)) {
|
||||||
|
$sType = self::getMediaType($sMediaName);
|
||||||
switch($sType) {
|
switch($sType) {
|
||||||
case 'image':
|
case 'image':
|
||||||
$asThumbInfo = ToolBox::createThumbnail($sMediaPath, self::THUMB_MAX_WIDTH, 0, $sThumbPath);
|
$asThumbInfo = ToolBox::createThumbnail($sMediaPath, self::THUMB_MAX_WIDTH, 0, $sThumbPath);
|
||||||
@@ -192,10 +192,10 @@ class Media extends PhpObject {
|
|||||||
$sTempPath = self::getMediaPath(uniqid('temp_').'.png');
|
$sTempPath = self::getMediaPath(uniqid('temp_').'.png');
|
||||||
$asResult = array();
|
$asResult = array();
|
||||||
$sParams = implode(' ', array(
|
$sParams = implode(' ', array(
|
||||||
'-i "'.$sMediaPath.'"', //input file
|
'-i "'.$sMediaPath.'"', //input file
|
||||||
'-ss 00:00:01.000', //Image taken after x seconds
|
'-ss 00:00:01.000', //Image taken after x seconds
|
||||||
'-vframes 1', //number of video frames to output
|
'-vframes 1', //number of video frames to output
|
||||||
'"'.$sTempPath.'"', //output file
|
'"'.$sTempPath.'"', //output file
|
||||||
));
|
));
|
||||||
exec('ffmpeg '.$sParams, $asResult);
|
exec('ffmpeg '.$sParams, $asResult);
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ class Media extends PhpObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static function getMediaPath($sMediaName, $sFileType='media') {
|
private static function getMediaPath($sMediaName, $sFileType='media') {
|
||||||
if($sFileType=='thumbnail') return self::THUMB_FOLDER.$sMediaName.(self::getMediaType($sMediaName)=='video'?'.png':'');
|
if($sFileType=='thumbnail') return self::THUMB_FOLDER.$sMediaName.(strtolower(substr($sMediaName, -3))=='mov'?'.png':'');
|
||||||
else return self::MEDIA_FOLDER.$sMediaName;
|
else return self::MEDIA_FOLDER.$sMediaName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
inc/spot.php
12
inc/spot.php
@@ -33,7 +33,7 @@ class Spot extends Main
|
|||||||
*/
|
*/
|
||||||
private $oMedia;
|
private $oMedia;
|
||||||
|
|
||||||
public function __construct($oClassManagement, $sProcessPage)
|
public function __construct($oClassManagement, $sProcessPage, $sTimezone)
|
||||||
{
|
{
|
||||||
$asClasses = array(
|
$asClasses = array(
|
||||||
array('name'=>'feed', 'project'=>true),
|
array('name'=>'feed', 'project'=>true),
|
||||||
@@ -41,7 +41,7 @@ class Spot extends Main
|
|||||||
array('name'=>'media', 'project'=>true),
|
array('name'=>'media', 'project'=>true),
|
||||||
array('name'=>'converter', 'project'=>true)
|
array('name'=>'converter', 'project'=>true)
|
||||||
);
|
);
|
||||||
parent::__construct($oClassManagement, $sProcessPage, $asClasses);
|
parent::__construct($oClassManagement, $sProcessPage, $asClasses, true, $sTimezone);
|
||||||
|
|
||||||
$this->oClassManagement->incClass('translator');
|
$this->oClassManagement->incClass('translator');
|
||||||
$this->oLang = new Translator('', 'en');
|
$this->oLang = new Translator('', 'en');
|
||||||
@@ -123,9 +123,7 @@ class Spot extends Main
|
|||||||
),
|
),
|
||||||
'consts' => array(
|
'consts' => array(
|
||||||
'geo_server' => Settings::GEO_SERVER,
|
'geo_server' => Settings::GEO_SERVER,
|
||||||
'modes' => Project::MODES,
|
'modes' => Project::MODES )
|
||||||
'site_timezone' => Settings::TIMEZONE
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'index',
|
'index',
|
||||||
array(
|
array(
|
||||||
@@ -197,7 +195,7 @@ class Spot extends Main
|
|||||||
$asMessage['longitude'] = floatval($asMessage['longitude']);
|
$asMessage['longitude'] = floatval($asMessage['longitude']);
|
||||||
$asMessage['lat_dms'] = self::decToDms($asMessage['latitude'], 'lat');
|
$asMessage['lat_dms'] = self::decToDms($asMessage['latitude'], 'lat');
|
||||||
$asMessage['lon_dms'] = self::decToDms($asMessage['longitude'], 'lon');
|
$asMessage['lon_dms'] = self::decToDms($asMessage['longitude'], 'lon');
|
||||||
$asMessage['displayed_id'] = 'N°'.($iIndex + 1);
|
$asMessage['displayed_id'] = $iIndex + 1;
|
||||||
|
|
||||||
$this->addTimeStamp($asMessage, $asMessage['unix_time']);
|
$this->addTimeStamp($asMessage, $asMessage['unix_time']);
|
||||||
}
|
}
|
||||||
@@ -222,7 +220,7 @@ class Spot extends Main
|
|||||||
$sTimeRef = $asMedia[$sTimeRefField];
|
$sTimeRef = $asMedia[$sTimeRefField];
|
||||||
if($sTimeRef >= $this->oProject->getActivePeriod('from') && $sTimeRef <= $this->oProject->getActivePeriod('to')) {
|
if($sTimeRef >= $this->oProject->getActivePeriod('from') && $sTimeRef <= $this->oProject->getActivePeriod('to')) {
|
||||||
$asMedia['taken_on_formatted'] = $this->getTimeFormat(strtotime($asMedia['taken_on']));
|
$asMedia['taken_on_formatted'] = $this->getTimeFormat(strtotime($asMedia['taken_on']));
|
||||||
$asMedia['displayed_id'] = 'N°'.($iIndex + 1);
|
$asMedia['displayed_id'] = $iIndex + 1;
|
||||||
|
|
||||||
$this->addTimeStamp($asMedia, strtotime($sTimeRef));
|
$this->addTimeStamp($asMedia, strtotime($sTimeRef));
|
||||||
$asValidMedias[] = $asMedia;
|
$asValidMedias[] = $asMedia;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ ToolBox::fixGlobalVars(isset($argv)?$argv:array());
|
|||||||
|
|
||||||
//Available variables
|
//Available variables
|
||||||
$sAction = isset($_REQUEST['a'])?$_REQUEST['a']:'';
|
$sAction = isset($_REQUEST['a'])?$_REQUEST['a']:'';
|
||||||
|
$sTimezone = isset($_REQUEST['t'])?$_REQUEST['t']:'';
|
||||||
$sName = isset($_GET['name'])?$_GET['name']:'';
|
$sName = isset($_GET['name'])?$_GET['name']:'';
|
||||||
$sContent = isset($_GET['content'])?$_GET['content']:'';
|
$sContent = isset($_GET['content'])?$_GET['content']:'';
|
||||||
$iChunk = isset($_GET['chunk'])?$_GET['chunk']:0;
|
$iChunk = isset($_GET['chunk'])?$_GET['chunk']:0;
|
||||||
@@ -21,7 +22,7 @@ $sField = isset($_REQUEST['field'])?$_REQUEST['field']:'';
|
|||||||
$oValue = isset($_REQUEST['value'])?$_REQUEST['value']:'';
|
$oValue = isset($_REQUEST['value'])?$_REQUEST['value']:'';
|
||||||
|
|
||||||
//Initiate class
|
//Initiate class
|
||||||
$oSpot = new Spot($oClassManagement, __FILE__);
|
$oSpot = new Spot($oClassManagement, __FILE__, $sTimezone);
|
||||||
$oSpot->setProjectId($iProjectId);
|
$oSpot->setProjectId($iProjectId);
|
||||||
|
|
||||||
$sResult = '';
|
$sResult = '';
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ post_message = Message
|
|||||||
post_name = Name
|
post_name = Name
|
||||||
post_new_message = New message
|
post_new_message = New message
|
||||||
and = and
|
and = and
|
||||||
|
counter = #$0
|
||||||
|
|
||||||
map_satellite = Satellite
|
map_satellite = Satellite
|
||||||
map_otm = Open Topo Map
|
map_otm = Open Topo Map
|
||||||
@@ -34,7 +35,7 @@ click_watch = Click to watch video
|
|||||||
click_zoom = Click to zoom
|
click_zoom = Click to zoom
|
||||||
media_count = Media $0 / $1
|
media_count = Media $0 / $1
|
||||||
|
|
||||||
city_time = $0 time
|
city_time = $0 Time
|
||||||
|
|
||||||
project = Project
|
project = Project
|
||||||
mode = Mode
|
mode = Mode
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ post_message = Message
|
|||||||
post_name = Nom
|
post_name = Nom
|
||||||
post_new_message = Nouveau message
|
post_new_message = Nouveau message
|
||||||
and = et
|
and = et
|
||||||
|
counter = N° $0
|
||||||
|
|
||||||
map_satellite = Satellite
|
map_satellite = Satellite
|
||||||
map_otm = Open Topo Map
|
map_otm = Open Topo Map
|
||||||
|
|||||||
@@ -127,9 +127,9 @@ function initProject(sProjectCodeName){
|
|||||||
self.setPageTitle(oSpot.vars(['project', 'name']));
|
self.setPageTitle(oSpot.vars(['project', 'name']));
|
||||||
|
|
||||||
//Timezone difference notice
|
//Timezone difference notice
|
||||||
var bSameTZ = (oSpot.consts.site_timezone == oSpot.vars(['project', 'timezone']));
|
var bSameTime = ((new Date()).toLocaleString([], {timeZone: oSpot.consts.timezone}) == (new Date()).toLocaleString([], {timeZone: oSpot.vars(['project', 'timezone'])}));
|
||||||
self.tmp('site_tz_notice', bSameTZ?'':' ('+getTimeZoneDesc(oSpot.consts.site_timezone)+')');
|
self.tmp('site_tz_notice', bSameTime?'':' ('+getTimeZoneDesc(oSpot.consts.timezone)+')');
|
||||||
self.tmp('proj_tz_notice', bSameTZ?'':' ('+getTimeZoneDesc(self.vars(['project', 'timezone']))+')');
|
self.tmp('proj_tz_notice', bSameTime?'':' ('+getTimeZoneDesc(self.vars(['project', 'timezone']))+')');
|
||||||
|
|
||||||
$.when(
|
$.when(
|
||||||
//Markers: Spot Messages & Medias
|
//Markers: Spot Messages & Medias
|
||||||
@@ -376,7 +376,7 @@ function initSpotMessages(aoMessages, aoTracks) {
|
|||||||
$Tooltip = $('<div>', {'class':'info-window'})
|
$Tooltip = $('<div>', {'class':'info-window'})
|
||||||
.append($('<h1>')
|
.append($('<h1>')
|
||||||
.addIcon('fa-message fa-fw fa-lg')
|
.addIcon('fa-message fa-fw fa-lg')
|
||||||
.append('Message '+oMsg.type+' '+oMsg.displayed_id))
|
.append('Message '+oMsg.type+' '+oSpot.lang('counter', oMsg.displayed_id)))
|
||||||
.append($('<p>', {'class':'time'})
|
.append($('<p>', {'class':'time'})
|
||||||
.addIcon('fa-time fa-fw fa-lg')
|
.addIcon('fa-time fa-fw fa-lg')
|
||||||
.append(oMsg.formatted_time+(self.vars(['project', 'mode'])==self.consts.modes.blog?' ('+oMsg.relative_time+')':'')+self.tmp('site_tz_notice')))
|
.append(oMsg.formatted_time+(self.vars(['project', 'mode'])==self.consts.modes.blog?' ('+oMsg.relative_time+')':'')+self.tmp('site_tz_notice')))
|
||||||
@@ -541,7 +541,7 @@ function getPost(asPost) {
|
|||||||
.append($('<span>', {'class':'time'}).hoverSwap(sRelTime, sAbsTime+self.tmp('site_tz_notice'))))
|
.append($('<span>', {'class':'time'}).hoverSwap(sRelTime, sAbsTime+self.tmp('site_tz_notice'))))
|
||||||
.append($('<div>', {'class':'body'}).append($Body));
|
.append($('<div>', {'class':'body'}).append($Body));
|
||||||
|
|
||||||
if(asPost.displayed_id) $Post.find('.index').append(' '+asPost.displayed_id);
|
if(asPost.displayed_id) $Post.find('.index').append(' '+oSpot.lang('counter', asPost.displayed_id));
|
||||||
|
|
||||||
return $Post;
|
return $Post;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
* ffprobe (ffmpeg)
|
* ffprobe (ffmpeg)
|
||||||
## To Do List
|
## To Do List
|
||||||
* import/export
|
* import/export
|
||||||
* Convert all time to browser timezone
|
|
||||||
* Reset zoom on image closing (lightbox)
|
* Reset zoom on image closing (lightbox)
|
||||||
* Optimize mobile image size (lightbox)
|
* Optimize mobile image size (lightbox)
|
||||||
* Link pic & post
|
* Link pic & post
|
||||||
@@ -5,7 +5,7 @@ function Spot(asGlobals)
|
|||||||
this.consts.hash_sep = '-';
|
this.consts.hash_sep = '-';
|
||||||
this.consts.title = 'Spotty';
|
this.consts.title = 'Spotty';
|
||||||
this.consts.default_page = 'project';
|
this.consts.default_page = 'project';
|
||||||
//this.consts.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
this.consts.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||||
|
|
||||||
/* Initialization */
|
/* Initialization */
|
||||||
|
|
||||||
@@ -69,7 +69,8 @@ function Spot(asGlobals)
|
|||||||
bProcessIcon = bProcessIcon || false;
|
bProcessIcon = bProcessIcon || false;
|
||||||
//if(bProcessIcon) self.addBufferIcon();
|
//if(bProcessIcon) self.addBufferIcon();
|
||||||
|
|
||||||
oVars['a'] = sAction;
|
oVars['a'] = sAction;
|
||||||
|
oVars['t'] = self.consts.timezone;
|
||||||
return $.ajax(
|
return $.ajax(
|
||||||
{
|
{
|
||||||
url: self.consts.process_page,
|
url: self.consts.process_page,
|
||||||
@@ -96,7 +97,7 @@ function Spot(asGlobals)
|
|||||||
|
|
||||||
this.lang = function(sKey, asParams) {
|
this.lang = function(sKey, asParams) {
|
||||||
asParams = asParams || [];
|
asParams = asParams || [];
|
||||||
if($.type(asParams) == 'string') asParams = [asParams];
|
if($.type(asParams) != 'array') asParams = [asParams];
|
||||||
var sLang = '';
|
var sLang = '';
|
||||||
|
|
||||||
if(sKey in self.consts.lang) {
|
if(sKey in self.consts.lang) {
|
||||||
|
|||||||
Reference in New Issue
Block a user