Exemple #1
0
 private function __construct()
 {
     $SKT = SKTGLOBALS::getVar('SKT');
     $SKTDB = SKTDB\db_Skt::connect();
     $Request = new \CmsDev\Url\Request();
     $URLName = $Request->byLevel(0);
     $RequestReverse = new \CmsDev\Url\Request();
     $RequestReverse->reverse(false);
     $testLanguage = $RequestReverse->byLevel(0);
     $LanguageArray = $SKT['LANGUAGE']['LIST'];
     if (in_array($testLanguage, $LanguageArray)) {
         $Language = $testLanguage;
     } else {
         $Language = \LANGUAGE_DEF;
     }
     if (\SKT_SECTION_PID != '') {
         $ProductsValues = $SKTDB->query("SELECT * FROM " . \DB_PREFIX . "products WHERE ProductID = '" . \SKT_SECTION_PID . "'");
     }
     $SKTDB->query("SELECT * FROM " . \DB_PREFIX . "products WHERE UID != '0' LIMIT 1");
     $query = $SKTDB->get_col_info();
     if ($ProductsValues) {
         foreach ($query as $name) {
             $this->{$name} = $ProductsValues->{$name};
         }
     } else {
         foreach ($query as $name) {
             $this->{$name} = '';
         }
     }
 }
Exemple #2
0
 private function __construct()
 {
     if (!defined('DB_PREFIX')) {
         define('DB_PREFIX', 'default_');
     }
     $SKT = SKTGLOBALS::getVar('SKT');
     $SKTDB = SKTDB\db_Skt::connect();
     $SectionValues = '';
     $ParentSectionValues = '';
     $Parent_2_SectionValues = '';
     $Parent_3_SectionValues = '';
     $Parent_4_SectionValues = '';
     $Parent_5_SectionValues = '';
     // new \_TemplateSite\clean\Config();
     // sections //  ID 	Title 	URLName 	SID 	RecycleBin 	SystemRequired 	Language 	Template 	Order
     $SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE URLName = '" . \SKTURL_Here . "'");
     if (isset($SectionValues->SID) && $SectionValues->SID != '') {
         $ParentSectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$SectionValues->SID}'");
         if (isset($ParentSectionValues->SID) && $ParentSectionValues->SID != '') {
             $Parent_2_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$ParentSectionValues->SID}'");
             if (isset($Parent_2_SectionValues->SID) && $Parent_2_SectionValues->SID != '') {
                 $Parent_3_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$Parent_2_SectionValues->SID}'");
                 if (isset($Parent_3_SectionValues->SID) && $Parent_3_SectionValues->SID != '') {
                     $Parent_4_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$Parent_3_SectionValues->SID}'");
                     if (isset($Parent_4_SectionValues->SID) && $Parent_4_SectionValues->SID != '') {
                         $Parent_5_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$Parent_4_SectionValues->SID}'");
                     }
                 }
             }
         }
     }
     if (!$SectionValues) {
         $SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE Language = '" . \SKT_ThisLaguage . "' AND SID = '0' ");
         if (!$SectionValues) {
             $SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE SID = '0' AND Language = '" . \SKT_ThisLaguage . "'");
         }
         if (\SKTURL_Here != '' && \SKTURL_Here != trim(\SKTURL_REQUEST_URI, '/') && !\in_array(\SKTURL_Here, $SKT['LANGUAGE']['LIST']) && !\in_array(\SKTURL_Here, $SKT['SITE']['RESTRICTED_URL'])) {
             if (!defined("error")) {
                 define('error', 'error404');
             }
         }
     }
     $IDSections = $SectionValues->ID;
     $_SESSION['SessionURLSection'] = $SKTDB->get_var("SELECT URLName FROM " . \DB_PREFIX . "sections WHERE ID = '{$IDSections}'");
     if (!defined("SectionHidden")) {
         define('SectionHidden', $SectionValues->RecycleBin);
     }
     $SKTDB->query("SELECT * FROM " . \DB_PREFIX . "sections WHERE SID = '0'");
     $query = $SKTDB->get_col_info();
     foreach ($query as $name) {
         $this->{$name} = $SectionValues->{$name};
     }
     $this->ParentSectionValues = $ParentSectionValues;
     $this->Parent_2_SectionValues = $Parent_2_SectionValues;
     $this->Parent_3_SectionValues = $Parent_3_SectionValues;
     $this->Parent_4_SectionValues = $Parent_4_SectionValues;
     $this->Parent_5_SectionValues = $Parent_5_SectionValues;
 }
Exemple #3
0
<?php

if (!isset($GLOBALS['SKT'])) {
    if (session_id() == '') {
        session_start();
    }
    $SKTAJAX = 'AJAX';
    require '../../../Config.php';
    require '../../../db.php';
    require '../../Core.php';
}
$SKTDB = \CmsDev\sql\db_Skt::connect();
$glob = \CmsDev\util\globals::init();
$SKT = $glob->getVar('SKT');
$SKT_ADMIN = $glob->getVar('SKTADMIN');
$SKTListFieldType = $SKT['SKTListFieldType'];
$SKTListFieldSize = $SKT['SKTListFieldSize'];
function ListField($field)
{
    if ($field !== null && $field !== '' && $field !== 'undefined') {
        $fieldtrue = explode('|', $field);
        return utf8_encode($fieldtrue[1]);
    }
}
function ListFieldType($field)
{
    if ($field !== null && $field !== '' && $field !== 'undefined') {
        $fieldtrue = explode('|', $field);
        return $fieldtrue[0];
    }
}
Exemple #4
0
 public function render()
 {
     $SKT = \CmsDev\util\globals::getVar('SKT');
     $DBG = '';
     $DBGText = '';
     $this->defined = '';
     if ($SKT['DEBUG'] === 1) {
         $DBG = 'debug';
         $DBGText = '<b>Debug Mode On</b>';
     }
     $script = '<script type="text/javascript"> $(document).ready(function() {   $("#DevShowParams #Variables").accordion({ header: "h3", collapsible: true, heightStyle: "content" }); });</script>';
     $this->render = '<div id="DevShowParams" class="scrolling skt SKTNotRemove"><div id="Variables">' . $this->DevShowParams . '</div><div id="defined">' . $this->defined . '</div></div>' . $script;
     if ($SKT['DEVSHOW'] === 1) {
         echo $this->render;
     }
 }
