Ejemplo n.º 1
0
 public function validate($a)
 {
     \Debug\Trace::mark();
     if ($a['lang']) {
         \Debug\Trace::mark();
         if ((int) $LanguageID && $LanguageID > 0) {
             \Debug\Trace::mark();
             $query = "SELECT LanguageID FROM languages WHERE LanguageID = ?";
         } else {
             \Debug\Trace::mark();
             $query = "SELECT abbr FROM languages WHERE abbr = ?";
         }
         $params = array($a['lang']);
         $res = $this->SelectQuery($this->con, $query, $params);
         if ($res) {
             \Debug\Trace::mark();
             return TRUE;
         } else {
             \Debug\Trace::mark();
             return FALSE;
         }
     }
     \Debug\Trace::mark();
     \Debug\Bug::fix(['log' => 'Не е зададен език при извикването на този метод.']);
 }
Ejemplo n.º 2
0
Archivo: Theme.php Proyecto: Vidov/CMS
 public function GetData($ThemeID = FALSE)
 {
     \Debug\Trace::mark();
     if (!$this->ThemeID) {
         \Debug\Trace::mark();
         $this->ThemeID = $ThemeID;
     }
     $query = "SELECT * FROM themes WHERE ThemeID = ?";
     $params = array($this->ThemeID);
     $res = $this->SelectQuery($this->con, $query, $params);
     if ($res) {
         \Debug\Trace::mark();
         return $res[0];
     }
 }
Ejemplo n.º 3
0
 public function state()
 {
     \Debug\Trace::mark();
     echo $this->ssl ? 'SSL' : 'no SSL';
     echo '<br>';
     echo $this->www ? 'WWW' : 'no WWW';
     echo '<br>';
     echo $this->language;
     echo '<br>';
     echo $this->subDomain;
     echo '<br>';
     echo $this->domain;
     echo '<br>';
     echo $this->domainExt;
     echo '<br>';
     echo '<pre>';
     var_dump($this->queryString);
     var_dump($this->hash);
     echo '<br>';
 }
Ejemplo n.º 4
0
Archivo: index.php Proyecto: Vidov/CMS
                                    readfile(T . $themeData['name'] . DIRECTORY_SEPARATOR . 'index.html');
                                    $DATA['themeData'] = $themeData;
                                    $_SESSION['DATA'] = $DATA;
                                    \Debug\Bug::boom($DATA);
                                } else {
                                    \Debug\Bug::boom(array('log' => 'Opa!', 'arr' => $DATA));
                                }
                            } else {
                                \Debug\Bug::boom(array('log' => 'Opa!', 'arr' => $DATA));
                            }
                        } else {
                            \Debug\Bug::boom(array('log' => 'Не е намерено ID-то на съдеъжанието!', 'arr' => $DATA));
                        }
                    }
                }
            } else {
                \Debug\Bug::boom(array('log' => 'App data is not available!', 'arr' => $DATA));
            }
        } else {
            \Debug\Bug::boom(array('log' => 'Opa!', 'arr' => $DATA));
        }
    } else {
        \Debug\Bug::boom(array('log' => 'Opa!', 'arr' => $DATA));
    }
} else {
    \Debug\Trace::mark();
    \Debug\Error::alert(['log' => 'domainNotFound']);
    $d = $Domain->getData(ROOT_DOMAIN);
    \Debug\Bug::boom(array('log' => 'Включва ROOT_DOMAIN!', 'arr' => $DATA));
}
exit;
Ejemplo n.º 5
0
 public function GetContentData($a)
 {
     \Debug\Trace::mark();
     if ($a['ID']) {
         \Debug\Trace::mark();
         if ($a['AppID']) {
             \Debug\Trace::mark();
             if ($a['LanguageID']) {
                 \Debug\Trace::mark();
                 $this->LanguageID = $a['LanguageID'];
                 switch ($this->current_mode) {
                     case 'site':
                         \Debug\Trace::mark();
                         $this->content_type = 'page';
                         break;
                     case 'shop':
                         \Debug\Trace::mark();
                         $this->content_type = 'product';
                         break;
                     default:
                         \Debug\Trace::mark();
                         \Debug\Bug::fix('Провери защо стана така');
                         break;
                 }
                 $t = $this->content_type;
                 $query = "SELECT * FROM " . $t . "s " . "INNER JOIN " . $t . "data ON " . $t . "s.ID = " . $t . "data.ContentID " . "WHERE " . $t . "s.ID = ? && " . $t . "s.AppID = ? && " . $t . "data.LanguageID = ?";
                 $params = array((int) $a['ID'], (int) $a['AppID'], (int) $a['LanguageID']);
                 $res = $this->SelectQuery($this->con, $query, $params);
                 if ($res) {
                     \Debug\Trace::mark();
                     $this->content_id = $a['ID'];
                     $this->contentLanguageID = $res[0]['LanguageID'];
                     // Ползва се от плъгините да си намерят ShortCodes -> value
                     $r['status'] = 1;
                     $r['data'] = $res[0];
                     return $r;
                 }
                 \Debug\Trace::mark();
                 $r['status'] = 0;
                 return $r;
             }
         }
     }
 }
