Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 8 лет назад
Родитель
Сommit
93f605bd8c

+ 2 - 2
modules/boonex/forum/template/form_ghost_template.html

@@ -1,6 +1,6 @@
 <bx_include_base:../modules/base/text/template/form_ghost_template.html />
 <script>
 var aType = '{file_type}'.split('/');
-if(!aType || aType[0] != 'image' || !$.inArray(aType[1], ['gif', 'jpeg', 'png']))
+if(!aType || aType[0] != 'image' || -1 === $.inArray(aType[1], ['gif', 'jpeg', 'png']))
 	$('#bx-uploader-file-{storage_object}-{file_id} .bx-base-general-use-as-thumb').remove();
-</script>
+</script>

+ 27 - 0
modules/boonex/mapjoined/classes/BxMapJoinedAlertsResponse.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    MapJoined Display last joined users on map
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxMapJoinedAlertsResponse extends BxDolAlertsResponse
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+    
+    public function response($oAlert)
+    {
+        if ($oAlert->sUnit == 'account' && $oAlert->sAction == 'added'){
+            $oModule = BxDolModule::getInstance('bx_mapjoined');
+            $oModule->addIpInfoToDb($oAlert->iObject, $_SERVER['REMOTE_ADDR']);
+        }
+    }
+}
+/** @} */

+ 41 - 0
modules/boonex/mapjoined/classes/BxMapJoinedConfig.php

@@ -0,0 +1,41 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    MapJoined Display last joined users on map
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+bx_import('BxDolModuleConfig');
+
+class BxMapJoinedConfig extends BxBaseModGeneralConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+        $this->CNF = array (
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'accounts',
+            
+             // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_ACCOUNT_ID' => 'account_id',
+            'FIELD_JOINED' => 'joined',
+            'FIELD_IP' => 'ip',
+            'FIELD_LNG' => 'lng',
+            'FIELD_LAT' => 'lat'
+        );
+        
+        $this->_aJsClasses = array(
+            'map' => 'BxMapJoined'
+        );
+        $this->_aJsObjects = array(
+            'map' => 'oMapJoined'
+        );
+    }
+}
+
+/** @} */

+ 49 - 0
modules/boonex/mapjoined/classes/BxMapJoinedDb.php

@@ -0,0 +1,49 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    MapJoined Display last joined users on map
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+bx_import('BxDolModuleDb');
+
+class BxMapJoinedDb extends BxBaseModGeneralDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+    
+    public function getLngLatData($iLastId)
+    {
+        $CNF = &$this->_oConfig->CNF;
+        $sIntervalInHour = getParam('bx_mapjoined_initial_timeframe_users_shown_in_hours');
+        $sSql = "";
+        if ($iLastId == 0) {
+            $sSql = $CNF['FIELD_JOINED'] . " > date_sub(now(), INTERVAL " . $sIntervalInHour . " hour) ";
+        }
+        else{
+            $sSql = $CNF['FIELD_ID'] . " > " . $iLastId;
+        }
+        
+        return $this->getAll("SELECT " . $CNF['FIELD_LNG'] . ", " . $CNF['FIELD_LAT'] . ", " . $CNF['FIELD_ID'] . " FROM " . $CNF['TABLE_ENTRIES'] . " WHERE " . $sSql);
+    }
+    
+    public function addIpInfo($iAccountId, $sIp, $sLng, $sLat)
+    {
+        $CNF = &$this->_oConfig->CNF;
+        $aBindings = array(
+            'account_id' => $iAccountId,
+            'ip' => $sIp,
+            'lng' => $sLng,
+            'lat' => $sLat
+        );
+        $this->query("INSERT INTO " . $CNF['TABLE_ENTRIES'] . " (" . $CNF['FIELD_ACCOUNT_ID'] . ", " . $CNF['FIELD_IP'] . ", " . $CNF['FIELD_LNG'] . ", " . $CNF['FIELD_LAT'] . ") values (:account_id, :ip, :lng, :lat)", $aBindings);
+    }
+}
+
+/** @} */

