Example #1
0
 private function getDefaultLang()
 {
     $query = "Select `lang` from `Lang` where `default`='1' limit 0,1;";
     $mySqlHelper = new MySqlHelper($query);
     $langInfo = $mySqlHelper->getDataRow(0);
     $this->defaultLang = $langInfo['lang'];
 }
Example #2
0
 private function getSliderData()
 {
     $query = "select * from `Sliders` where `alias`='" . $this->name . "';";
     $mySqlHelper = new MySqlHelper($query);
     $this->data = $mySqlHelper->getDataRow(0);
     $this->getSlidesData();
 }
Example #3
0
 private function getMenuData()
 {
     $query = "select `name`, `type`, `cssClass` from `Menu`\n            where `name` = '" . $this->menuName . "'";
     $mySqlHelper = new MySqlHelper($query);
     $this->menuData = $mySqlHelper->getDataRow(0);
     $this->menuType = $this->menuData['type'];
     $this->menuCssClass = $this->menuData['cssClass'];
 }
Example #4
0
 public function __construct()
 {
     $query = "Select * from `ROOT_SETTINGS` where `activated`='1' limit 0,1;";
     $mySqlHelper = new MySqlHelper($query);
     $this->conf = $mySqlHelper->getDataRow(0);
     $this->hostName = $_SERVER["SERVER_NAME"];
     $this->hostIp = $_SERVER["SERVER_ADDR"];
     $this->remoteIp = $_SERVER["REMOTE_ADDR"];
 }
Example #5
0
 private function getMaterialData()
 {
     $query = "select * from `Materials` where `alias`='{$this->malerial}'";
     $mySqlHelper = new MySqlHelper($query);
     $this->malerialData = $mySqlHelper->getDataRow(0);
     if (count($this->malerialData) == 0) {
         $this->noData = true;
         return;
     }
     $this->getMaterialDataText();
     $this->getCategories();
 }
Example #6
0
<?php

global $_PARAM;
$query = "select * from `Jquery` where version='" . $_PARAM['version'] . "' and min='" . $_PARAM['min'] . "'";
$mySqlHelper = new MySqlHelper($query);
$data = $mySqlHelper->getDataRow(0);
$insertString = "<script type='text/javascript' src='./plugins/jquery/lib/" . $data['fileName'] . "'></script>";
echo $insertString;
//echo $data['fileName'];
?>

Example #7
0
 /**
  * Получение информации о странице
  */
 private function getPagesDate()
 {
     $query = "\n            Select\n            PgCoEl.`alias`, \n            PgCoEl.`showTitle`, \n            PgCoEl.`cssClasses`, \n            PgCoEl.`componentElement`, \n            PgCoEl.`template`, \n            PgCoEl.`isMainPage`, \n            PgCoEl.`index`, \n            PgCoEl.`follow`, \n            PgCoEl.`archive`,\n            PgCoEl.`componentElementName`,\n            PgCoEl.`component`, \n            PgCoEl.`mainPage`, \n            PgCoEl.`printPage`, \n            PgCoEl.`mobilePage`, \n            PgCoEl.`head`, \n            PgCoEl.`bodyStart`, \n            PgCoEl.`bodyEnd`,\n            Te.`main` as templateMain, \n            Te.`mobile` as templateMobile, \n            Te.`print` as templatePrint\n            from (\n                Select\n                Pg.`alias`, \n                Pg.`showTitle`, \n                Pg.`cssClasses`, \n                Pg.`componentElement`, \n                Pg.`template`, \n                Pg.`isMainPage`, \n                Pg.`index`, \n                Pg.`follow`, \n                Pg.`archive`,\n                CoEl.`alias` as componentElementName,\n                CoEl.`component`, \n                CoEl.`mainPage`, \n                CoEl.`printPage`, \n                CoEl.`mobilePage`, \n                CoEl.`head`, \n                CoEl.`bodyStart`, \n                CoEl.`bodyEnd`\n                from `Pages` as Pg left join `ComponentsElements` as CoEl\n                on Pg.`componentElement` = CoEl.`id`\n                where Pg.`alias` = '" . $this->page . "'\n            ) as PgCoEl left join `Templates` as Te\n            on PgCoEl.`template` = Te.`alias`;";
     $mySqlHelper = new MySqlHelper($query);
     $pageData = $mySqlHelper->getDataRow(0);
     $this->pageData['alias'] = $pageData['alias'];
     $this->pageData['showTitle'] = $pageData['showTitle'] > 0;
     $this->pageData['cssClasses'] = $pageData['cssClasses'] != null ? $pageData['cssClasses'] : "";
     $this->pageData['componentElement'] = $pageData['componentElement'];
     $this->pageData['template'] = $pageData['template'];
     $this->pageData['isMainPage'] = $pageData['isMainPage'] > 0;
     $this->pageData['index'] = $pageData['index'] > 0;
     $this->pageData['follow'] = $pageData['follow'] > 0;
     $this->pageData['archive'] = $pageData['archive'] > 0;
     $this->pageData['componentElementName'] = $pageData['componentElementName'];
     $this->pageData['component'] = $pageData['component'];
     $componentElementPath = $this->componentPath . $this->pageData['component'] . "/" . $this->pageData['componentElementName'] . "/";
     $this->pageData['mainPage'] = $componentElementPath . "/" . $pageData['mainPage'];
     $this->pageData['printPage'] = $componentElementPath . "/" . $pageData['printPage'];
     $this->pageData['mobilePage'] = $componentElementPath . "/" . $pageData['mobilePage'];
     $this->pageData['head'] = $pageData['head'] != null ? $componentElementPath . $pageData['head'] : null;
     $this->pageData['bodyStart'] = $pageData['bodyStart'] != null ? $componentElementPath . $pageData['bodyStart'] : null;
     $this->pageData['bodyEnd'] = $pageData['bodyEnd'] != null ? $componentElementPath . $pageData['bodyEnd'] : null;
     $this->pageData['templatePath'] = "./templates/" . $this->pageData['template'] . "/";
     $this->pageData['templateMain'] = $this->pageData['templatePath'] . $pageData['templateMain'];
     $this->pageData['templateMobile'] = $this->pageData['templatePath'] . $pageData['templateMobile'];
     $this->pageData['templatePrint'] = $this->pageData['templatePath'] . $pageData['templatePrint'];
 }
