Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
Added a config file
Browse files Browse the repository at this point in the history
  • Loading branch information
breadtf committed Jun 25, 2023
1 parent 7a530f6 commit 4e7751c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
4 changes: 2 additions & 2 deletions admin/admin_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


<?php

$configs = include('../config.php');
session_start();

// Check if the user is an admin
Expand Down Expand Up @@ -49,7 +49,7 @@
<!DOCTYPE html>
<html>
<head>
<title>PHPSocial - Admin Panel</title>
<title><?php echo $configs["sitename"] ?> - Admin Panel</title>
<link rel="stylesheet" href="/css/admin.css">
</head>
<body>
Expand Down
7 changes: 7 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array(
'sitename' => 'PHPSocial',
'theme' => 'light.css', // Themes are stored in the /css directory, remeber to include the extension when changing the theme
'adminEnabled' => true
);
7 changes: 4 additions & 3 deletions dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


<?php
$configs = include('config.php');
session_start();

// Check if the user is logged in
Expand Down Expand Up @@ -112,8 +113,8 @@
<!DOCTYPE html>
<html>
<head>
<title>PHPSocial - Dashboard</title>
<link rel="stylesheet" href="css/light.css">
<title><?php echo $configs["sitename"] ?> - Dashboard</title>
<link rel="stylesheet" href="css/<?php echo $configs["themes"] ?>">
</head>
<body>
<div class="header">
Expand All @@ -123,7 +124,7 @@
<input type="submit" name="logout" value="Logout">
</form>
</div>
<h2>PHPSocial</h2>
<h2><?php echo $configs["sitename"] ?></h2>
</div>
<div class="wrapper">
<?php
Expand Down
1 change: 0 additions & 1 deletion db/request_logs.json
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

7 changes: 4 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
?>

<?php
$configs = include('config.php');
session_start();

// Check if the user is already logged in
Expand All @@ -36,15 +37,15 @@
<!DOCTYPE html>
<html>
<head>
<title>PHPSocial - Home</title>
<link rel="stylesheet" href="css/light.css">
<title><?php echo $configs["sitename"] ?> - Home</title>
<link rel="stylesheet" href="css/<?php echo $configs["theme"] ?>">
</head>
<body>
<div class="header">
<div class="login">
<a href="login.php">Login</a> <a href="register.php">Register</a>
</div>
<h2>PHPSocial</h2>
<h2><?php echo $configs["sitename"] ?></h2>
</div>
<div class="wrapper">
<!-- Bad solution, but I'm way too tired to fix it, should realy do checks before we actually try to use $messages. -->
Expand Down
3 changes: 2 additions & 1 deletion login.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


<?php
$configs = include('config.php');
session_start();

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
Expand Down Expand Up @@ -47,7 +48,7 @@
<!DOCTYPE html>
<html>
<head>
<title>PHPSocial - User Login</title>
<title><?php echo $configs["sitename"] ?> - User Login</title>
<link rel="stylesheet" href="css/login.css">
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion register.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


<?php
$configs = include('config.php');
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = $_POST['username'];
$password = $_POST['password'];
Expand Down Expand Up @@ -53,7 +54,7 @@
<!DOCTYPE html>
<html>
<head>
<title>PHPSocial - User Registration</title>
<title><?php echo $configs["sitename"] ?> - User Registration</title>
<link rel="stylesheet" href="css/login.css">
</head>
<body>
Expand Down

0 comments on commit 4e7751c

Please sign in to comment.