Ejemplo n.º 6
0
Archivo: Site.php Proyecto: Vidov/CMS
 public function GetContentID($a)
 {
     \Debug\Trace::mark();
     if ($a['crumbs']) {
         \Debug\Trace::mark();
         if ($a['AppID']) {
             \Debug\Trace::mark();
             $crumbs = 0;
             // Ползва се от BodyContent->Crumbs за да отреже невалидните. Виж там
             $count = count($a['crumbs']);
             $query = "SELECT P.ID, PD.LanguageID FROM pages P INNER JOIN pageData PD ON P.ID = PD.ContentID WHERE P.ParentID = 0 && PD.title = ? && P.AppID = ?";
             $params = array($a['crumbs'][0], (int) $a['AppID']);
             $res = $this->SelectQuery($this->con, $query, $params);
             if ($res) {
                 \Debug\Trace::mark();
                 $crumbs++;
                 $ParentID = $res[0]['ID'];
                 $this->LanguageID = $res[0]['LanguageID'];
                 $this->FirstPageID = $ParentID;
                 if ($count == 1) {
                     \Debug\Trace::mark();
                     return ['status' => 1, 'crumbsCount' => $crumbs, 'ID' => $res[0]['ID']];
                 }
                 for ($i = 1; $i < $count; $i++) {
                     \Debug\Trace::mark();
                     $query2 = "SELECT P.ID, PD.LanguageID FROM pages P INNER JOIN pagedata PD ON P.ID = PD.ContentID WHERE P.ParentID = ? && PD.title = ? && P.AppID = ?";
                     $params2 = array($ParentID, $a['crumbs'][$i], $a['AppID']);
                     echo $query2;
                     var_dump($params2);
                     $res2 = $this->SelectQuery($this->con, $query2, $params2);
                     if ($res2) {
                         \Debug\Trace::mark();
                         $crumbs++;
                         $r['status'] = 1;
                         $r['crumbsCount'] = $crumbs;
                         $r['ID'] = $res2[0]['ID'];
                         $r['ParentID'] = $ParentID;
                         $ParentID = $res2[0]['ID'];
                         $this->LanguageID = $res2[0]['LanguageID'];
                     } else {
                         \Debug\Trace::mark();
                         $r['status'] = 0;
                         $r['crumbsCount'] = $crumbs;
                         $r['ID'] = $ParentID;
                     }
                 }
                 \Debug\Trace::mark();
                 return $r;
             } else {
                 \Debug\Trace::mark();
                 \Debug\Error::alert($a);
                 \Debug\Bug::fix($a);
             }
         } else {
             \Debug\Bug::fix($a);
         }
     }
     \Debug\Trace::mark();
     \Debug\Bug::fix($a);
     return FALSE;
 }
Ejemplo n.º 7
-1
Archivo: Text.php Proyecto: Vidov/CMS
 public static function isOnlyLatinLetters($text)
 {
     \Debug\Trace::mark();
     return ctype_alpha($text);
 }