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

Commit 4e7751c

Browse files
committed
Added a config file
1 parent 7a530f6 commit 4e7751c

File tree

7 files changed

+21
-11
lines changed

7 files changed

+21
-11
lines changed

admin/admin_panel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
<?php
23-
23+
$configs = include('../config.php');
2424
session_start();
2525

2626
// Check if the user is an admin
@@ -49,7 +49,7 @@
4949
<!DOCTYPE html>
5050
<html>
5151
<head>
52-
<title>PHPSocial - Admin Panel</title>
52+
<title><?php echo $configs["sitename"] ?> - Admin Panel</title>
5353
<link rel="stylesheet" href="/css/admin.css">
5454
</head>
5555
<body>

config.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
return array(
4+
'sitename' => 'PHPSocial',
5+
'theme' => 'light.css', // Themes are stored in the /css directory, remeber to include the extension when changing the theme
6+
'adminEnabled' => true
7+
);

dashboard.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121

2222
<?php
23+
$configs = include('config.php');
2324
session_start();
2425

2526
// Check if the user is logged in
@@ -112,8 +113,8 @@
112113
<!DOCTYPE html>
113114
<html>
114115
<head>
115-
<title>PHPSocial - Dashboard</title>
116-
<link rel="stylesheet" href="css/light.css">
116+
<title><?php echo $configs["sitename"] ?> - Dashboard</title>
117+
<link rel="stylesheet" href="css/<?php echo $configs["themes"] ?>">
117118
</head>
118119
<body>
119120
<div class="header">
@@ -123,7 +124,7 @@
123124
<input type="submit" name="logout" value="Logout">
124125
</form>
125126
</div>
126-
<h2>PHPSocial</h2>
127+
<h2><?php echo $configs["sitename"] ?></h2>
127128
</div>
128129
<div class="wrapper">
129130
<?php

db/request_logs.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

index.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
?>
2020

2121
<?php
22+
$configs = include('config.php');
2223
session_start();
2324

2425
// Check if the user is already logged in
@@ -36,15 +37,15 @@
3637
<!DOCTYPE html>
3738
<html>
3839
<head>
39-
<title>PHPSocial - Home</title>
40-
<link rel="stylesheet" href="css/light.css">
40+
<title><?php echo $configs["sitename"] ?> - Home</title>
41+
<link rel="stylesheet" href="css/<?php echo $configs["theme"] ?>">
4142
</head>
4243
<body>
4344
<div class="header">
4445
<div class="login">
4546
<a href="login.php">Login</a> <a href="register.php">Register</a>
4647
</div>
47-
<h2>PHPSocial</h2>
48+
<h2><?php echo $configs["sitename"] ?></h2>
4849
</div>
4950
<div class="wrapper">
5051
<!-- Bad solution, but I'm way too tired to fix it, should realy do checks before we actually try to use $messages. -->

login.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121

2222
<?php
23+
$configs = include('config.php');
2324
session_start();
2425

2526
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
@@ -47,7 +48,7 @@
4748
<!DOCTYPE html>
4849
<html>
4950
<head>
50-
<title>PHPSocial - User Login</title>
51+
<title><?php echo $configs["sitename"] ?> - User Login</title>
5152
<link rel="stylesheet" href="css/login.css">
5253
</head>
5354
<body>

register.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121

2222
<?php
23+
$configs = include('config.php');
2324
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
2425
$username = $_POST['username'];
2526
$password = $_POST['password'];
@@ -53,7 +54,7 @@
5354
<!DOCTYPE html>
5455
<html>
5556
<head>
56-
<title>PHPSocial - User Registration</title>
57+
<title><?php echo $configs["sitename"] ?> - User Registration</title>
5758
<link rel="stylesheet" href="css/login.css">
5859
</head>
5960
<body>

0 commit comments

Comments
 (0)