Merge pull request #60 from ThomasRubini/apprs_profile_pic
This commit is contained in:
commit
e6d5c63694
@ -188,9 +188,17 @@ final class UserController
|
||||
$O_userModel = new UserModel();
|
||||
$A_user = $O_userModel->getUserByID($A_urlParams[0]);
|
||||
|
||||
header("Content-Type: image/png");
|
||||
if (!isset($A_user)) {
|
||||
die();
|
||||
}
|
||||
|
||||
header("Content-Type: image/png");
|
||||
if ($A_user["PROFILE_PIC"] === null) {
|
||||
echo file_get_contents(Constants::rootDir()."/static/img/generic_user.jpg");
|
||||
} else {
|
||||
echo $A_user["PROFILE_PIC"];
|
||||
}
|
||||
|
||||
echo $A_user["PROFILE_PIC"];
|
||||
|
||||
return Utils::RETURN_RAW;
|
||||
}
|
||||
|
@ -6,7 +6,9 @@ final class ApprModel {
|
||||
{
|
||||
$O_model = Model::get();
|
||||
$stmt = $O_model->prepare("
|
||||
SELECT APPRECIATION.*, USER.USERNAME as AUTHOR_NAME FROM APPRECIATION
|
||||
SELECT APPRECIATION.*, USER.USERNAME as AUTHOR_NAME,
|
||||
CONCAT('/user/profilePic/', APPRECIATION.AUTHOR_ID) AS AUTHOR_IMG_LINK
|
||||
FROM APPRECIATION
|
||||
JOIN USER ON USER.ID = APPRECIATION.AUTHOR_ID
|
||||
WHERE RECIPE_ID = :recipe_id
|
||||
");
|
||||
@ -15,10 +17,6 @@ final class ApprModel {
|
||||
|
||||
$rows = $stmt->fetchAll();
|
||||
|
||||
foreach($rows as &$row) {
|
||||
$row["AUTHOR_IMG_LINK"] = "/static/img/users/1.jpg";
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 452 KiB After Width: | Height: | Size: 452 KiB |
Loading…
Reference in New Issue
Block a user