Simple-Comment-Box
User
User-ID
Title | Comment | User-Pic |
---|---|---|
sadasdasdasd | ||
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | Arthur you little HACKER ! | |
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | Arthur you little HACKER ! | |
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | Arthur you little HACKER ! | |
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | Arthur you little HACKER ! | |
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | Arthur you little HACKER ! | |
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | Arthur you little HACKER ! | |
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | Arthur you little HACKER ! | |
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | Arthur you little HACKER ! | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | hi | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | hello | |
eed0f48a-5824-4029-8b3f-ac8034af894b | All the user which are also registered in my own DATABASE, are able to use this comment-box.... | |
eed0f48a-5824-4029-8b3f-ac8034af894b | Ok, here another TEST-ACC | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | wahoooooo | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | test | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | test | |
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | And YES, as you have already recognized it, there a a few bugs, which have to be modified and optimized. | |
Yes, this EXAMPLE will only work with registered USER, which also are inserted into the own DATABASE ---> "Member-Data" | ||
f7c060ed-197a-4edc-bcd4-84447dcb8226 | hahahahahaaaaaaaaa | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | hahahahahaaaaaaaaa | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | wahiiiiiiii | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | haaaaaaa | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | haaaaaaa | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | kkkkk hello | |
^^ | ||
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | weqweqweqweqw | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | Ok, this pic isn't updating. This needs fixing russian-dima | |
new message from another account | ||
f7c060ed-197a-4edc-bcd4-84447dcb8226 | yahooooooooooooo | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | This has to auto refresh comments as I can't see my comment un till I refresh page ^^ | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | This has to auto refresh comments as I can't see my comment un till I refresh page ^^ | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | flower | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | bird | |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | hello! I am arthur
| |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | hello! I am arthur
| |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | hello! I am arthur
| |
f7c060ed-197a-4edc-bcd4-84447dcb8226 | hello! I am arthur
| |
wqewqeqeqeqeqeq | ||
i am an unregistrated user | ||
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | 13123123123 | |
57da6cbf-baea-4248-8b1c-e7e82fcc01f8 | 1312323213 | |
eed0f48a-5824-4029-8b3f-ac8034af894b | w4wewwewqewqewqe | |
eed0f48a-5824-4029-8b3f-ac8034af894b | 12312323ewqeqwewqewe | |
eed0f48a-5824-4029-8b3f-ac8034af894b | mmmm | |
eed0f48a-5824-4029-8b3f-ac8034af894b | wqewqewewqe | |
eed0f48a-5824-4029-8b3f-ac8034af894b | 45rre4564564trtzr | |
eweqeqweqeqeqe | ||
313121232131231223 |
Poster:
User-ID
83b59c6f-2139-42b9-86fb-3fc958ea8b88
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
fc5f09cd-9a0f-4754-8616-216ac7ef0733
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
43bb2153-5377-4794-b4a5-ba7014c10e76
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
User-ID
09bb2cdc-7477-41fe-8700-e84298eff214
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
5d801e1e-1b36-459f-8427-65d8cbf2b773
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
aa6fa588-0c12-47e0-94de-b9b6d634aae4
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
9be81b85-8d40-4c9a-86ab-b1bfc46edbed
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
c0bc03d6-017d-43f2-853a-d61669bbb565
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
191fe303-e02b-46f9-9787-ee5e27674645
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
67e9e22f-af56-4c20-ac3d-fd849272ada3
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
dd9786a1-7945-42d7-8d4b-60bf59d87aa3
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
9b30b7ac-a860-43ef-88ae-e1b95296ad76
Date:
01/19 - 01/23
Time:
01/19 - 01/23
INFO
In this example you will see a simple structured comment-box.
​
To use this example you will have to register all the users in the own database ---> "Member-Data" first.
​
Just the user which are included in this database, will be able to submit comments.
CODE
import wixData from 'wix-data';
import wixUsers from 'wix-users';
var picData
var ownerId
var membersData
$w.onReady(function () {
$w("#dataset1").onReady( () => {
let userId = wixUsers.currentUser.id
console.log(userId)
wixData.query("Member-Data")
.eq('_owner', userId)
.find()
.then( (results) => {
membersData = results.items[0];
console.log(membersData)
ownerId = membersData._owner;
console.log(ownerId)
picData = results.items[0].profilePic
console.log(picData)
$w('#input1').value=userId
$w('#input2').value=userId
$w('#image1').src=picData
})
.catch( (err) => {
let errorMsg = err;
});
$w('#dataset2').onBeforeSave(()=>{console.log("Prepare-Data")
$w("#dataset2").setFieldValues( {
"title": $w('#input1').value,
"comment": $w('#textBox1').value,
"userPic": picData
});
console.log(picData)
})
$w('#button1').onClick(async()=>{console.log("Save-Data")
$w("#dataset2").save()
})
})
})