TC CMS Lizenz?

  • Bittö


    <?php
    /*
    * The ____ _ _
    * | _ \| | | |
    * | |_) | |_ _ ___| |__ ___ _ __ _ __ _ _
    * | _ <| | | | |/ _ \ '_ \ / _ \ '__| '__| | | |
    * | |_) | | |_| | __/ |_) | __/ | | | | |_| |
    * |____/|_|\__,_|\___|_.__/ \___|_| |_| \__, |
    * __/ |
    * |___/ CMS
    * @author Caglar <Caglar@outlook.de>
    * @Copyright 2015 Caglar
    */
    namespace System\View;
    class View {
    private $controller, $action, $file, $header, $footer, $_data = array();
    public $plugins, $isPlugin;

    public function __construct($controller, $action, $plugins, $isPlugin) {
    $this->controller = $controller;
    $this->plugins = $plugins;
    $this->action = $action;
    $this->isPlugin = $isPlugin;
    }

    public function get($key) {
    return $this->_data[$key];
    }

    public function set($key, $value) {
    $this->_data[$key] = $value;
    }

    } else {


    if(!$this->isPlugin) {
    $this->file = "./Application/View/{$this->controller}/{$this->action}.php";
    if(!file_exists($this->file)) {
    $this->file = "./Application/View/Error/Index.php";
    }
    } else {
    $this->path = "./Application/Plugins/{$this->plugins[$this->controller]["Author"]}/{$this->controller}";
    $this->header = "{$this->path}/Templates/Header.php";
    $this->file = "{$this->path}/Pages/{$this->action}.php";
    $this->footer = "{$this->path}/Templates/Footer.php";
    if(!file_exists($this->file)) {
    $this->file = "./Application/View/Error/Index.php";
    }
    }

    extract($this->_data);
    ob_start();
    switch($custom) {
    case 0:
    require_once("./Application/View/Header.php");
    require_once($this->file);
    require_once("./Application/View/Footer.php");
    break;
    case 2:
    if($this->isPlugin) {
    require_once($this->header);
    }
    require_once($this->file);
    if($this->isPlugin) {
    require_once($this->footer);
    }
    break;
    default:
    require_once($this->file);
    }
    $output = ob_get_contents();
    ob_end_clean();
    echo $output;
    }
    }
    ?>

  • Wo war davor die Abfrage?

    Das kann so auch nicht funktionieren, da zuviele Klammern sind.

    Versuch das mal, wobei es schwer ist, wenn du irgendwo ein else reintust und ich nicht weiß, wo die alte Abfrage war.

    :P

  • <?php
    /*
    * The ____ _ _
    * | _ \| | | |
    * | |_) | |_ _ ___| |__ ___ _ __ _ __ _ _
    * | _ <| | | | |/ _ \ '_ \ / _ \ '__| '__| | | |
    * | |_) | | |_| | __/ |_) | __/ | | | | |_| |
    * |____/|_|\__,_|\___|_.__/ \___|_| |_| \__, |
    * __/ |
    * |___/ CMS
    * @author Caglar <Caglar@outlook.de>
    * @Copyright 2015 Caglar
    */
    namespace System\View;
    class View {
    private $controller, $action, $file, $header, $footer, $_data = array();
    public $plugins, $isPlugin;

    public function __construct($controller, $action, $plugins, $isPlugin) {
    $this->controller = $controller;
    $this->plugins = $plugins;
    $this->action = $action;
    $this->isPlugin = $isPlugin;
    }

    public function get($key) {
    return $this->_data[$key];
    }

    public function set($key, $value) {
    $this->_data[$key] = $value;
    }

    public function display($custom = null) {
    if(!defined("LICENSE") || LICENSE !== strtoupper(sha1(md5(sha1($_SERVER["SERVER_NAME"])) * 60 * 60 * 3600))) {
    if(file_exists("{$_SERVER["DOCUMENT_ROOT"]}/Exceptions/License.Exception")) {
    die(file_get_contents("{$_SERVER["DOCUMENT_ROOT"]}/Exceptions/License.Exception"));
    } else {
    die("Ungültige Lizenz");
    }
    }

    if(!$this->isPlugin) {
    $this->file = "./Application/View/{$this->controller}/{$this->action}.php";
    if(!file_exists($this->file)) {
    $this->file = "./Application/View/Error/Index.php";
    }
    } else {
    $this->path = "./Application/Plugins/{$this->plugins[$this->controller]["Author"]}/{$this->controller}";
    $this->header = "{$this->path}/Templates/Header.php";
    $this->file = "{$this->path}/Pages/{$this->action}.php";
    $this->footer = "{$this->path}/Templates/Footer.php";
    if(!file_exists($this->file)) {
    $this->file = "./Application/View/Error/Index.php";
    }
    }

    extract($this->_data);
    ob_start();
    switch($custom) {
    case 0:
    require_once("./Application/View/Header.php");
    require_once($this->file);
    require_once("./Application/View/Footer.php");
    break;
    case 2:
    if($this->isPlugin) {
    require_once($this->header);
    }
    require_once($this->file);
    if($this->isPlugin) {
    require_once($this->footer);
    }
    break;
    default:
    require_once($this->file);
    }
    $output = ob_get_contents();
    ob_end_clean();
    echo $output;
    }
    }
    ?>


    Da wo ungültige Lizenz steht :)

  • :P

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!