+ 70 - 0
modules/boonex/mapjoined/classes/BxMapJoinedModule.php

@@ -0,0 +1,70 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    MapJoined Display last joined users on map
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+define('BX_MAP_JOINED_IP_2_LOCATION_URL', 'http://freegeoip.net/json/');
+
+class BxMapJoinedModule extends BxDolModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+    
+    public function addIpInfoToDb($iAccountId, $sIp)
+    {
+        $sLngLatInfo = $this->callApi($sIp);
+        if ($sLngLatInfo != ''){
+            $oLngLatInfo = json_decode($sLngLatInfo);
+            if (isset($oLngLatInfo->longitude) && isset($oLngLatInfo->latitude)){
+                $sLng = $oLngLatInfo->longitude;
+                $sLat = $oLngLatInfo->latitude;
+                if ($sLng != "0" && $sLat != "0")
+                    $this->_oDb->addIpInfo($iAccountId, $sIp, $sLng, $sLat);
+            }
+        }
+    }
+    
+    /**
+     * @page service Service Calls
+     * @section bx_mapjoined MapJoined 
+     * @subsection bx_mapjoined-other Other
+     * @subsubsection bx_mapjoined-get_map
+     * 
+     * @code bx_srv('bx_mapjoined', 'get_map', [...]); @endcode
+     * 
+     * Get html for map
+     * 
+     * @return string - html for map .
+     * 
+     * @see BxMapJoinedModule::serviceGetMap
+     */
+    /** 
+     * @ref bx_mapjoined-get_map "get_map"
+     */
+    public function serviceGetMap()
+    {
+        return $this->_oTemplate->getMap();
+    }
+    
+    public function actionGetMapPoints($Id = 0)
+    {
+        $aData = $this->_oDb->getLngLatData($Id);
+        header('Content-Type: application/json');
+        echo json_encode($aData);
+    }
+    
+    private function callApi($sIp)
+    {
+        $sApiUrl = BX_MAP_JOINED_IP_2_LOCATION_URL . $sIp;
+        return bx_file_get_contents($sApiUrl);
+    }
+}
+
+/** @} */

+ 43 - 0
modules/boonex/mapjoined/classes/BxMapJoinedTemplate.php

@@ -0,0 +1,43 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    MapJoined Display last joined users on map
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+bx_import ('BxDolModuleTemplate');
+
+class BxMapJoinedTemplate extends BxBaseModGeneralTemplate
+{
+    function __construct(&$oConfig, &$oDb)
+    {
+        parent::__construct($oConfig, $oDb);
+    }
+    
+    function getMap()
+    {
+        $this->addJs(array('https://openlayers.org/en/v4.6.4/build/ol.js', 'map.js'));
+        $this->addCss('https://openlayers.org/en/v4.6.4/css/ol.css');
+        return $this->getJsCode('map') . $this->parseHtmlByName('map.html', array());
+    }
+    
+    public function getJsCode($sType, $aParams = array(), $bWrap = true)
+    {
+        $aParams = array_merge(array(
+            'sPathToJsonData' => $this->_oConfig->getHomeUrl() . 'js/continents.geojson',
+            'sPathToDotImage' => $this->getImageUrl('dot.png'),
+            'iIntervalCheckNewInSeconds' => getParam('bx_mapjoined_interval_refresh_new_users_in_seconds'),
+            'fCenterMapLonCoordinate' => getParam('bx_mapjoined_default_center_lat_coordinate'),
+            'fCenterMapLatCoordinate' => getParam('bx_mapjoined_default_center_lon_coordinate'),
+            'fMapZoom' => getParam('bx_mapjoined_default_zoom')
+        ), $aParams);
+        
+        return parent::getJsCode($sType, $aParams, $bWrap);
+    }
+}
+
+/** @} */

