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:
eed0f48a-5824-4029-8b3f-ac8034af894b
User-ID
b2b666c0-9f35-4724-b383-fc859b53da94
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
adc17968-44ef-434d-a740-440dbae6bbb2
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
af87734f-4d1b-4287-ade6-baf83ee4cac0
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
8204793f-ddd1-4263-bee0-dd8159a0803b
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
57da6cbf-baea-4248-8b1c-e7e82fcc01f8
User-ID
2637ac67-c52c-4ef4-b6bc-c5ada484df1b
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
User-ID
0959096e-3e8e-4027-b2b5-d780c9bbd266
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
dc82698b-0cba-457d-958d-98bb5794bef8
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
6d47f4bb-dfc4-4436-b5f4-edab9d563e44
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
bbcc4945-e713-4b2a-a4b0-b2eb09d61154
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
f2b295a7-b849-4f79-b685-2335b0d62ad7
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
76d8e5bd-d085-490e-a335-45c6890948f3
Date:
01/19 - 01/23
Time:
01/19 - 01/23
Poster:
f7c060ed-197a-4edc-bcd4-84447dcb8226
User-ID
add7c029-fd35-40e2-89d6-5efc028de381
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()
})
})
})