-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfriends.php
30 lines (25 loc) · 876 Bytes
/
friends.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
// include "Credential-Template.php";
// include "DBConnection-Function.php";
include "ModifyDarkModeState.php";
include "time_change.php";
//if (!isset($_SESSION['user_token'])){
// session_start();
//}
$dom = new DOMDocument();
$dom->loadHTMLFile("friends.html");
$username = "nothing";
if (isset($_SESSION['user_token']) && isset($_SESSION['user_username'])) {
$username = $_SESSION['user_username']; // Retrieve the username from the session
}
$conn = get_database_connection(HOST, H_USERNAME, H_PASSWORD, DATABASE);
$currstate = retrievedarkmodestate($username, $conn);
if($currstate==1){
$node0 = $dom->getElementbyId("stylesheets");
$node0->setAttribute('href',"friends-dark.css");
}
else{
$node0 = $dom->getElementbyId("stylesheets");
$node0->setAttribute('href',"friends.css");
}
echo $dom->saveHTML();