+ 77 - 0
modules/boonex/mapjoined/install/config.php

@@ -0,0 +1,77 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    MapJoined Display last joined users on map
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_mapjoined',
+    'title' => 'Map Joined',
+    'note' => 'Map Joined module.',
+    'version' => '1.0.0.DEV',
+    'vendor' => 'BoonEx',
+    'help_url' => 'http://feed.una.io/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/mapjoined/',
+    'home_uri' => 'mapjoined',
+
+    'db_prefix' => 'bx_mapjoined_',
+    'class_prefix' => 'BxMapJoined',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'MapJoined',
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable_success' => array(
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable_failed' => array (
+        'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+);
+
+/** @} */

+ 20 - 0
modules/boonex/mapjoined/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    MapJoined Display last joined users on map
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxMapJoinedInstaller extends BxBaseModTextInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 13 - 0
modules/boonex/mapjoined/install/langs/en.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_bx_mapjoined"><![CDATA[Display last joined users on map]]></string>
+  <string name="_bx_mapjoined_adm_stg_cpt_type"><![CDATA[Display last joined users on map]]></string>
+  <string name="_bx_mapjoined_adm_stg_cpt_category_general"><![CDATA[Display last joined users on map]]></string>
+  <string name="_bx_mapjoined_initial_timeframe_users_shown_in_hours"><![CDATA[Initial time frame users are shown in hours]]></string>
+  <string name="_bx_mapjoined_interval_refresh_new_users_in_seconds"><![CDATA[Interval for updating data for new users in seconds]]></string>
+  <string name="_bx_mapjoined_default_center_lat_coordinate"><![CDATA[Default map's center lattitude coordinate]]></string>
+  <string name="_bx_mapjoined_default_center_lon_coordinate"><![CDATA[Default map's center longitude coordinate]]></string>
+  <string name="_bx_mapjoined_default_zoom"><![CDATA[Default map zoom]]></string>
+  <string name="_bx_mapjoined_page_block_title_sys_map_with_joined_users"><![CDATA[Map with last joined users]]></string>
+  <string name="_bx_mapjoined_page_block_title_map_with_joined_users"><![CDATA[Map with last joined users]]></string>
+</resources>

+ 18 - 0
modules/boonex/mapjoined/install/sql/disable.sql

@@ -0,0 +1,18 @@
+SET @sName = 'bx_mapjoined';
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = @sName LIMIT 1);
+SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
+DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
+DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
+DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
+
+-- PAGES
+DELETE FROM `sys_pages_blocks` WHERE `module` = @sName;
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = @sName LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
+
+

+ 34 - 0
modules/boonex/mapjoined/install/sql/enable.sql

@@ -0,0 +1,34 @@
+SET @sName = 'bx_mapjoined';
+
+-- SETTINGS
+SET @iTypeOrder = (SELECT IFNULL(MAX(`order`), 0) + 1 FROM `sys_options_types` WHERE `group` = 'modules');
+
+INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) 
+VALUES('modules', @sName, '_bx_mapjoined_adm_stg_cpt_type', 'bx_mapjoined@modules/boonex/mapjoined/|std-icon.svg', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
+
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `hidden`, `order`) VALUES(@iTypeId,  'bx_mapjoined_general', '_bx_mapjoined_adm_stg_cpt_category_general', 0, 1);
+SET @iCategoryId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_params`, `check_error`, `order`) VALUES
+(@iCategoryId, 'bx_mapjoined_initial_timeframe_users_shown_in_hours', '_bx_mapjoined_initial_timeframe_users_shown_in_hours', '24', 'digit', '', '', '', '', 1),
+(@iCategoryId, 'bx_mapjoined_interval_refresh_new_users_in_seconds', '_bx_mapjoined_interval_refresh_new_users_in_seconds', '30', 'digit', '', '', '', '', 2),
+(@iCategoryId, 'bx_mapjoined_default_center_lat_coordinate', '_bx_mapjoined_default_center_lat_coordinate', '44.60240', 'digit', '', '', '', '', 3),
+(@iCategoryId, 'bx_mapjoined_default_center_lon_coordinate', '_bx_mapjoined_default_center_lon_coordinate', '2.896372', 'digit', '', '', '', '', 4),
+(@iCategoryId, 'bx_mapjoined_default_zoom', '_bx_mapjoined_default_zoom', '2', 'digit', '', '', '', '', 5);
+
+-- PAGE: service blocks
+
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = '' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system` , `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('', 0, @sName, '_bx_mapjoined_page_block_title_sys_map_with_joined_users', '_bx_mapjoined_page_block_title_map_with_joined_users', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:12:"bx_mapjoined";s:6:"method";s:7:"get_map";}', 0, 1, IFNULL(@iBlockOrder, 0) + 1);
+
+-- ALERTS
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+(@sName, 'BxMapJoinedAlertsResponse', 'modules/boonex/mapjoined/classes/BxMapJoinedAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('account', 'added', @iHandler);
+

+ 29 - 0
modules/boonex/mapjoined/install/sql/install.sql

@@ -0,0 +1,29 @@
+SET @sName = 'bx_mapjoined';
+
+-- TABLE: data
+CREATE TABLE `bx_mapjoined_accounts` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `account_id` int(11) NOT NULL,
+  `joined` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  `ip` varchar(16) DEFAULT NULL,
+  `lng` float DEFAULT NULL,
+  `lat` float DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  INDEX `mapjoined_accounts_join` (`joined`)
+
+);
+
+-- STUDIO: page & widget
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, @sName, '_bx_mapjoined', '_bx_mapjoined', 'bx_mapjoined@modules/boonex/mapjoined/|std-icon.svg');
+
+SET @iPageId = LAST_INSERT_ID();
+
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`, `bookmark`) 
+VALUES(@iPageId, @sName, '{url_studio}module.php?name=bx_mapjoined', '', 'bx_mapjoined@modules/boonex/mapjoined/|std-icon.svg', '_bx_mapjoined', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}', 0);
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT IFNULL(MAX(`order`), 0) + 1 FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), @iParentPageOrder);

