top of page

Forum Posts

Alessandro Demontis
Jun 01, 2021
In Coding with Velo
Hi there, i was wondering if there is a way to create a DB from stratch using code. What i want to do is implement the 'create new photo album' for the users in my social network. I want them to select photos and upload them, and the code creates a new DB with the album title and uploads the images in a media gallery field. Any ideas? Thank you in advance! Alex
0
3
35
Alessandro Demontis
Nov 23, 2020
In Coding with Velo
Hi There, i am facing a problem i cannot solve; i have a repeater with 3 fields: - 2 text labels - 1 image It is connected to a database of user comments where users can store: - their name - their comment - an image attached to the comment The repeater of course contains a placeholder image which, after user's submit, shows the image the user has just uploaded and that has been stored in the comments database. The fact is: some users may want to attach an image, but some user may not... and at the moment, if the user does not load an image, the placeholder is shown. What i am trying to achieve is that the image is visible in the repeater only IF the it is written in the database, thus being a submitted image and not the placeholder. If the user only adds a text comment, the image placeholder is not shown in the repeater. Anyone has any idea? Thank you in advance.
0
7
152
Alessandro Demontis
Nov 04, 2020
In Coding with Velo
Hi guys, i have been asked to set up a little job search page for a friend 's website on wix... all is fine, except i cannot find a way to have a candidate - that is NOT registered on the website - answer to the job position inserted by a poster (registered on the site) via email. The page shows a form to be filled-in, and then a button by which the content of the input fields are sent via email to email present in the database and linked to that particular job offer. the database has these fields for each job offer: - poster full name - poster email - post title - post content the 'apply to job' page contains: - applicant name - applicant email - message what i need to do is that these 3 values are sent via an email to the 'poster email' saved in the database. Anyone has an idea? Thank you in advance. Alex
0
2
25
Alessandro Demontis
Oct 20, 2020
In Coding with Velo
Hi i am trying to send a string from a page to a lighbox... the sender code is: export function image39_click(event) { let name = $w('#title').text; local.setItem('targetName', name); wixWindow.openLightbox('sendChat'); the receiver code in the lightbox: let name = local.getItem('targetName'); $w("#text70").text = name; The problem is that #text70 is not updated with the value of #title that i am trying to pass. Is there something wrong in the code? The only doubt i have is that in the source page i am using both {session} and {local} for 2 different data transfer: session to receive data from another page, and local to send data to the lightbox
0
6
143
Alessandro Demontis
Oct 11, 2020
In Coding with Velo
HI guys, I have a page where i ca create newposts that are written in the database... you can add text and a picture, and it works quite fine as long as you indeed add a picture. But if you want to only post some text, it won't work until you select an image. The code i use is this: export async function button3_click(event) { let numberOfLikes = 0 let toInsert = { postCreatorId: $w('#dataset1').getCurrentItem()._id, //userprofile dataset postCreatorImage: $w('#dataset1').getCurrentItem().profileImage, postCreator: $w('#dataset1').getCurrentItem().fullName, post: $w('#dataset6').getCurrentItem().post, //userposts write dataset postTitle: $w('#dataset6').getCurrentItem().postTitle, postImage: await uploadFile(), _createdDate: $w('#dataset6').getCurrentItem()._createdDate, numberOfLikes : numberOfLikes, numberOfComments : 0, numberOfViews : 0, numberOfShares: 0 } wixData.insert("userPosts", toInsert) .then( (results) => { let item = results; console.log("OK") $w("#userPosts").refresh(); $w("#textBox1").value = " "; $w("#input1").value= " "; $w("#thumbImage").src = ""; $w('#button4').hide(); }) ; } function uploadFile(){ return $w('#uploadButton1').startUpload().then(r => r.url); } export function button4_click(event) { if($w("#uploadButton1").value.length > 0) { $w("#uploadButton1").startUpload() .then( (uploadedFile) => { $w("#thumbImage").src = uploadedFile.url; }) .catch( (uploadError) => { console.log("File upload error: " + uploadError.errorCode); console.log(uploadError.errorDescription); }); } else { } } export function uploadButton1_change(event) { if($w('#uploadButton1').value.length > 0) { $w('#button4').show(); } else { $w('#button4').hide(); } } I am struggling to change the code so that IF i select an image, THEN it will handle the image adding functions (uploadbutton change, uploadfile, and button 4.click), OTHERWISE it will only add the text post (post and postTitle fields, but not postImage field). Any advices? Thank you in advance.
Conditional posting with or without image content media
0
2
37
Alessandro Demontis
Sep 30, 2020
In Coding with Velo
Hi all, i have a database called Groups, where the name of the social groups is stored, and each record has a 'number of posts' field: When i add a post in a group, let's say Passione Musica! (record 4), i want the relevant numberOfPosts value increased. I am using 'eq' to filter, but i don't know how to set the 'then' part: wixData.query("Groups") .eq("groupName", $w('#text50').text) // text50 is the text where the Group Name is written in the dynaic page .find() .then( (results) => { ..... //here goes the rest of the code I guess i must use a R/W dataset to read the curent value and increase it. Anyone can help? Thank you as usual.
Increase value in database depending on a field content media
0
4
187
Alessandro Demontis
Sep 25, 2020
In Coding with Velo
Hello all, i am having a problem in comparing IDs from my userProfile database. Each user is stored with its own id, let's say... my ID is ca97c31f-8f52-456e-bc2e-482fe06c690d User A is ID c9d99e9b-3694-4db8-9c01-0827e9571255 Every user profile is loaded in a dynamic page that contains a button (Edit Profile) What i am trying to do is : if I visit my own profile page (based on the ID), the button is enabled, while if i visit User A profile page the button is disabled. I was thinking to use a comparison between my user ID (the visitor) and the User A ID (the visited profile), something like: if my ID = userA ID then $w("#button2").show() //the button appears only if i visit my own profile (IDs are equal) else $w("#button2").hide() //the button disappears if i visit another user's profile (IDs are not equal) but honestly don't know how to gather the IDs and set the if cicle... Anyone can help?
0
5
61
Alessandro Demontis
Sep 25, 2020
In Coding with Velo
Hi all, i wonder if there is a way to enable a button only after a file is selected via an Upload Button. I though i could edit the onClick event for the Upload Button, but i see that there is none generated when i use it... like as if the button itself was an event-trigger that does not need coding for the click event. Thanks in advance.
0
2
58
Alessandro Demontis
Sep 22, 2020
In Coding with Velo
Hi all, I am trying to increment the 'number of visits' counter in my database on page load, but there mustbe something wrong because value is not incremented in the database... my code: wixData.query("userPosts").find().then((result)=>{ let viewsitem = ("#dynamicDataset").getCurrentItem(); viewsitem.numberOfViews = viewsitem.numberOfViews+1; wixData.update("userPosts", viewsitem).then(()=>{ $w("#dynamicDataset").refresh(); }); }) ; What am i missing??
0
1
72
Alessandro Demontis
Sep 20, 2020
In Coding with Velo
It's about 3 weeks today since i started studying and coding on the Corvid platform, and during these weeks i' ve been testing my learning by creating a mini social network on Wix. I present you the result of my work so far, knowing it is an early stage and full of bugs. The name is !Yootie. I would like you to access it and have a look at all pages and functions, letting me know what improvements you would apply and how to solve the bugs. https://spherehost.wixsite.com/yootie You can access it with these credentials: email: testuser@yootie.com pass: yootieuser001 KNOWN BUGS when you Login, you are taken to your profile page but often the header buttons don't appear, you have to refresh the page in the User Wall page, you can only submit if you have added an image. Text-only posts won't be submitted (i don't know why!) when you like a post, the relevant field (numberOfLikes) in the userPosts database won't be incremented - [Solved] when you open a post in a dynamic single page, the numberOfViews should be incremented, but it is not [Solved] The first time you try to access the 'My Favorites' page it may show a blank or an error page, because you don't have any users added yet. Go to the Search Users / New Users page, visit a user, and add it to your favorites. Now your My Favorites page will work. Groups pages are 'free', i don't know how to add subscription. TO DO LIST Possibility to post videos [Done] Subscription request for Groups Listing of 'subscribed groups' for users Share [Done], Edit and Deletion of posts Saving videos [Done] and images to personal collection LIST OF IMPLEMETED FUNCTIONS: User Posts Wall (w. Likes, Shares & Comments) User Posts Search Recent Users List Users Search User Profile User Profile Edit Favorite Users (Friend list) Users Saved Posts Users Saved Videos User to User Message system Video Gallery (w. Comments & Likes, Save Video) Video Gallery Add Video Gallery Search Image Gallery (w. Comments & Likes) Image Gallery Add Image Gallery Search Groups Group Posts(w. Likes, Shares & Comments) Notifications ​Last update: Oct. 28th, 2020
My test Social Network for your reviews content media
0
0
37
Alessandro Demontis
Sep 16, 2020
In Coding with Velo
Hi in my dynamic single post page (a page where i load a user post with all comments) i am trying to filter the comments based on the post ID. I use a database called 'comments' which contains the the name and picture of the user that leaves the comment, and the content of the comment textbox. A field called 'sourcePostId' is used for every comment to identify to what post in particular that comment is related. As of now (without filtering), when a user writes a comment, the same comment is shown in all the single post dynamic pages... I tried filtering with this code: $w.onReady(function () { wixData.query("comments") //database name .eq("sourcePostId", ("#text49").text) //respectively field in the database and text label showing post ID .find() .then( (results) => { $w("#repeater1").data = results.items; }) .catch( (err) => { let errorMsg=err; }); }); where text49 is a label that shows that particular post ID (stored successfully in the sourcePostId field of the database). There are 2 catches, i don't know if they affect the result. 1) I also have another on.Ready section used for login check $w.onReady( () => { if(wixUsers.currentUser.loggedIn) { $w("#Like").show(); } else { $w("#Like").hide(); } } ); 2) the repeater is connected to a dataset querying the database to retrieve the user's image and full name I have been stuck on this for the last 2 hours or so, and i cannot come up with a solution.... Any suggestion would be appreciated. Thank you
Filtering content of repeater content media
0
0
26
Alessandro Demontis
Sep 16, 2020
In Coding with Velo
Hi I have a lightbox that i use to add comments to a post, and is opened by clicking on a button in the post's dynamic single item page. When i write the comment in the 'comments' database, i want to store the 'originating page' (meaning, the page from which i opened the lightbox) in the database field 'Originating page ID'. As of now, the 'insert' code in my lightbox is as follow: let toInsert = { commenterId: $w('#dataset1').getCurrentItem()._id, commenterImage: $w('#dataset1').getCurrentItem().profileImage, commenterName: $w('#dataset1').getCurrentItem().fullName, comment: $w('#comdatasetwrite').getCurrentItem().comment, _createdDate: $w('#comdatasetwrite').getCurrentItem()._createdDate, } wixData.insert("comments", toInsert) .then( (results) => { let item = results; console.log("OK") Where the 2 datasets are the ones used to connect to the userProfile database (dataset1) and Comments database (comdatasetwrite). I wonder if there is a way to add a row with something like this originatingPostID: ...... //(something goes here - i bet it must connect to the userPosts dataset?), Anyone can suggest a solution? Thank you in advance
0
4
213
Alessandro Demontis
Sep 15, 2020
In Coding with Velo
Hi all... my little social network exercise is going on, but i have a problem with favourites. I have set a myFavourites database, with field Owner visible and in the myFavourites(All) dynamic page i have a read only dataset connected to gather all favourites in a repeater. The point is, i cannot filter by Owner, because the field is not visible. The result is that since i cannot filter by owner, all users who access the 'my favourites' page from their profile see the same users in the list, instead of those they have added to their own list. How can i set the dataset properly or code a function that only shows each user's own favourites? As always, Thank you in advance! Alex
Problem with dataset filtering content media
0
0
9
Alessandro Demontis
Sep 05, 2020
In Coding with Velo
Hello I have created a dynamic page for user profiles. It contains ad Edit button, that should be visible and clickable ONLY if the page is opened by the user of that account. It should disappear when a user visits another user's profile page. How can i achieve this? Thank you in advance.
0
3
24
Alessandro Demontis
Sep 04, 2020
In Coding with Velo
Hi all, I've been trying to create a "Post new entry" lightbox that enables the user to create a new post to the website wall... my code is: export function button2_click(event) { let toInsert = { postCreatorId: $w('#dataset2').getCurrentItem()._id, postCreatorImage: $w('#dataset2').getCurrentItem().profileImage, postCreator: $w('#dataset2').getCurrentItem().fullName, post: $w('#dataset1').getCurrentItem().post, postImage: $w('#uploadButton1').startUpload, _createdDate: $w('#dataset1').getCurrentItem()._createdDate, numberOfLikes : "0" } wixData.insert("userPosts", toInsert) .then( (results) => { let item = results; console.log("OK") dataset2 is the dataset that contains user infos, reading from the userProfile database dataset1 is the dataset that contains all the elements of the post, writing to the userPosts database instead of linkink the button2 to dataset1 with action 'submit', i use the code above, and everything is fine as long as it concerns the post and _createdDate fields. But I cannot find a way to sent the image i select (via uploadButton1) to the database. I have also tried to use: postImage: $w('#dataset1').getCurrentItem().postImage, but the image is not added in the postImage field. Anyone has a clue? Thank you
0
3
41
Alessandro Demontis
Sep 02, 2020
In Coding with Velo
Hi, i successfully created a registration lightbox that writes to my custom userProfiles database, but i don't know how to set up a login lightbox that inputs email and passwords (both fields stored in the said database for each user) and checks if they exists, allowing login... what i want the lightbox to do is something like: if email in input form is present in the field email of a record in userProfiles database, AND input password is present in the same record of the userProfile database, then switch to page XXXX Any ideas? Thank you in advance
0
11
1k
Alessandro Demontis
Aug 29, 2020
In Coding with Velo
Hello everybody, I am moving my first steps with Corvid as i am developing a simple social network with posting and like system. It has a bunch of problems i need to solve, in this post i will just mention one that is bugging me... i need to implement the Like count. I mean, when somebody likes on a post via an icon, i want the number of likes to be shown near the icon. Here is how my page looks like in the Editor: So, everything has been connected via the datasets. The Like blue button is called Like, the Unlike red button is called Liked (and is hidden on load), the database is called Likes, ad the dataset is called Likes as well. The dataset, I have defined it as Read and Write, while the database contains a field called numberOfLikes set as a number, where i want to write to / gather from the number of likes for each post, that would be shown in the connected text between the 2 colored buttons (placeholder text: Likes). The full code of the image Like_Click event is like this: export function Like_click(event) { wixData.insert('Likes', {likedPost: $w('#userPosts').getCurrentItem()._id}), $w('#Liked').show(), $w('#Like').hide(); wixData.query("Likes").find().then((result)=>{ let likesitem = result.items[0]; let id = likesitem._id; likesitem.numberOfLikes++; wixData.update("Likes", likesitem).then(()=>{ $w("#Likes").refresh(); }); }) ; } Now, ignoring the part about userPosts, the actions to be accomplished by the click event are: - writing the post in a textfield (likedPost) in the Likes database via the Likes dataset - hiding the Like blue button - showing the red Liked button (to allow 'Unlike') - incrementing the value of the number in the database field numberOfLikes - retrieve the number just written in the numberOfLikes field in the Database and show it in the connected text between the 2 buttons. Everything is perfect in the first 3 points, but the 2 last points don't work, and i cannot figure out why... I don't get any error, simply the number does not show up. Looking at the Likes Database content, I can see that the numberOfLikes field has been updated, but it looks like every click on the Like button created a new record instead of updating the same one. Anybody please can help? I thank you in advance, please e patient as i am a complete beginner with Corvid. Alessandro EDIT: sorry, I posted this in the Tips section i did not realize this was the correct section of the forum.
Post Liking System content media
0
1
115

Alessandro Demontis

More actions
bottom of page