public function DisableModule() { $database = Mysql::getConnection(); $database->Query("UPDATE " . TABLE_PREFIX . "modules SET moduleStatus='0' WHERE moduleId='{$this->moduleId}';"); $debug = new Debug(); $debug->debugMessage = Lang::$langData['moduleDisabled'] . " ({$this->moduleName})"; $debug->debugType = 0; $debug->StartDebug(); }
public static function SystemStop() { $stoppedFrom = debug_backtrace(); $stoppedFile = $stoppedFrom[0]['file']; $debug = new Debug(); $debug->debugMessage = 'System has been stopped from file: ' . $stoppedFile; $debug->StartDebug(); die("System has been stopped, check your debug!"); }
public static function Install($template) { require_once ABS_PATH . '/temp/' . $template . '/install.php'; $database = Mysql::getConnection(); $database->Query("INSERT INTO " . TABLE_PREFIX . "templates VALUES ('', '" . $installData['templateName'] . "', '" . $installData['templateAuthor'] . "', '" . $installData['templateVersion'] . "', '0','" . $installData['templateDescription'] . "');"); $debug = new Debug(); $debug->debugType = 0; $debug->debugMessage = Lang::$langData['installTemplate'] . " (" . $template . ")"; $debug->StartDebug(); }
public function SaveConfig() { $filename = ABS_PATH . '/config.php'; //if(file_exists($filename))unlink($filename); $configData = "<?php" . PHP_EOL . "/*" . PHP_EOL . " *\t@author: Tomáš Mičulka" . PHP_EOL . " *\t@version: 2.0" . PHP_EOL . " *\t@last_update: 6.1.2014 " . PHP_EOL . " */" . PHP_EOL . "defined('IN_INNE') or die('Acces denied!');" . PHP_EOL . "" . PHP_EOL . "//Database config" . PHP_EOL . "define('DB_HOST', '{$this->dbHost}');" . PHP_EOL . "define('DB_USER', '{$this->dbUser}');" . PHP_EOL . "define('DB_PASS', '{$this->dbPass}');" . PHP_EOL . "define('DB_NAME', '{$this->dbName}');" . PHP_EOL . "define('DB_VERSION', '{$this->dbVersion}');" . PHP_EOL . "define('TABLE_PREFIX', '{$this->tablePrefix}');" . PHP_EOL . "" . PHP_EOL . "//System config" . PHP_EOL . "define('SYS_LANG', '{$this->sysLang}');" . PHP_EOL . "define('SYS_DEBUG', '{$this->sysDebug}');" . PHP_EOL . "define('DEBUG_FILE', '{$this->sysDebugFile}');" . PHP_EOL . "define('SYS_TEMP', '{$this->webTemplate}');" . PHP_EOL . "define('ADM_VER', '{$this->sysAdmVer}');" . PHP_EOL . "define('ERROR_LEVEL', '{$this->sysErrorLevel}');" . PHP_EOL . "error_reporting({$this->sysErrorLevel});" . PHP_EOL . "define('GET_UPDATE', '{$this->update}');" . PHP_EOL . "define('USING_EXTERN', '{$this->extern}');" . PHP_EOL . "define('ABS_PATH', dirname(__FILE__));" . PHP_EOL . "" . PHP_EOL . "//Website config" . PHP_EOL . "define('WEBSITE_NAME', '{$this->webTitle}');" . PHP_EOL . "define('WEBSITE_DESCRIPTION', '{$this->webDescription}');" . PHP_EOL . "define('WEBSITE_AUTHOR', '{$this->webAuthor}');" . PHP_EOL . "define('WEBSITE_KEYWORDS', '{$this->webKeywords}');" . PHP_EOL . "define('WEBSITE_DEFAULT_PAGE', '{$this->webDefaultPage}');" . PHP_EOL . "define('WEBSITE_ADDRESS', '{$this->webAddress}');" . PHP_EOL . ""; $file = fopen($filename, "w+"); file_put_contents($filename, $configData); fclose($file); $debug = new Debug(); $debug->debugType = 0; $debug->debugMessage = Lang::$langData["debugChangeConfig"]; $debug->StartDebug(); }
public function Query($command) { if (!$command) { $debug = new Debug(); $debug->debugType = 2; $debug->debugMessage = 'Query command is empty!'; $debug->StartDebug(); return NULL; } $debug = new Debug(); $debug->debugType = 0; $debug->debugLevel = 1; $debug->debugMessage = 'Run query command: ' . $command; $debug->StartDebug(); $this->query = $this->handler->query($command); return $this->query; }
/** * @param $id * @return bool */ public function getInfo($id) { $database = Mysql::getConnection(); $id = $database->handler->real_escape_string($id); $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "m_gallery_pictures WHERE id='" . $id . "';"); if ($data->num_rows < 1) { $debug = new Debug(); $debug->debugType = 0; $debug->debugMessage = 'Picture with ID: ' . $id . ' not found!'; $debug->StartDebug(); return false; } else { $data = $data->fetch_array(); $this->id = $id; $this->name = $data["name"]; $this->description = $data["description"]; $this->file = $data["file"]; $this->gallery = new MGallery(); $this->gallery->getInfo($data["gallery_id"]); return true; } }
<?php /* * @author: Tomáš Mičulka * @version: 2.0 * @last_update: 15.4.2014 */ defined('IN_INNE') or die("Acces denied!"); $getToken = $_GET["token"]; $user = User::getInstance(); if ($user->userToken == $getToken && $user->userPerm == 5) { $templateId = InneAdm::$postData["id"]; $database = Mysql::getConnection(); $database->Query("UPDATE " . TABLE_PREFIX . "templates SET templateActive='0';"); $database->Query("UPDATE " . TABLE_PREFIX . "templates SET templateActive='1' WHERE templateId='{$templateId}';"); $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "templates WHERE templateActive='1';"); while ($row = $data->fetch_array()) { $templateName = $row['templateName']; } $config = new ConfigEditor(); $config->webTemplate = $templateName; $config->SaveConfig(); $debug = new Debug(); $debug->debugLevel = 0; $debug->debugType = 0; $debug->debugMessage = Lang::$langData["templateEnabled"]; $debug->StartDebug(); }