"; endforeach; } function write_ini_file($content, $path) { if (!$handle = fopen($path, 'w')) { return false; } $success = fwrite($handle, $content); fclose($handle); return $success; } if(isset($_POST['action'])) : $action = $_POST['action']; endif; if($action == "createLocation") : $databaseData = '; ' . "\r\n"; foreach ($_POST as $postName => $postValue) { if($postName !== "action") : if(substr($postValue, -1) == "/") : $postValue = rtrim($postValue, "/"); endif; $databaseData .= $postName . " = \"" . $postValue . "\"\r\n"; endif; } write_ini_file($databaseData, $databaseLocation); endif; if(!file_exists($databaseLocation)) : $configReady = "No"; $userpic = ""; else : $configReady = "Yes"; require_once("user.php"); $USER = new User("registration_callback"); $dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db"; $database = new PDO("sqlite:" . $dbfile); $query = "SELECT * FROM users"; foreach($database->query($query) as $data) { $needSetup = "No"; } $db = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db"; $file_db = new PDO("sqlite:" . $db); $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbTab = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"'); $dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"'); foreach($dbTab as $row) : if (in_array("tabs", $row)) : $tabSetup = "No"; endif; endforeach; if($tabSetup == "Yes") : $settingsActive = "active"; endif; foreach($dbOptions as $row) : if (in_array("options", $row)) : $hasOptions = "Yes"; endif; endforeach; if($tabSetup == "No") : if($USER->authenticated && $USER->role == "admin") : $result = $file_db->query('SELECT * FROM tabs WHERE active = "true"'); $getsettings = $file_db->query('SELECT * FROM tabs WHERE active = "true"'); foreach($getsettings as $row) : if(!empty($row['iconurl']) && $settingsicon == "No") : $settingsicon = "Yes"; endif; endforeach; elseif($USER->authenticated && $USER->role == "user") : $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND user = "true"'); else : $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND guest = "true"'); endif; endif; if($hasOptions == "Yes") : $resulto = $file_db->query('SELECT * FROM options'); foreach($resulto as $row) : $title = $row['title']; $topbartext = $row['topbartext']; $topbar = $row['topbar']; $bottombar = $row['bottombar']; $sidebar = $row['sidebar']; $hoverbg = $row['hoverbg']; $activetabBG = $row['activetabBG']; $activetabicon = $row['activetabicon']; $activetabtext = $row['activetabtext']; $inactiveicon = $row['inactiveicon']; $inactivetext = $row['inactivetext']; endforeach; endif; $userpic = md5( strtolower( trim( $USER->email ) ) ); endif; ?>

Error: error; ?>