Hi, how i can create a public profile page that shows only the photos uploaded by the user?
(like ig or facebook profile)
Perhaps by comparing the USERS/OWNERS-ID when quering your DATABASE ?
Which fields you would need to achieve your aim ?
- USER-FIRST-NAME
- USER-LAST-NAME
- USER-ID / OWNER-ID
- IMAGE-FIELD
So, next when a USER is logged in onto your website → you do this…
https://www.wix.com/velo/reference/wix-users/currentuser
Now you know is the current user who wants to see some data out of your DATABASE.
All you have to do now is to grab the current-USER’s ID and filter for all the items stored in your DB with the same-ID, because all these items inside DB were created by the current logged in USER.
VOILA IT’S DONE!
Fotgot to mention, that you first have to store the urls of your UPLOADs inside the DATABASE ( of course for each single USER ), so you are able to use them later.
@russian-dima
Hi, first of all thanks for the reply. I built a kind of social network, but I can’t create a profile page that will only show the profile pictures.
lets say, “user” upload 4 pictures to the site, i want that only his pictures show on his profile and when people open his profile they see his 4 pictures.
@ohad55517
Yes, i already understood and gave you a possible way how to solve it.
S tep-1: Writing DATA into DB!
User do the image-upload.
You grab the file-url after upload is done.
You paste the uploaded-file-url into your Collection/Database, corresponding to the user’s current-ID and the user-values/data, like first-name, last-name and whatever . And of course you do it for all of 4-images, which will be uploaded by the user.
Step-1 is done the needed data is inside your COlLECTION/DATABASE.
Step-2: Reading DATA out of DB (filtering function).
Now a user logs in again and wants to see his uploaded files on a specific public profile-page. He navigates to this frofile-page clicks for example a button → “SHOW-ME-MY-Pics” and a filtering function start it’s work to find all related/corresponding DATA out of your COLLECTION which will fit the SEACH-CRITERIA.
Your RESULT will be ??? → Exactly the found 4-pics you want!
Now navigate to the VELO-API-DOCs and start your coding adventure with a search for the following searchwords …
- query / wix-data / eq / hasSome / find
- save / bulkSave / insert /bulkInsert / update / bulkUpdate and so on…
Read all provided informations.
Understand it first and then start your codings.
VELO-API-DOCs: → https://www.wix.com/velo/reference/api-overview