micmac473 / junktrade

0 stars 0 forks source link

Add profile picture (Add default null value in DB) #1

Closed micmac473 closed 7 years ago

micmac473 commented 7 years ago

Add functionality to upload profile picture for the current user and display it in the header If no profile picture is uploaded then default profile picture is logo

micmac473 commented 7 years ago

Instead of using a function to set the default profile picture if a user doesn't have one, we can set the profile picture path as the default value in the database field

MikMontoute commented 7 years ago

i dont have separate functions for viewing default and actual profile pics. just if that field is NULL use that path else use the path which is in the record

if($pp == "null"){ return ""; } else{ return ""; }

MikMontoute commented 7 years ago

the 2 functions that are there is one for the profile page and one for when a user profile is being viewed

micmac473 commented 7 years ago

I got you. But I doh find the default one working because I don't see the picture if I don't upload an image. So to avoid that, we can just set the default value of profilepicture in the users table to defaultPP.jpg then when they upload a new picture it'll update. What you think? The function for the other user's profile is fine.

MikMontoute commented 7 years ago

lol it work trust me its just the DB have to REDO to reflect what we want..... Just make the profilepicture field nullable and default so once a record is made it will be set to null at first.... that is the null my function is looking for.. not null as in an empty field... null as in DB NULL

micmac473 commented 7 years ago

Lol ohh okay. I got you now. Well that's an easy fix