AntonLV hace 13 años
padre
commit
29a140f169

+ 8 - 0
index.php

@@ -24,6 +24,14 @@ if (!file_exists("./inc/header.inc.php"))
     exit;
 }
 
+require_once('./inc/header.inc.php');
+require_once(BX_DIRECTORY_PATH_INC . "profiles.inc.php");
+
+if(!isLogged()) {
+	require_once("./splash.php");
+	exit;
+}
+
 $_GET['i'] = 'home';
 require_once("./page.php");
 

+ 10 - 1
modules/boonex/english/data/langs/system.xml

@@ -1502,7 +1502,16 @@ Please click "Continue" below to navigate to the home page of the site.]]></stri
 	<string name="_Dashboard"><![CDATA[Dashboard]]></string>
 	<string name="_Status Message"><![CDATA[Status Message]]></string>
 	<string name="_Set up your status"><![CDATA[Set up your status]]></string>
-	
+
+	<!-- Splash -->
+	<string name="_sys_splash_slogan"><![CDATA[The easiest way to create your own social website.]]></string>
+	<string name="_sys_splash_inp_postfix"><![CDATA[.online.me]]></string>
+	<string name="_sys_splash_inp_placeholder"><![CDATA[site address]]></string>
+	<string name="_sys_splash_btn_start"><![CDATA[Start]]></string>
+	<string name="_sys_splash_err_domain_incorrect"><![CDATA[Domain is essential. Please, fill in this field, for example, my-first-site.]]></string>
+	<string name="_sys_splash_err_domain_is_used"><![CDATA[The domain name is already used. Try to select another one.]]></string>
+	<string name="_sys_splash_err_service_not_available"><![CDATA[The service is currently not available. Try it later, please.]]></string>
+
 	<!-- General and Launcher -->
 	<string name="_adm_tmi_cpt_edit"><![CDATA[Manage Launcher]]></string>
 	<string name="_adm_tmi_cpt_favorite"><![CDATA[Show Favorite Only]]></string>

+ 10 - 1
modules/boonex/russian/data/langs/system.xml

@@ -1502,7 +1502,16 @@ Please click "Continue" below to navigate to the home page of the site.]]></stri
 	<string name="_Dashboard"><![CDATA[Dashboard]]></string>
 	<string name="_Status Message"><![CDATA[Status Message]]></string>
 	<string name="_Set up your status"><![CDATA[Set up your status]]></string>
-	
+
+	<!-- Splash -->
+	<string name="_sys_splash_slogan"><![CDATA[The easiest way to create your own social website.]]></string>
+	<string name="_sys_splash_inp_postfix"><![CDATA[.online.me]]></string>
+	<string name="_sys_splash_inp_placeholder"><![CDATA[site address]]></string>
+	<string name="_sys_splash_btn_start"><![CDATA[Start]]></string>
+	<string name="_sys_splash_err_domain_incorrect"><![CDATA[Domain is essential. Please, fill in this field, for example, my-first-site.]]></string>
+	<string name="_sys_splash_err_domain_is_used"><![CDATA[The domain name is already used. Try to select another one.]]></string>
+	<string name="_sys_splash_err_service_not_available"><![CDATA[The service is currently not available. Try it later, please.]]></string>
+
 	<!-- General and Launcher -->
 	<string name="_adm_tmi_cpt_edit"><![CDATA[Перестроить]]></string>
 	<string name="_adm_tmi_cpt_favorite"><![CDATA[Только Фавориты]]></string>

+ 214 - 0
splash.php