+ 11 - 0
modules/boonex/mapjoined/install/sql/uninstall.sql

@@ -0,0 +1,11 @@
+SET @sName = 'bx_mapjoined';;
+
+-- TABLES
+DROP TABLE IF EXISTS `bx_mapjoined_accounts`;
+
+-- STUDIO WIDGET
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = @sName;
+
+

Разница между файлами не показана из-за своего большого размера
+ 4 - 0
modules/boonex/mapjoined/js/continents.geojson


+ 128 - 0
modules/boonex/mapjoined/js/map.js

@@ -0,0 +1,128 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    MapJoined Display last joined users on map
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxMapJoined(oOptions) {
+    this._iMapPointsLastId = 0;
+    this._oMap = null;
+    this._sActionsUri = oOptions.sActionUri;
+    this._sPathToJsonData = oOptions.sPathToJsonData == undefined ? '' : oOptions.sPathToJsonData;
+    this._sPathToDotImage = oOptions.sPathToDotImage == undefined ? {} : oOptions.sPathToDotImage;
+    this._iIntervalCheckNewInSeconds = oOptions.iIntervalCheckNewInSeconds == undefined ? 5 : new Number(oOptions.iIntervalCheckNewInSeconds);
+    this._fCenterMapLonCoordinate = oOptions.fCenterMapLonCoordinate == undefined ? 2.896372 : new Number(oOptions.fCenterMapLonCoordinate);
+    this._fCenterMapLatCoordinate = oOptions.fCenterMapLatCoordinate == undefined ? 44.60240 : new Number(oOptions.fCenterMapLatCoordinate);
+    this._fMapZoom = oOptions.fMapZoom == undefined ? 2 : new Number(oOptions.fMapZoom);
+    var $this = this;
+    $(document).ready(function () {
+        $this.init();
+    });
+}
+
+BxMapJoined.prototype.init = function () {
+    var $this = this;
+
+    var oCanvas = document.createElement('canvas');
+    var oContext = oCanvas.getContext('2d');
+    var iPixelRatio = ol.has.DEVICE_PIXEL_RATIO;
+    var oPattern = (function () {
+        oCanvas.width = oCanvas.height = 10 * iPixelRatio;
+        oContext.fillStyle = 'white';
+        oContext.fillRect(0, 0, oCanvas.width, oCanvas.height);
+        oContext.fillStyle = 'rgb(214, 227, 241)';
+        oContext.beginPath();
+        oContext.arc(5 * iPixelRatio, 5 * iPixelRatio, 3 * iPixelRatio, 0, 2 * Math.PI);
+        oContext.fill();
+        return oContext.createPattern(oCanvas, 'repeat');
+    }());
+
+    var oFill = new ol.style.Fill();
+    var oStyle = new ol.style.Style({
+        fill: oFill,
+        stroke: new ol.style.Stroke({
+            color: '#fff',
+            width: 1
+        })
+    });
+
+    var getStackedStyle = function () {
+        oFill.setColor(oPattern);
+        return oStyle;
+    };
+
+    var oBaseVectorLayer = new ol.layer.Vector({
+        source: new ol.source.Vector({
+            url: $this._sPathToJsonData,
+            format: new ol.format.GeoJSON()
+        }),
+        style: getStackedStyle
+    });
+
+    $this._oMap = new ol.Map({
+        layers: [oBaseVectorLayer],
+        target: document.getElementById('BxMapJoinedContainer'),
+        view: new ol.View({
+            center: ol.proj.fromLonLat([$this._fCenterMapLonCoordinate, $this._fCenterMapLatCoordinate]),
+            zoom: $this._fMapZoom
+        }),
+        controls: [],
+        interactions: ol.interaction.defaults({
+            dragRotate: false,
+            dragPan: false,
+            pinchRotate: false,
+            pinchZoom: false,
+            doubleClickZoom: false,
+            dragAndDrop: false,
+            keyboardPan: false,
+            keyboardZoom: false,
+            mouseWheelZoom: false,
+            pointer: false,
+            select: false
+        })
+    });
+
+    $this.addPoints();
+}
+
+BxMapJoined.prototype.addPoints = function () {
+
+    var $this = this;
+    var aPoints = new Array();
+    $.getJSON($this._sActionsUri + 'GetMapPoints/' + this._iMapPointsLastId + '/', function (aMapPoints) {
+        $.each(aMapPoints, function (key, value) {
+            if (this._iMapPointsLastId < new Number(value.id))
+                this._iMapPointsLastId = new Number(value.id);
+            var oPoint = new ol.Feature({
+                geometry: new ol.geom.Point(ol.proj.fromLonLat([new Number(value.lng), new Number(value.lat)]))
+            });
+            oPoint.setStyle(new ol.style.Style({
+                image: new ol.style.Icon(({
+                    crossOrigin: 'anonymous',
+                    src: $this._sPathToDotImage
+                }))
+            }));
+            aPoints.push(oPoint);
+        });
+
+        if (aPoints.length > 0) {
+            var oPointSource = new ol.source.Vector({
+                features: aPoints
+            });
+
+            var oPointsVectorLayer = new ol.layer.Vector({
+                source: oPointSource
+            });
+            $this._oMap.addLayer(oPointsVectorLayer);
+        }
+        setTimeout(function () {
+            $this.addPoints();
+        },  $this._iIntervalCheckNewInSeconds*1000);
+    });
+}
+
+

