131 Posts
layonill
4 years ago
11
Topic

hi, I made a comment system, and I used this tutorial to embed user avatar in the comments https://www.seblod.com/resources/tutorials/embedding-an-author-s-avatar-in-the-item-list-or-content-view  

it works, the problem is that images appear broken like this 

how can ai fix that? that is the first question, how to fix those broken images

the second is, how do I add a DELETE button to comments but in a way that only appear the delete button of the current log in user, so it deletes only it's own comment?

those two questions

Get a Book for SEBLOD
131 Posts
layonill
4 years ago
0
Level 1

any ideas?

1283 Posts
Bucklash
4 years ago
1
Level 1

2

Use restriction setting (4)

might have to install extra restriction plugins, depends on restriction wanted.

If using article then I imagine can apply “workflow” -> author : current

or have a field in hidden that references the author id for the item, and then restriction would be “Fields” -> “some_field” -> is Equal / In: user -> property: id

131 Posts
layonill
4 years ago
0
Level 2

and about the broken image?

1283 Posts
Bucklash
4 years ago
0
Level 1

don’t know

depends on file name, markup, link generated etc... you gotta supply info and link to site etc to help with possible suggestikn

131 Posts
layonill
4 years ago
6
Level 1

because it gets the image from a table and it shows it with this <img src= "$cck->getText('avatar')" width="50" height="50">

but it appears broken

1283 Posts
Bucklash
4 years ago
5
Level 2

getValue would be the first choice 

131 Posts
layonill
4 years ago
4
Level 3

the problem is that it drags the route of the image from a select dynamic, as shown in here https://www.seblod.com/resources/tutorials/embedding-an-author-s-avatar-in-the-item-list-or-content-view

the only thing is that the image appears broken

1283 Posts
Bucklash
4 years ago
3
Level 4

So what value is in db?

what text is in s.dynamic

what is output in browser?

what is set for typo? 

what is location of image? etc etc......

131 Posts
layonill
4 years ago
2
Level 5

the value in the database is the user profile image, so the text in the dynamic select is the path of the image for example: images/629/untemarandom-logo.png

the select dynamic field is called avatar, it's query is free and is this one

SELECT b.foto_de_perfil AS text, a.id AS value FROM #__cck_store_form_perfil_usuario AS a LEFT JOIN #__cck_store_form_perfil_usuario AS b ON b.id = a.id

the typo is html and it is

<img src= "$cck->getText('avatar')" width="50" height="50">

the image is located in the database called perfil usuario, witch means user profile, and I am trying to put it in a list module of comments inside a content

1283 Posts
Bucklash
4 years ago
1
Level 6
SELECT b.foto_de_perfil AS text, a.id AS value 

FROM #__users AS a 

LEFT JOIN #__cck_store_form_perfil_usuario AS b 

ON b.id = a.id
1283 Posts
Bucklash
4 years ago
0
Level 7

that was different from tutorial

Get a Book for SEBLOD