@@ -0,0 +1,214 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
+ */
+
+require_once('./inc/header.inc.php');
+require_once(BX_DIRECTORY_PATH_INC . "params.inc.php");
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+bx_import('BxDolLanguages');
+bx_import('BxDolPermalinks');
+bx_import('BxDolStudioTemplate');
+bx_import('BxTemplStudioMenuTop');
+bx_import('BxTemplFormView');
+
+class BxDolSplashMenuTop extends BxTemplStudioMenuTop
+{
+	function BxDolSplashMenuTop()
+	{
+		parent::BxTemplStudioMenuTop();
+
+		$oTemplate = BxDolStudioTemplate::getInstance();
+
+		$this->aVisible[BX_DOL_STUDIO_MT_LEFT] = true;
+		$this->aVisible[BX_DOL_STUDIO_MT_RIGHT] = true;
+
+		$this->aItems[BX_DOL_STUDIO_MT_LEFT] = $oTemplate->parseHtmlByName('splash_logo.html', array());
+        $this->aItems[BX_DOL_STUDIO_MT_RIGHT] = array(
+        	'site' => array(
+                'name' => 'profile',
+                'icon' => 'user',
+                'link' => BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'),
+                'title' => ''
+            )
+        );
+	}
+
+	function getInstance() {
+        if(!isset($GLOBALS['bxDolClasses']['BxDolSplashMenuTop']))
+            $GLOBALS['bxDolClasses']['BxDolSplashMenuTop'] = new BxDolSplashMenuTop();
+
+        return $GLOBALS['bxDolClasses']['BxDolSplashMenuTop'];
+    }
+}
+
+class BxDolSplashForm extends BxTemplFormView
+{
+	function BxDolSplashForm($oTemplate = false)
+	{
+		$aInfo = array(
+            'form_attrs' => array(
+				'id' => 'sys-splash-domain',
+			),
+			'params' => array(
+				'db' => array(
+					'submit_name' => 'domain_submit'
+				)
+			),
+            'inputs' => array (
+                'domain' => array(
+                    'type' => 'domain',
+                    'name' => 'domain',
+                	'value' => '',
+					'value_postfix' => _t('_sys_splash_inp_postfix'),
+					'value_button' => _t('_sys_splash_btn_start'),
+					'attrs' => array(
+						'placeholder' => _t('_sys_splash_inp_placeholder'),
+					),
+                    'db' => array (
+                        'pass' => 'Xss',
+                    ),
+                    'checker' => array (
+                        'func' => 'preg',
+                        'params' => array('/^[a-z0-9-]{3,}$/'),
+                        'error' => _t('_sys_splash_err_domain_incorrect'),
+                    ),
+                ),
+            )
+        );
+		parent::BxTemplFormView($aInfo, $oTemplate);
+	}
+
+	function isSubmittedAndNotValid ()
+	{
+        return $this->isSubmitted() && !$this->isValid();
+    }
+
+    function getNotValid()
+    {
+    	$aResult = array();
+    	if(!$this->isSubmitted() || $this->isSubmittedAndValid())
+    		return $aResult;
+
+    	foreach ($this->aInputs as $sKey => $aInput)
+    		$aResult[$sKey] = $aInput['error'];
+
+		return $aResult;
+    }
+
+	function genCustomRowDomain($aInput)
+	{
+		$sClass = 'bx-form-element-wrapper-' . $aInput['name'] . ' ';
+		if(isset($aInput['tr_attrs']['class']) && !empty($aInput['tr_attrs']['class']))
+			$aInput['tr_attrs']['class'] .= ' ' . $sClass;
+		else
+			$aInput['tr_attrs']['class'] = $sClass;
+
+		return $this->genRowStandard($aInput);
+	}
+
+	function genCustomInputDomain($aInput)
+	{
+		$sClass = 'bx-form-input-' . $aInput['name'];
+		$sClassesText = $sClassesButton = ''; 
+		if(isset($aInput['attrs']['class']) && !empty($aInput['attrs']['class'])) {
+			$sClassesText = $aInput['attrs']['class'] . ' ' . $sClass;
+			$sClassesButton = $aInput['attrs']['class'] . ' ' . $sClass . '-btn';
+		}
+		else  {
+			$sClassesText = $sClass;
+			$sClassesButton = $sClass . '-btn';
+		}
+
+		//--- Text input field
+		$aText = $aInput;
+		$aText['type'] = 'text';
+		$aText['attrs']['class'] = $sClassesText;
+		$sInput = $this->genInputStandard($aText);
+
+		//--- Text value 
+		if(isset($aInput['value_postfix']))
+			$sInput .= '<div class="' . $sClass . '-txt">' . $aInput['value_postfix'] . '</div>';
+
+		//--- Button field
+		$aButton = $aInput;
+		$aButton['type'] = 'submit';
+		$aButton['name'] .= '_submit';
+		$aButton['value'] = isset($aButton['value_button']) ? $aButton['value_button'] : '';
+		$aButton['attrs']['class'] = $sClassesButton;
+		$sInput .= $this->genInputButton($aButton);
+
+		return $sInput;
+	}
+
+	function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
+	{
+        header('Content-type: text/html; charset=utf-8');
+        require_once(BX_DIRECTORY_PATH_PLUGINS . 'Services_JSON.php');
+
+        $oParser = new Services_JSON();
+        $s = $oParser->encode($a);
+        if($isAutoWrapForFormFileSubmit && !empty($_FILES)) 
+            $s = '<textarea>' . $s . '</textarea>';
+
+        echo $s;
+    }
+}
+
+function getPageMainCode()
+{
+	$oTemplate = BxDolStudioTemplate::getInstance();
+	$oTemplate->addJs(array('jquery.form.js'));
+	$oTemplate->addCss(array('splash.css'));
+
+	$oForm = new BxDolSplashForm($oTemplate);
+	$oForm->initChecker();
+
+	if($oForm->isSubmittedAndNotValid()) {
+		$oForm->_echoResultJson(array('err' => $oForm->getNotValid()), true);
+		exit;
+	}
+
+	if($oForm->isSubmittedAndValid()) {
+		$sDomainKey = 'domain';
+		$sDomainValue = $oForm->getCleanValue($sDomainKey);
+
+		if(!BxDolRequest::serviceExists('bx_sites', 'is_used')) {
+        	$oForm->_echoResultJson(array('msg' => _t('_sys_splash_err_service_not_available')), true);
+            exit;
+        }
+
+        if(BxDolService::call('bx_sites', 'is_used', array($sDomainValue))) {
+        	$oForm->_echoResultJson(array('err' => array($sDomainKey => _t('_sys_splash_err_domain_is_used'))), true);
+            exit;
+        }
+
+		bx_import('BxDolSession');
+		BxDolSession::getInstance()->setValue('bx_sites_domain', $sDomainValue);
+
+		bx_import('BxDolPermalinks');
+		$sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account');
+		$oForm->_echoResultJson(array('eval' => 'window.open(\'' . $sUrl . '\', \'_self\');'), true);
+		exit;
+	}
+
+	return $oTemplate->parseHtmlByName('splash.html', array(
+		'form_id' => $oForm->aFormAttrs['id'],
+		'form' => $oForm->getCode()
+	));
+}
+
+check_logged();
+
+$oTemplate = BxDolStudioTemplate::getInstance();
+$oTemplate->setPageNameIndex(BX_PAGE_DEFAULT);
+$oTemplate->setPageContent ('menu_top', BxDolSplashMenuTop::getInstance()->getCode());
+$oTemplate->setPageContent ('page_main_code', getPageMainCode());
+$oTemplate->getPageCode();
+
+/** @} */

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 14 - 0
studio/template/css/default.css


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 14 - 1
template/css/default.css


