Fixed /account articles not listing
This commit is contained in:
parent
c6ae14314c
commit
726bdad304
@ -1,11 +1,11 @@
|
|||||||
[root]
|
[root]
|
||||||
pageURL = "http://srv1.intra.e59.fr:8088/"
|
pageURL = "https://e59.fr/"
|
||||||
filePath = "/var/www/e59/"
|
filePath = "/var/www/e59/"
|
||||||
|
|
||||||
[sql]
|
[sql]
|
||||||
databaseName = "E59"
|
databaseName = "E59"
|
||||||
databaseUser = "root"
|
databaseUser = "root"
|
||||||
databasePass = "Broadca@Storm"
|
databasePass = "Broadca@Storm_SQL"
|
||||||
databaseHost = "127.0.0.1"
|
databaseHost = "127.0.0.1"
|
||||||
|
|
||||||
[main]
|
[main]
|
||||||
|
@ -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->bindParam(":userID", $_SESSION['userID']);
|
||||||
$request->execute();
|
$request->execute();
|
||||||
$result = $request->fetchAll(PDO::FETCH_ASSOC);
|
$result = $request->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if($result) {
|
if($result) {
|
||||||
$userID = $result[0]['ID'];
|
|
||||||
$userName = $result[0]['username'];
|
$userName = $result[0]['username'];
|
||||||
$userDisplayName = $result[0]['display_name'];
|
$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'];
|
$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']) . "%" : "%%";
|
$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 = $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(":search", $search);
|
||||||
$request->bindParam(":userID", $userID);
|
$request->bindParam(":userID", $_SESSION['userID']);
|
||||||
$request->execute();
|
$request->execute();
|
||||||
$result = $request->fetchAll(PDO::FETCH_ASSOC);
|
$result = $request->fetchAll(PDO::FETCH_ASSOC);
|
||||||
echo ('<h1>Vos articles</h1>');
|
echo ('<h1>Vos articles</h1>');
|
||||||
@ -238,7 +237,7 @@ if($result) {
|
|||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
echo('<div class="articles-list">');
|
echo('<div class="articles-list">');
|
||||||
listArticles($result, $rootPageURL);
|
listArticles($result, $rootPageURL, $badges);
|
||||||
echo ('</div>');
|
echo ('</div>');
|
||||||
} else {
|
} else {
|
||||||
echo ('Vous n\'avez publié aucun article...');
|
echo ('Vous n\'avez publié aucun article...');
|
||||||
|
0
include/init.php
Normal file → Executable file
0
include/init.php
Normal file → Executable file
0
include/inputs.php
Normal file → Executable file
0
include/inputs.php
Normal file → Executable file
0
include/objects.php
Normal file → Executable file
0
include/objects.php
Normal file → Executable file
2
include/panels.php
Normal file → Executable file
2
include/panels.php
Normal file → Executable file
@ -1,4 +1,4 @@
|
|||||||
<?
|
<?php
|
||||||
|
|
||||||
function fillHead($rootPageURL, $pageTitle, $darkTheme, $lightTheme) {
|
function fillHead($rootPageURL, $pageTitle, $darkTheme, $lightTheme) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user