From 726bdad304b65715cb2365906950c7872939807b Mon Sep 17 00:00:00 2001 From: cbo Date: Fri, 15 Mar 2024 23:31:38 +0000 Subject: [PATCH] Fixed /account articles not listing --- config/global.ini | 4 ++-- html/account/index.php | 7 +++---- include/init.php | 0 include/inputs.php | 0 include/objects.php | 0 include/panels.php | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) mode change 100644 => 100755 include/init.php mode change 100644 => 100755 include/inputs.php mode change 100644 => 100755 include/objects.php mode change 100644 => 100755 include/panels.php diff --git a/config/global.ini b/config/global.ini index 479b6ca7..2184a306 100755 --- a/config/global.ini +++ b/config/global.ini @@ -1,11 +1,11 @@ [root] -pageURL = "http://srv1.intra.e59.fr:8088/" +pageURL = "https://e59.fr/" filePath = "/var/www/e59/" [sql] databaseName = "E59" databaseUser = "root" -databasePass = "Broadca@Storm" +databasePass = "Broadca@Storm_SQL" databaseHost = "127.0.0.1" [main] diff --git a/html/account/index.php b/html/account/index.php index 0d16144b..36c23ac3 100755 --- a/html/account/index.php +++ b/html/account/index.php @@ -100,13 +100,12 @@ if (isset($_POST['userDisplayName']) && isset($_POST['userBio'])) { } } -$request = $pdo->prepare("SELECT ID, username, display_name, profile_picture, banner, bio FROM users WHERE ID = :userID"); +$request = $pdo->prepare("SELECT username, display_name, profile_picture, banner, bio FROM users WHERE ID = :userID"); $request->bindParam(":userID", $_SESSION['userID']); $request->execute(); $result = $request->fetchAll(PDO::FETCH_ASSOC); if($result) { - $userID = $result[0]['ID']; $userName = $result[0]['username']; $userDisplayName = $result[0]['display_name']; $userPPURL = $result[0]['profile_picture'] == NULL ? "https://abs.twimg.com/sticky/default_profile_images/default_profile_400x400.png" : $result[0]['profile_picture']; @@ -227,7 +226,7 @@ if($result) { $search = isset($_GET['search']) ? "%" . htmlspecialchars($_GET['search']) . "%" : "%%"; $request = $pdo->prepare("SELECT ID, title, date, miniature, resume FROM articles WHERE (title LIKE :search OR ID LIKE :search) AND author = :userID ORDER BY date DESC"); $request->bindParam(":search", $search); - $request->bindParam(":userID", $userID); + $request->bindParam(":userID", $_SESSION['userID']); $request->execute(); $result = $request->fetchAll(PDO::FETCH_ASSOC); echo ('

Vos articles

'); @@ -238,7 +237,7 @@ if($result) { if ($result) { echo('
'); - listArticles($result, $rootPageURL); + listArticles($result, $rootPageURL, $badges); echo ('
'); } else { echo ('Vous n\'avez publiƩ aucun article...'); diff --git a/include/init.php b/include/init.php old mode 100644 new mode 100755 diff --git a/include/inputs.php b/include/inputs.php old mode 100644 new mode 100755 diff --git a/include/objects.php b/include/objects.php old mode 100644 new mode 100755 diff --git a/include/panels.php b/include/panels.php old mode 100644 new mode 100755 index f5cb41e1..74ec810d --- a/include/panels.php +++ b/include/panels.php @@ -1,4 +1,4 @@ -