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
f6fb1370-c95c-4521-a115-69959dbea6d1
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
52777a49-f270-4a79-824e-f97fe1bd09f4
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
6e2099d7-dbbb-45a5-9799-004999256e1e
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
1d33c9d5-6524-440a-9b26-5a898aa18209
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
e4bfa989-d823-41cd-89e0-724823214cf3
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
46d663c6-3c02-4008-83fd-8dfd4fecb626
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
efc622e0-d648-42c1-8e87-10a47cfdd8ae
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
198c0f8d-0ddb-4a99-b366-a2279e765a56
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
f80e4984-c75b-4b51-a2fd-0be357ef3230
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
f7d36e19-112a-4bbd-8d33-196caea96d2e
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
f6065248-3a2f-410f-b828-ef7f983da967
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
eed0f48a-5824-4029-8b3f-ac8034af894b
User-ID
177217fe-6a69-4b55-8c54-23a5e646656d
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()
})
})
})