+ 82 - 0
template/css/splash.css

@@ -0,0 +1,82 @@
+/*--- Overwrite Styles ---*/
+div.bx-std-menu-top-wrp {
+	margin-top: 75px;
+	margin-bottom: 75px;
+}
+div.bx-std-menu-top-left {
+	left: 40px;
+}
+div.bx-std-menu-top-right {
+	right: 40px;
+}
+
+/*--- Splash Logo Styles ---*/
+div.bx-splash-logo {}
+span.bx-spl-green {
+	color:#77cc31;
+}
+span.bx-spl-gray {
+	color:#d9d9d9;
+}
+
+/*--- Splash Styles ---*/
+div.bx-splash {
+	border-top: 1px solid #eeeeee;
+	border-bottom: 1px solid #eeeeee;
+	
+	-moz-box-shadow: 0px 1px 5px rgba(64,64,64,0.8);
+    -webkit-box-shadow: 0px 1px 5px rgba(64,64,64,0.8);
+    box-shadow: 0px 1px 5px rgba(64,64,64,0.8);
+}
+div.bx-spl-image {
+	width: 794px;
+	margin: 0px auto;
+}
+div.bx-spl-image img {
+	position: absolute;
+	top: -200px;
+}
+div.bx-spl-slogan {
+	padding-top: 370px;
+	text-align: center;
+}
+div.bx-spl-form {
+	padding: 30px 0px 60px 0px;
+	width: 600px;
+	margin: 0px auto;
+}
+
+/*--- Custom Form Elements ---*/
+div.bx-form-element-wrapper-domain {
+	padding-right: 178px;
+}
+div.bx-form-input-wrapper-domain {
+	position: relative;
+}
+input.bx-form-input-domain {
+	height: 60px;
+	padding-right: 142px;
+	border-radius:6px;
+	-moz-border-radius:6px;
+	-webkit-border-radius:6px;
+	line-height: 60px;
+	font-size: 28px;
+}
+div.bx-form-input-domain-txt {
+	position: absolute;
+	top: 0px;
+    right: 14px;
+    height: 60px;
+	line-height: 60px;
+	font-size: 28px;
+}
+button.bx-form-input-domain-btn {
+	position: absolute;
+	top: -5px;
+    left: 100%;
+	width: 178px;
+	height: 70px;
+	margin-left: -5px;
+	padding: 0px;
+	font-size: 28px;
+}

BIN
template/images/splash.png


+ 40 - 0
template/splash.html

@@ -0,0 +1,40 @@
+<div class="bx-splash bx-def-color-bg-page bx-def-noise">
+	<div class="bx-spl-image">
+		<img src="<bx_image_url:splash.png />" />
+	</div>
+	<div class="bx-spl-slogan bx-def-font-h1">
+		<bx_text:_sys_splash_slogan />
+	</div>
+	<div class="bx-spl-form">
+		__form__
+		<script type="text/javascript">
+            $(document).ready(function () {
+                $("#__form_id__").ajaxForm({ 
+                    dataType: "json",
+                    beforeSubmit: function (formData, jqForm, options) {
+                    	var oForm = $("#__form_id__");
+                    	oForm.find('.bx-form-warn').hide();
+
+                        bx_loading(oForm, true);
+                    },
+                    success: function (oData) {
+                    	bx_loading($("#__form_id__"), false);
+
+                    	if (oData && oData.msg != undefined) {
+                            alert(oData.msg);
+                        }
+
+                    	if (oData && oData.err != undefined) {
+                            for(var sKey in oData.err)
+                            	$('#bx-form-element-' + sKey + ' .bx-form-warn').html(oData.err[sKey]).show();
+                        }
+
+                    	if (oData && oData.eval != undefined) {
+                            eval(oData.eval);
+                        }
+                    }
+                });
+            });
+        </script>
+	</div>
+</div>

+ 3 - 0
template/splash_logo.html

@@ -0,0 +1,3 @@
+<div class="bx-splash-logo">
+	<span class="bx-spl-green">online</span><span class="bx-spl-gray">.me</span>
+</div>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio