top of page

Simple-Comment-Box

NoImage.png

User

User-ID

CODE
INFO
Project-Structure
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
f7c060ed-197a-4edc-bcd4-84447dcb8226

Poster:

f7c060ed-197a-4edc-bcd4-84447dcb8226

User-ID

3d3941b6-eba7-4d8e-a8e2-457be06746d6

Date:

01/19 - 01/23

Time:

01/19 - 01/23

Poster:

User-ID

f1118afd-0dfc-44e0-ad36-df1f75034951

Date:

01/19 - 01/23

Time:

01/19 - 01/23

Poster:

User-ID

069d4a7c-3555-4210-8999-1c2d64d3d65f

Date:

01/19 - 01/23

Time:

01/19 - 01/23

57da6cbf-baea-4248-8b1c-e7e82fcc01f8

Poster:

57da6cbf-baea-4248-8b1c-e7e82fcc01f8

User-ID

d1d3a763-fa95-417f-9902-4dab292be1e9

Date:

01/19 - 01/23

Time:

01/19 - 01/23

57da6cbf-baea-4248-8b1c-e7e82fcc01f8

Poster:

57da6cbf-baea-4248-8b1c-e7e82fcc01f8

User-ID

5f69ac92-b905-4171-aad8-78effe4f9b79

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

ea24dd48-b657-448c-a8ad-4c0cd9ac6d66

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

814151e5-3b11-470c-88f5-8ed034c77c9c

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

608e4416-be3f-4056-b725-9bc1feedd52e

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

87f26e6a-c20b-4247-8de6-a9150f2c6c6d

Date:

01/19 - 01/23

Time:

01/19 - 01/23

eed0f48a-5824-4029-8b3f-ac8034af894b

Poster:

eed0f48a-5824-4029-8b3f-ac8034af894b

User-ID

65160f2f-0f01-4834-976b-372b90a1228b

Date:

01/19 - 01/23

Time:

01/19 - 01/23

Poster:

User-ID

db569485-457e-498c-9a4e-c31da90ba287

Date:

01/19 - 01/23

Time:

01/19 - 01/23

Poster:

User-ID

d09b41b5-b3e1-4f3c-b8d2-31ede3b856d4

Date:

01/19 - 01/23

Time:

01/19 - 01/23

INFO

CLOSE.png

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

CLOSE.png

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()

        })

    })

})

DB-STRUCTURE

PMD (PrivateMembersData)

Databse.png
Avatar-000.png

Picture

Column-ID ---> "picture"

CLOSE.png

Your own (Member-DB)

Databse.png
Avatar-000.png

User-Pic

Column-ID ---> "profilePic"

Your own (Commets-DB)

Databse.png
Avatar-000.png

Profile-Pic

Column-ID ---> "userPic"

bottom of page