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