+ 18 - 0
modules/boonex/mapjoined/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+* Copyright (c) UNA, Inc - https://una.io
+* MIT License - https://opensource.org/licenses/MIT
+*
+* @defgroup    MapJoined Display last joined users on map
+* @ingroup     UnaModules
+*
+* @{
+*/
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+check_logged();
+
+BxBaseModTextRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

BIN
modules/boonex/mapjoined/template/images/dot.png


+ 49 - 0
modules/boonex/mapjoined/template/images/icons/std-icon.svg

@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<svg width="600" height="600" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <style type="text/css">.st0{fill:#F6A623;}
+	.st1{fill:url(#path-copy_1_);}
+	.st2{fill:#FFFFFF;}</style>
+ <defs>
+  <symbol id="svg_8" viewBox="0 0 2048 1792" height="1792" width="2048" xmlns="http://www.w3.org/2000/svg">
+   <path fill="#fff" d="m2020,11q28,20 28,53l0,1408q0,20 -11,36t-29,23l-640,256q-24,11 -48,0l-616,-246l-616,246q-10,5 -24,5q-19,0 -36,-11q-28,-20 -28,-53l0,-1408q0,-20 11,-36t29,-23l640,-256q24,-11 48,0l616,246l616,-246q32,-13 60,6zm-1284,135l0,1270l576,230l0,-1270l-576,-230zm-608,217l0,1270l544,-217l0,-1270l-544,217zm1792,1066l0,-1270l-544,217l0,1270l544,-217z"/>
+  </symbol>
+  <symbol id="svg_11" viewBox="0 0 1792 1792" height="1792" width="1792" xmlns="http://www.w3.org/2000/svg">
+   <path fill="#fff" d="m1152,640q0,-106 -75,-181t-181,-75t-181,75t-75,181t75,181t181,75t181,-75t75,-181zm256,0q0,109 -33,179l-364,774q-16,33 -47.5,52t-67.5,19t-67.5,-19t-46.5,-52l-365,-774q-33,-70 -33,-179q0,-212 150,-362t362,-150t362,150t150,362z"/>
+  </symbol>
+  <symbol id="svg_14" viewBox="0 0 1792 1792" height="1792" width="1792" xmlns="http://www.w3.org/2000/svg">
+   <path fill="#fff" d="m1536,1399q0,109 -62.5,187t-150.5,78l-854,0q-88,0 -150.5,-78t-62.5,-187q0,-85 8.5,-160.5t31.5,-152t58.5,-131t94,-89t134.5,-34.5q131,128 313,128t313,-128q76,0 134.5,34.5t94,89t58.5,131t31.5,152t8.5,160.5zm-256,-887q0,159 -112.5,271.5t-271.5,112.5t-271.5,-112.5t-112.5,-271.5t112.5,-271.5t271.5,-112.5t271.5,112.5t112.5,271.5z"/>
+  </symbol>
+ </defs>
+ <title>Group 2 Copy 16</title>
+ <desc>Created with Sketch.</desc>
+ <g class="layer">
+  <title>Layer 1</title>
+  <g id="Page-1">
+   <g id="Group-2-Copy-16">
+    <path d="m552.3,552.3c47.7,-47.8 47.7,-120.8 47.7,-252.3s0,-204.5 -47.7,-252.3c-47.8,-47.7 -120.8,-47.7 -252.3,-47.7s-204.5,0 -252.3,47.7c-47.7,47.8 -47.7,120.8 -47.7,252.3s0,204.5 47.7,252.3c47.8,47.7 120.8,47.7 252.3,47.7s204.5,0 252.3,-47.7l0,0z" class="st0" id="path"/>
+    <linearGradient gradientTransform="matrix(600 0 0 -600 -141364 218636)" y2="363.3933" x2="236.1067" y1="364.3933" x1="236.1067" gradientUnits="userSpaceOnUse" id="path-copy_1_">
+     <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="0"/>
+     <stop stop-color="#000000" stop-opacity="0.1389" offset="1"/>
+    </linearGradient>
+    <path d="m552.3,552.3c47.7,-47.8 47.7,-120.8 47.7,-252.3s0,-204.5 -47.7,-252.3c-47.8,-47.7 -120.8,-47.7 -252.3,-47.7s-204.5,0 -252.3,47.7c-47.7,47.8 -47.7,120.8 -47.7,252.3s0,204.5 47.7,252.3c47.8,47.7 120.8,47.7 252.3,47.7s204.5,0 252.3,-47.7l0,0z" class="st1" id="path-copy"/>
+   </g>
+  </g>
+  <g id="svg_6"/>
+  <use x="1174.367119" y="1421.589234" transform="matrix(0.8345929721059189,0,0,0.6335252336591156,-930.6995213294922,-748.873309548935) " xlink:href="#svg_8" id="svg_9"/>
+  <g id="svg_10"/>
+  <g id="svg_13"/>
+  <g id="svg_16"/>
+  <g id="svg_17">
+   <use x="1241.38131" y="2006.81034" transform="matrix(0.34166606083370965,0,0,0.3088992059574203,-374.6555332947755,-545.5897757166531) " xlink:href="#svg_11" id="svg_12"/>
+   <use x="1517.598684" y="577.956788" transform="matrix(0.22583108712153077,0,0,0.25440903936166315,-258.48814154160937,-114.87800003799566) " xlink:href="#svg_14" id="svg_15"/>
+  </g>
+  <g id="svg_18">
+   <use id="svg_19" x="1662.897813" y="2349.193798" transform="matrix(0.34166606083370965,0,0,0.3088992059574203,-374.6555332947755,-545.5897757166531) " xlink:href="#svg_11"/>
+   <use id="svg_20" x="2155.322591" y="993.673063" transform="matrix(0.22583108712153077,0,0,0.25440903936166315,-258.48814154160937,-114.87800003799566) " xlink:href="#svg_14"/>
+  </g>
+  <g id="svg_21">
+   <use id="svg_22" x="2119.483989" y="2640.550973" transform="matrix(0.34166606083370965,0,0,0.3088992059574203,-374.6555332947755,-545.5897757166531) " xlink:href="#svg_11"/>
+   <use id="svg_23" x="2846.10437" y="1347.434078" transform="matrix(0.22583108712153077,0,0,0.25440903936166315,-258.48814154160937,-114.87800003799566) " xlink:href="#svg_14"/>
+  </g>
+ </g>
+</svg>

+ 1 - 0
modules/boonex/mapjoined/template/map.html

@@ -0,0 +1 @@
+<div id="BxMapJoinedContainer"></div>

+ 2 - 2
template/scripts/BxBaseAccountForms.php

@@ -97,7 +97,7 @@ class BxBaseAccountForms extends BxDolProfileForms
         else if(!empty($sDefaultProfileType)) 
             $sProfileModule = $sDefaultProfileType;
 
-        if (getParam('sys_account_auto_profile_creation')) {
+        if (getParam('sys_account_auto_profile_creation') && !empty($sProfileModule)) {
             $oAccount = BxDolAccount::getInstance($iAccountId);
             $aProfileInfo = BxDolService::call($sProfileModule, 'prepare_fields', array(array(
                 'name' => $oAccount->getDisplayName(),
@@ -110,7 +110,7 @@ class BxBaseAccountForms extends BxDolProfileForms
             BxDolService::call($sProfileModule, 'redirect_after_add', array($a['content']));
         }
         else {
-            $sRedirectUrl = BxDolService::call($sProfileModule, 'profile_create_url', array(false));
+            $sRedirectUrl = !empty($sProfileModule) ? BxDolService::call($sProfileModule, 'profile_create_url', array(false)) : '';
         
             $this->_redirectAndExit(!empty($sRedirectUrl) ? $sRedirectUrl : getParam('sys_redirect_after_account_added'), true, array(
                 'account_id' => $iAccountId,

Некоторые файлы не были показаны из-за большого количества измененных файлов