Example #8
0
 private function getTotalLang($lang)
 {
     $query = "Select * from `Lang` where `lang`='{$lang}';";
     $mySqlHelper = new MySqlHelper($query);
     $this->totalLang = $mySqlHelper->getDataRow(0);
 }
Example #9
0
 /**
  * Конструктор.
  * @param type $tableName - название таблицы локализатора.
  * @param type $langColumn - название столбца хранящего информацию о языке.
  * @param type $selectionColumn - название столбца по которому производится отбор данных.
  * @param type $selectionValue - значение столбца по которому производится отбор данных.
  * @param type $lang - язык.
  */
 public function __construct($tableName, $langColumn, $selectionColumn, $selectionValue, $lang)
 {
     $query_ok = "select * from `Lang` as T1 left join `{$tableName}` as T2\n            on T1.`lang` = T2.`{$langColumn}`\n            where T1.`lang` = '{$lang}' and  T2.`{$selectionColumn}` = '{$selectionValue}'\n            limit 0, 1;";
     $query_default = "select * from `Lang` as T1 left join `{$tableName}` as T2\n            on T1.`lang` = T2.`{$langColumn}`\n            where T1.`default` = '1' and T2.`{$selectionColumn}` = '{$selectionValue}' \n            limit 0, 1;";
     $query_else = "select * from `Lang` as T1 left join `{$tableName}` as T2\n            on T1.`lang` = T2.`{$langColumn}`\n            where T2.`{$selectionColumn}` = '{$selectionValue}'\n            limit 0, 1;";
     $this->data = null;
     $this->keys = null;
     $mySqlHelper1 = new MySqlHelper($query_ok);
     $this->data = $mySqlHelper1->getDataRow(0);
     $this->keys = $mySqlHelper1->getDataKeys();
     if ($this->data != null && count($this->data) > 0) {
         $this->langType = 1;
     } else {
         $this->data = null;
         $this->keys = null;
         $mySqlHelper2 = new MySqlHelper($query_default);
         $this->data = $mySqlHelper2->getDataRow(0);
         $this->keys = $mySqlHelper2->getDataKeys();
         if ($this->data != null && count($this->data) > 0) {
             $this->langType = 0;
         } else {
             $this->data = null;
             $this->keys = null;
             $mySqlHelper3 = new MySqlHelper($query_else);
             $this->data = $mySqlHelper3->getDataRow(0);
             $this->keys = $mySqlHelper3->getDataKeys();
             if ($this->data != null && count($this->data) > 0) {
                 $this->langType = 0;
             } else {
                 $this->langType = -1;
             }
         }
     }
 }