Exemple #5
0
 public function Render($SocialRegister = false)
 {
     $SKT = \CmsDev\util\globals::getVar('SKT');
     $TPL = \ltrim(\LOCAL_DIR . \SKTURL_TemplateSite . '/SKT_Theme_Parts/PersonMarkupUser.tpl');
     $SKT_TPL = \ltrim(\SKT_SYS . '/SKT_Theme_Parts/PersonMarkupUser.tpl', '/');
     $TPLCSS = \ltrim(\LOCAL_DIR . \SKTURL_TemplateSite . '/SKT_Theme_Parts/PersonMarkupUser.css');
     $SKT_TPLCSS = \ltrim(\SKT_SYS . '/css/PersonMarkupUser.css', '/');
     if (file_exists($TPL)) {
         $personMarkupTPL = \file_get_contents($TPL);
     } else {
         $personMarkupTPL = \file_get_contents($SKT_TPL);
     }
     if (file_exists($TPLCSS)) {
         $CSS = '<link rel="stylesheet" type="text/css" href="' . \SKTURL_TemplateSite . '/SKT_Theme_Parts/PersonMarkupUser.css" media="all"/>';
     } else {
         $CSS = '<link rel="stylesheet" type="text/css" href="' . \SKT_SYS . '/css/PersonMarkupUser.css" media="all"/>';
     }
     if ($SocialRegister == "SocialRegister") {
         $personMarkupTPL = '<a class="ConnectGoogle sktToolTip btn btn-danger" title="{GoogleLoginTitle}" href="{GoogleLoginLink}"><i class="skt-icon-google-plus"></i> {GoogleLoginText}</a>';
     }
     $USER_EXIST = \CmsDev\Security\loginIntent::action('validateUser');
     $Markup_Google = new \CmsDev\google\oauth();
     $googleUser = $Markup_Google->GoogleUser();
     if ($googleUser == true) {
         $USER_EXIST = true;
     }
     if ($USER_EXIST == true) {
         if ($SKT['Access']['GenericUser'] == 1) {
             $Build = $this->GenericUser(true, $personMarkupTPL);
         }
         if ($SKT['Access']['Google'] == 1) {
             $Build = $this->Google(true, $Build);
         }
         if ($SKT['Access']['Facebook'] == 1) {
             $Build = $this->Facebook(true, $Build);
         }
         $personMarkupTPL = $Build;
         if (!defined('TypeUser')) {
             define('TypeUser', 'Customers');
         }
         if (\TypeUser == 'Customers') {
             $personMarkupTPL = \SKTremoveTags('sktSell', $personMarkupTPL);
             $personMarkupTPL = \SKTremoveTags('sktUserOptions', $personMarkupTPL);
         } else {
             $personMarkupTPL = \SKTremoveTags('sktUserOptionsCustomer', $personMarkupTPL);
         }
         $personMarkupTPL = \str_replace('{InitSessionBotton}', $SKT['TXT_Hi'] . $_SESSION['UserName'], $personMarkupTPL);
         $personMarkupTPL = \str_replace('{Avatar}', \SKTServerURL . 'SKTSize/avatar.png?30', $personMarkupTPL);
         $personMarkupTPL = \SKTreplaceTags('sktgenericuseraccess', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktfacebookaccess', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktgoogleaccess', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktAvatar', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktUserOptions', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktUserOptionsCustomer', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktSell', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTremoveTags('sktloginoptions', $personMarkupTPL);
         return $CSS . $personMarkupTPL;
     } else {
         $personMarkupTPL = SKTremoveTags('sktUserOptions', $personMarkupTPL);
         $personMarkupTPL = \SKTreplaceTags('sktavataranon', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktloginoptions', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktgenericuseraccess', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktfacebookaccess', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = \SKTreplaceTags('sktgoogleaccess', '', $personMarkupTPL, 1, 0);
         $personMarkupTPL = SKTremoveTags('sktAvatar', $personMarkupTPL);
         $personMarkupTPL = \str_replace('{InitSessionBotton}', $SKT['TXT_Hi'] . $SKT['TXT_anonymous'], $personMarkupTPL);
         $personMarkupTPL = \str_replace('{Avatar}', \SKTServerURL . 'SKTSize/avatar.png?30', $personMarkupTPL);
         if ($SKT['Access']['Google'] == 1) {
             $Build = $this->Google(false, $Build);
         } elseif ($SKT['Access']['Facebook'] == 1) {
             $Build = $this->Facebook(false, $Build);
         } elseif ($SKT['Access']['GenericUser'] == 1) {
             $Build = $this->GenericUser(false, $personMarkupTPL);
         } else {
         }
         $personMarkupTPL = \SKTreplaceTags('sktloginoptions', $this->Markup_GenericUser . $this->Markup_Google . $this->Markup_Facebook, $personMarkupTPL, 1, 0);
         $personMarkupTPL = $Build;
         echo $CSS . \CmsDev\skt_Code::Charset($personMarkupTPL);
     }
 }